0

When creating the disassembly output of an obj or an exe file, objdump creates function names in angle brackets, like;

0000000000000598 <SomeFunctionName>:
 598:   push   rbp
 599:   push   rbx
 59a:   sub    rsp,0x38
 59e:   lea    rbp,[rsp+0x80]
...
...
...
0000000000000878 <main>:
...
 8a3:   lea    rax,[rbp-0x10]
 8a7:   mov    r8,rax
 8aa:   mov    edx,0x3
 8af:   mov    ecx,0x3
 8b4:   call   598 <SomeFunctionName>   ; <- here
 8b9:   test   eax,eax
 8bb:   jne    8d5 <main+0x5d>          ; <- here as well
...

I'm aware that those string literals show branching in the program flow (line numbers to jump to). But, as the line number is already shown (as 598 in SomeFunctionName), is there a directive for objdump to suppress those string literals in the angle brackets (of course, the absolute address 598 would still remain)?

ssd
  • 2,340
  • 5
  • 19
  • 37
  • 5
    If you want to remove that from the *output*, you can use any text processing tool (python, awk, sed, etc.). But why would you want to do that? – Serge Ballesta Oct 31 '20 at 10:26
  • 2
    You can [`strip`](https://linux.die.net/man/1/strip) executables, libraries, ... – pmg Oct 31 '20 at 10:32
  • 2
    Alo see https://stackoverflow.com/questions/1349166/what-is-the-difference-between-gcc-s-and-a-strip-command – pmg Oct 31 '20 at 10:33
  • The phrase you're looking for is "symbol name". (Also, terminology nitpick: I'm not sure "string literal" fits perfectly. This isn't source code; it doesn't turn into string data when compiled.) – Peter Cordes Oct 31 '20 at 10:42
  • @PeterCordes : You're right, that phrase got to be "symbol name." – ssd Oct 31 '20 at 10:50
  • 2
    @pmg : The `-s` directive with `gcc` worked. I used it in *compile* phase and it didn't work but when I pulled the `-s` directive into *linking* phase, it did the trick! Thanks. – ssd Oct 31 '20 at 10:56

0 Answers0