Chat freely about anything...

User avatar
By esp8266_abc
#89185 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!
User avatar
By John78
#89267 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------------