Skip to content

Commit eadbfa8

Browse files
committed
Honor explicit addends in PowerPC GLOB_DAT relocations.
1 parent e9c43cf commit eadbfa8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎arch/powerpc/arch_ppc.cpp‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2572,9 +2572,8 @@ class PpcElfRelocationHandler: public RelocationHandler
25722572
writePointer(target);
25732573
break;
25742574
case R_PPC_GLOB_DAT:
2575-
// R_PPC64_GLOB_DAT requires S + A. Keep the existing 32-bit
2576-
// handler behavior separate from this PPC64 fix.
2577-
writePointer(arch->GetAddressSize() == 8 ? target + info.addend : target);
2575+
// Both R_PPC_GLOB_DAT and R_PPC64_GLOB_DAT require S + A.
2576+
writePointer(target + info.addend);
25782577
break;
25792578
case R_PPC_PLTREL24:
25802579
dest32[0] = swap((swap(dest32[0]) & 0xfc000003) |

0 commit comments

Comments
 (0)