[PATCH] D42790: [ELF] Ensure that Elf_Rela addends are always written with -r

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 06:51:35 PST 2018


grimar added a comment.

In https://reviews.llvm.org/D42790#994774, @arichardson wrote:

> I originally discovered this issue because in our CHERI fork of LLD we set `Config->IsRela = false` when linking  MIPS64 code. We do this because the FreeBSD MIPS rtld only understands Elf_Rel relocations and does not process Elf_Rela.


It sounds like FreeBSD MIPS rtld bug honestly and probably should be fixed on their side.

I guess it currently works with GNU linkers because they always write the addend to output, even when output is .rela. 
We faced something like that before when worked on x64 target. And it was fixed on FreeBSD side.

I do not think we want to add command line option like that in LLD. One possible option in theory would be to have
the same behavior as gnu linkers do, but it is also unclear it is needed, because seem helps to hide an issue instead of fixing it.

Lets wait to hear what other people think.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42790





More information about the llvm-commits mailing list