This project elfdbg is a utility program to quickly identify if an ELF binary is built with debug sections
Debug sections in ELF binary usually are generated using the -g
flag with the
compiler. The compiler adds the new .debug_*
sections in the binary.
The program is looking for the existence of sections with name starting with
.debug_
to determine if the binary has been built with debug information.
The ELF format is a well-known standard. ELF TIS reference specification is available here and as a FreeBSD elf(5) man page.
This is intented to be used in shell script in order to avoid using file(1) and parsing the output like below:
`file /path/to/binary | awk '/debug_info/{print $2}'` != 'ELF'
To determine if binary has been built with debug, use the following:
if elfdbg -q /path/to/binary; then
echo "No symbols"
else
echo "Binary with debug symbols"
fi
On FreeBSD, you can easily identify the binary packages with missing debug using similar one-liner:
pkg info -a -l|grep local/bin/|while read a; do echo $a: `elfdbg $a`; done
The Makefile use the standard BSD Makefile to build the program.
make && sudo make install
If your on Linux, use make
also build using the GNU Makefile.
The tests cases are implemented using the FreeBSD test suite framework with kyua and Kyuafile.
make test