- Sat Oct 31, 2020 12:11 am
#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------------