https://sourceware.org/bugzilla/show_bug.cgi?id=20272
Bug ID: 20272
Summary: gold ignores symbol table in llvm IR archive
Product: binutils
Version: 2.27 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: gold
Assignee: ccoutant at gmail dot com
Reporter: hjl.tools at gmail dot com
CC: ian at airs dot com
Target Milestone: ---
[hjl@gnu-6 bin]$ cat foo.c
int global_var = 20;
[hjl@gnu-6 bin]$ cat main.c
int global_var;
int main(void)
{
return global_var;
}
int _start()
{
return main();
}
[hjl@gnu-6 bin]$ ./clang -emit-llvm -Os foo.c -c -o foo.o
[hjl@gnu-6 bin]$ ./clang -emit-llvm -Os main.c -c -o main.o
[hjl@gnu-6 bin]$ ar rs --plugin ../lib/LLVMgold.so foo.a foo.o
[hjl@gnu-6 bin]$ ld.gold --plugin ../lib/LLVMgold.so main.o foo.a
[hjl@gnu-6 bin]$ objdump -dw a.out
a.out: file format elf64-x86-64
Disassembly of section .text:
00000000004000b0 <_start>:
4000b0: 31 c0 xor %eax,%eax
^^^^^^^^^^^^^^^^global_var should 20.
4000b2: c3 retq
[hjl@gnu-6 bin]$ ld.bfd --plugin ../lib/LLVMgold.so main.o foo.a
[hjl@gnu-6 bin]$ objdump -dw a.out
a.out: file format elf64-x86-64
Disassembly of section .text:
00000000004000b0 <_start>:
4000b0: b8 14 00 00 00 mov $0x14,%eax
4000b5: c3 retq
[hjl@gnu-6 bin]$
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils