-->
Page 1 of 1

How to remove sections of .debug_frame, .debug_info , etc

PostPosted: Fri Oct 23, 2020 10:24 pm
by esp8266_abc
Hi Buddies,

If we open an dump file generated by the compilation, we could see a lot of .debug_* sections which takes up a lot of memories.

Do these sections really use ram memory especially of those verylimited dram0_0_seg and iram1_0_seg etc? If yes, How to remove them?

Thanks!

Re: How to remove sections of .debug_frame, .debug_info , et

PostPosted: Sat Oct 24, 2020 3:47 am
by eriksl
No, these sections are not copied into the final image.

Re: How to remove sections of .debug_frame, .debug_info , et

PostPosted: Sat Oct 31, 2020 12:11 am
by John78
It seems .eh_frame based solution (which BTW has turned out to be really really non-trivial) won't fit the issue at hand. In .eh_frame regime, there's .rela.eh_frame section with new pc relative relos (for pointer to CIE). This needs to be handled/fixed up by loader - which is fine. However thing is if you run strip on module, the relo section is gone.

Try this on x86
$ gcc bt.c -c -fasynchronous-unwind-tables # this generates .rela.eh_frame among others
$ strip bt.o # .rela.eh_frame is gone

Took a look at strip man page and it seems there's a suggested work flow. does that help
--------->8------------
Link the executable as normal.
Copy "foo" to "foo.full"
Run "strip --strip-debug foo"
Run "objcopy --add-gnu-debuglink=foo.full foo"
--------->8------------

Re: How to remove sections of .debug_frame, .debug_info , et

PostPosted: Sun Nov 08, 2020 11:50 am
by eriksl
What are you trying to solve here?

I already said all these sections never end up in the image!