In my C++ program, how can I detect programmatically at runtime whether symbols have been stripped via the \'strip\' gnu development tool on Linux?
I\'d like a function
readelf --sections binary_path | grep debug_info
It is not trivial to say in general whether a binary was stripped or not, because there are different ways to strip a file. Essentially stripping removes some sections related to symbols and debugging. However, if you replace "debug_info" with "debug", you can see that there are still some debug-related sections left in standard binaries of Ubuntu distribution.