0
votes

I'm trying to diagnose why a seemingly small C function I wrote has produced a large .text section. I have used arm-elf-size and arm-elf-objdump to isolate the object file and function, but I have only been able to get these tools to produce assembly code, which I don't have the time to reverse engineer.

I tried using gcc switches "-g" which is supposed to be compatible with arm-elf-objdump -g, but it keeps producing the error "No debugging information found," which I've googled around for a bit with no clear cut answer (though other people had an identical problem).

Is there any other means of producing mixed C/assembly files so I can isolate the trouble spot in the function? Thanks!

1
It's "objdump -S". The rest is in objdump man/info pages.oakad
I did try "objdump -S", and all it did was list all of the C code at the top and all of the assembly code at the bottom. I'd like for it to be intertwined so I can isolate specific lines of C code as expanding too large. The man pages did not any any additional information on making it intertwined.jerp
That's because you've got optimization enabled. Try to compile your program with -O0..oakad
don't quite understand. what do you mean by surprising about a large .text section while have no time to reverse engineer? i think reverse engineer is the best way you know what's the code there though.Jason Hu
Possible duplicate: stackoverflow.com/questions/1289881/… I'd recommend you to try gcc -fverbose-asm. Cf. panthema.net/2013/0124-GCC-Output-Assembler-Codenodakai

1 Answers

0
votes

Is there any other means of producing mixed C/assembly files so I can isolate the trouble spot in the function?

gcc/gas can generate an assembler listing with C source; I recommend these compiler options:

-g -Wa,-adhln=filename.lst