[PATCH] D43383: [llvm-mc] - Produce R_X86_64_PLT32 for "call/jmp foo".
H.J Lu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 17 06:43:38 PST 2018
hjl.tools added a comment.
Does this change add reference to _GLOBAL_OFFSET_TABLE_?
[hjl at gnu-tools-1 tmp]$ cat x.s
call foo
[hjl at gnu-tools-1 tmp]$ cat y.s
call foo at PLT
[hjl at gnu-tools-1 tmp]$ gcc -c x.s y.s
[hjl at gnu-tools-1 tmp]$ readelf -rs x.o y.o
File: x.o
Relocation section '.rela.text' at offset 0xc8 contains 1 entry:
Offset Info Type Sym. Value Sym. Name + Addend
000000000001 000400000004 R_X86_64_PLT32 0000000000000000 foo - 4
Symbol table '.symtab' contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1
2: 0000000000000000 0 SECTION LOCAL DEFAULT 3
3: 0000000000000000 0 SECTION LOCAL DEFAULT 4
4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND foo
File: y.o
Relocation section '.rela.text' at offset 0xf8 contains 1 entry:
Offset Info Type Sym. Value Sym. Name + Addend
000000000001 000500000004 R_X86_64_PLT32 0000000000000000 foo - 4
Symbol table '.symtab' contains 6 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1
2: 0000000000000000 0 SECTION LOCAL DEFAULT 3
3: 0000000000000000 0 SECTION LOCAL DEFAULT 4
4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_
5: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND foo
[hjl at gnu-tools-1 tmp]$
There should be no reference to _GLOBAL_OFFSET_TABLE_ for "call foo".
https://reviews.llvm.org/D43383
More information about the llvm-commits
mailing list