New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
llvm-objdump -d --line-numbers omits function name #40686
Comments
No strong preference. Almost assuredly not intentional. It seems a little redundant? |
Yeah, seems redundant to me too. Before trying to add this, it would be nice to see if there's an example where it isn't redundant (two methods in the same symbol? function name that doesn't match the symbol name? are any of those possible?) I can get the strings to be different when mangling is added, although I think that's just a mistake that only one is demangled, e.g. |
The function name printed is actually coming from debug info, not the symbol name. If the symbol is lost but debug info still knows about it, this may be useful. For example: |
Or, with a more common workflow (not sniping out specific symbols): $ cat foo.c |
Extended Description
llvm-objdump does not include the function name when disassembling with -l (--line-numbers). I'm not sure whether or not this is desired/intentional.
$ cat foo.c
int foo() {
return 5;
}
$ clang -g -c foo.c -o foo.o
$ objdump -l -d foo.o
foo.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 :
foo(): <--------- this line is missing below
/tmp/foo.c:1
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
/tmp/foo.c:2
4: b8 05 00 00 00 mov $0x5,%eax
9: 5d pop %rbp
a: c3 retq
$ llvm-objdump -l -d foo.o
foo.o: file format ELF64-x86-64
Disassembly of section .text:
0000000000000000 foo:
; /tmp/foo.c:1
0: 55 pushq %rbp
1: 48 89 e5 movq %rsp, %rbp
; /tmp/foo.c:2
4: b8 05 00 00 00 movl $5, %eax
9: 5d popq %rbp
a: c3 retq
The text was updated successfully, but these errors were encountered: