https://bugs.llvm.org/show_bug.cgi?id=37383

            Bug ID: 37383
           Summary: llvm-objdump prints garbage for absolute symbol values
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llvm-objdump
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

For the simple reproducer below, compare the output of llvm-objdump to the
output of binutils objdump. Both report the same raw bytes for the callq
instruction, but the objdump version has both the correct symbol value and a
nice symbol name. 
Steps to reproduce:

$ pwd
~/llvm-svn/build 

$ cat t.s
.text
callq foo

$ ./bin/llvm-mc t.s -o t.o -filetype=obj -triple=x86_64-unknown-linux
$ ./bin/ld.lld  t.o --defsym foo=0x100
$ ./bin/llvm-objdump -disassemble a.out
...
  201000:       e8 fb f0 df ff  callq   -2100997

$ objdump -d a.out
...
  201000:       e8 fb f0 df ff          callq  100 <foo>


Actually, the llvm-objdump version is probably reporting the right value for
one of the many displacement encodings possible for this instruction, but it is
very hard to tell if it is a correct value without digging into binutils
objdump or the isa manual.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to