Issue
I'm trying to build a binary with .symtab and .strtab section to trace functions. I'm using "make && make install", the binary is ok. But when I use "make rpm" and install rpm package, both of .symtab and .strtab section are gone which is weired. I track the rpm build log, and saw those:
libtool: install: /usr/bin/install -c mybinary /root/rpmbuild/BUILDROOT/mybinary.el7.centos.x86_64/usr/sbin/mybinary
and here, I executed it manually again, the .symtab section exists.
extracting debug info from /root/rpmbuild/BUILDROOT/mybinary.el7.centos.x86_64/usr/sbin/mybinary
After this step, the .symtab section is gone, I guess there's something wrong here. But I don't know why. Please help.
Solution
rpmbuild automatically strip debuging info and place it in -debug subpackage. If you want to preserve it for some reason follow https://imvoid.wordpress.com/2013/06/05/stripping-and-stopping-stripping-of-binaries-in-rpm-build/
Answered By - msuchy Answer Checked By - David Marino (WPSolving Volunteer)