How to detect at runtime whether symbols are stripped?
问题 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 definition which returns true if stripped, otherwise false. Would using dlsym() on "main()" work to detect this reliably? 回答1: I know the file command can tell the difference, so you could possibly look at its source to see what mechanism it uses. 回答2: From a comment left for another answer: A stripped ELF will lack a .symtab