bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/20272] New: gold ignores symbol table in llvm IR archive


From: hjl.tools at gmail dot com
Subject: [Bug gold/20272] New: gold ignores symbol table in llvm IR archive
Date: Fri, 17 Jun 2016 18:49:11 +0000

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: ---

address@hidden bin]$ cat foo.c
int global_var = 20;
address@hidden bin]$ cat main.c
int global_var;
int main(void)
{
  return global_var;
}

int _start()
{
  return main();
}
address@hidden bin]$  ./clang -emit-llvm -Os foo.c -c -o foo.o  
address@hidden bin]$  ./clang -emit-llvm -Os main.c -c -o main.o  
address@hidden bin]$ ar rs --plugin  ../lib/LLVMgold.so foo.a foo.o
address@hidden bin]$ ld.gold --plugin ../lib/LLVMgold.so main.o foo.a 
address@hidden 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   
address@hidden bin]$ ld.bfd --plugin ../lib/LLVMgold.so main.o foo.a 
address@hidden 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   
address@hidden bin]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]