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

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 06:28:27 PST 2018


arichardson added a comment.

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.

The issue here is not speicific to MIPS. It only depends on an input file containing Elf_Rela for a target that has Elf_Rel as the default output format.

I added the command line flag since this makes it possible to test this issue without fabricating .o files. Additionally, it will make it possible to use LLD for operating systems where rtld doesn't use Rela and the `IsRela = Config->Is64 || IsX32 || Config->MipsN32Abi || Machine == EM_PPC`. check is not correct.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42790





More information about the llvm-commits mailing list