[PATCH] D42843: Ensure that Elf_Rel addends are always written for dynamic relocations

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 07:26:37 PST 2018


grimar added inline comments.


================
Comment at: test/ELF/convert-rel-rela-addends.s:103
+.data
+.ifdef IS_64
+.quad foo + 0x5544
----------------
arichardson wrote:
> This ugly hack is needed because LLD will reject R_X86_64_32 relocations in shared objects but 16 and 64 bit is fine. Not sure why this is the case as the dynamic linker can just write the correct value to data section.
We do not allow 32 bits relocations because they might overflow in runtime. 

May be I am missing something, but I do not understand why we allow 16 bit relocations in dso. I think it is a bug.
Though bfd allows them too, gold rejects them and that is what I would expect.

Usually we don't mix i386 and x64 test cases in a single test, so I would split it probably.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42843





More information about the llvm-commits mailing list