How to detect at runtime whether symbols are stripped?

前端 未结 5 1015
忘掉有多难
忘掉有多难 2021-02-15 01:36

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

5条回答
  •  再見小時候
    2021-02-15 02:08

    You could use popen() to execute nm on the target application and then parse the output to figure if it's stripped or not.

    nm: /bin/ls: no symbols
    

提交回复
热议问题