diff options
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r-- | lld/ELF/InputSection.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 568b99ba8b9..f02106a4ce7 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -215,13 +215,11 @@ getSymVA(uint32_t Type, typename ELFT::uint A, typename ELFT::uint P, // should be initialized by 'page address'. This address is high 16-bits // of sum the symbol's value and the addend. return Out<ELFT>::Got->getMipsLocalPageOffset(Body.getVA<ELFT>(A)); - case R_MIPS_GOT_LOCAL: - // For non-local symbols GOT entries should contain their full - // addresses. But if such symbol cannot be preempted, we do not - // have to put them into the "global" part of GOT and use dynamic - // linker to determine their actual addresses. That is why we - // create GOT entries for them in the "local" part of GOT. - return Out<ELFT>::Got->getMipsLocalEntryOffset(Body.getVA<ELFT>(A)); + case R_MIPS_GOT_OFF: + // In case of MIPS if a GOT relocation has non-zero addend this addend + // should be applied to the GOT entry content not to the GOT entry offset. + // That is why we use separate expression type. + return Out<ELFT>::Got->getMipsGotOffset(Body, A); case R_PPC_OPD: { uint64_t SymVA = Body.getVA<ELFT>(A); // If we have an undefined weak symbol, we might get here with a symbol |