llvm-project
ba2de8f2 - [ELF] Allow absolute relocation referencing symbol index 0 in PIC mode

Commit
221 days ago
[ELF] Allow absolute relocation referencing symbol index 0 in PIC mode The value of an absolute relocation, like R_RISCV_HI20 or R_PPC64_LO16, with a symbol index of 0, the resulting value should be treated as absolute and permitted in both -pie and -shared links. This change also resolves an absolute relocation referencing an undefined symbol in statically-linked executables. PPC64 has unfortunate exceptions: * R_PPC64_TOCBASE uses symbol index 0 but it should be treated as referencing the linker-defined .TOC. * R_PPC64_PCREL_OPT (https://reviews.llvm.org/D84360) could no longer rely on `isAbsoluteValue` return false.
Author
Parents
Loading