Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
objtool: Use R_*_NONE relocations for annotations
.discard.retpoline_safe sections do not have the SHF_ALLOC flag. These sections referencing text sections with PC-relative relocations like R_386_PC32 [0] are conceptually not suitable. Newer LLD will report warnings even for relocatable links [1]. ld.lld: warning: vmlinux.a(drivers/i2c/busses/i2c-i801.o):(.discard.retpoline_safe+0x120): has non-ABS relocation R_386_PC32 against symbol '' Since the annotation is RELA only (therefore i386 is unsupported), we can utilitize R_*_NONE relocations for annotation, making .discard.retpoline_safe sections zero-sized. If we ever support i386 REL relocations, which requires teaching reloc_addend implicit addends, we can utilitize .long directives just for REL. [0]: commit 1c0c1fa ("objtool: Use relative pointers for annotations") Link: ClangBuiltLinux#1937 [1] Signed-off-by: Fangrui Song <maskray@google.com>
- Loading branch information