[llvm-bugs] [Bug 50010] New: llvm-objdump doesn't list symbols in ppc64 objects, but does so in ppc64le ones
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat Apr 17 03:27:57 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=50010
Bug ID: 50010
Summary: llvm-objdump doesn't list symbols in ppc64 objects,
but does so in ppc64le ones
Product: tools
Version: trunk
Hardware: Other
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: llvm-objdump
Assignee: unassignedbugs at nondot.org
Reporter: nabijaczleweli at nabijaczleweli.xyz
CC: llvm-bugs at lists.llvm.org
Consider the following C code:
int symbol_a(void) {
return 'a';
}
int symbol_b(void) {
return 'b';
}
When built for ppc64el, everything appears in order:
$ cc -target ppc64le-unknown-linux-gnu a.c -c -oa.o
$ llvm-objdump -d a.o
a.o: file format elf64-powerpcle
Disassembly of section .text:
0000000000000000 <symbol_a>:
0: 61 00 60 38 li 3, 97
4: 20 00 80 4e blr
...
14: 00 00 00 60 nop
18: 00 00 00 60 nop
1c: 00 00 00 60 nop
0000000000000020 <symbol_b>:
20: 62 00 60 38 li 3, 98
24: 20 00 80 4e blr
...
But when building for ppc64, the symbol listing is gone:
$ cc -target ppc64-unknown-linux-gnu a.c -c -oa.o
$ llvm-objdump -d a.o
a.o: file format elf64-powerpc
Disassembly of section .text:
0000000000000000 <.text>:
0: 38 60 00 61 li 3, 97
4: 4e 80 00 20 blr
...
14: 38 60 00 62 li 3, 98
18: 4e 80 00 20 blr
...
Both object files have a symtab:
$ llvm-objdump -h a.o
a.o: file format elf64-powerpcle
Sections:
Idx Name Size VMA Type
0 00000000 0000000000000000
1 .strtab 00000063 0000000000000000
2 .text 00000034 0000000000000000 TEXT
3 .comment 00000056 0000000000000000
4 .note.GNU-stack 00000000 0000000000000000
5 .eh_frame 00000040 0000000000000000 DATA
6 .rela.eh_frame 00000030 0000000000000000
7 .llvm_addrsig 00000000 0000000000000000
8 .symtab 00000078 0000000000000000
$ llvm-objdump -h a.o
a.o: file format elf64-powerpc
Sections:
Idx Name Size VMA Type
0 00000000 0000000000000000
1 .strtab 00000073 0000000000000000
2 .text 00000028 0000000000000000 TEXT
3 .opd 00000030 0000000000000000 DATA
4 .rela.opd 00000060 0000000000000000
5 .comment 00000056 0000000000000000
6 .note.GNU-stack 00000000 0000000000000000
7 .eh_frame 00000040 0000000000000000 DATA
8 .rela.eh_frame 00000030 0000000000000000
9 .llvm_addrsig 00000000 0000000000000000
10 .symtab 00000090 0000000000000000
And on rudimentary inspexion, both objects' symtabs appear to contain the
names.
My toolchain is as follows
Debian clang version
13.0.0-++20210415102640+07edd7899392-1~exp1~20210415203405.1444
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /bin
obtained from the current buster nightly packages.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210417/efc86a51/attachment.html>
More information about the llvm-bugs
mailing list