如何在运行时检测符号是否被剥离? [英] How to detect at runtime whether symbols are stripped?

查看:212
本文介绍了如何在运行时检测符号是否被剥离?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的C ++程序中,我如何在运行时以编程方式检测符号是否通过Linux上的stripgnu开发工具剥离?

In my C++ program, how can I detect programmatically at runtime whether symbols have been stripped via the 'strip' gnu development tool on Linux?

在main()上使用dlsym()可以可靠地检测这种情况吗?

Would using dlsym() on "main()" work to detect this reliably?

推荐答案

我知道文件命令可以区分不同,所以你可以看看它的源以查看其使用的机制。

I know the file command can tell the difference, so you could possibly look at its source to see what mechanism it uses.

这篇关于如何在运行时检测符号是否被剥离?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆