cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
charysm
Visitor
Visitor
278 Views
Registered: ‎10-22-2020

Generate more readable disassembly for ARM / 7000 series

Hello,

I am looking for a way to improve the readability of objdump disassembly. I am using SDK 2018.2

When looking at the output of arm-none-eabi-objdump -d myappl.elf, I am surprised that only function addresses are resolved to symbols, but no data. If I want to see for example what the compiler did with a global variable, I have to include -t to objdump, find the name, for instance

00200814 l .bss 00000001 globalVar

and then look for a sequence like 

120378: e3003814 movw r3, #2068 ; 0x814
12037c: e3403020 movt r3, #32
120380: e3a02001 mov r2, #1

If this is now a larger structure, in code accessing a few different pieces of data, this becomes really tedious. Even attributing accesses to a single data in a larger function is something you quickly give up on. I am also a bit surprised that number literals seem to default to signed decimal integer - not very useful in most cases.

Are there any options, or other tools, that could help me generate better disassembly? Code is compiled with -g3

Thanks! 

0 Kudos
Reply
2 Replies
ibaie
Xilinx Employee
Xilinx Employee
209 Views
Registered: ‎10-06-2016

Hi @charysm 

Is the code compiled with -O0 as well? Anyway could you maybe provide a sample code that can be used to reproduce the issue easily? To be honest I don't think there is much more that can be done apart from using -g3 and -O0 but maybe with some testing somebody can figure out bit more verbosity in the GCC dump.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
Reply
charysm
Visitor
Visitor
198 Views
Registered: ‎10-22-2020

Hi @ibaie ,

The code is compiled with -g3. I am really only after the way objdump shows disassembly, for whatever code the compiler generates. In fact, in this particular situation I wanted to compare store and load between different optimization levels.

In my above example, objdump puts the hexadecimal representation of the argument in the comment, where I also would have expected a symbol name. This would be normally the case with other architectures I have worked with. The symbol name is there, as the symbol table shows. 

I did not find a solution for referencing data symbols that way. But I have downloaded the latest GCC and binutils from ARM, and discovered the  --visualize-jumps option in that objdump version, which also can be quite useful:

 

charysm_0-1607511083474.png

 

0 Kudos
Reply