forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ELF] Don't create copy relocation/canonical PLT entry for a defined …
…symbol (llvm#75095) Copy relocations and canonical PLT entries are for symbols defined in a DSO. Currently we create them even for a `Defined`, possibly leading to an output that won't work at run-time (e.g. R_X86_64_JUMP_SLOT referencing a null symbol). ``` % cat a.s .globl _start, main .type main, @function _start: main: ret .rodata .quad main % clang -fuse-ld=lld -pie -nostdlib a.s % readelf -Wr a.out Relocation section '.rela.plt' at offset 0x290 contains 1 entry: Offset Info Type Symbol's Value Symbol's Name + Addend 00000000000033b8 0000000000000007 R_X86_64_JUMP_SLOT 12b0 ``` Report an error instead for the default `-z text` mode. GNU ld reports an error in `-z text` mode as well.
- Loading branch information
Showing
4 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters