[英]How do I strip the symbol table in so?
I used the strip
command under MAC to remove the symbol table.我用MAC下的strip
命令去掉了符号表。 And then I'm going to check it with the strings
and grep
command.然后我将使用strings
和grep
命令检查它。 Then I found that even class private function names can be grep
.然后我发现即使是类私有函数名也可以是grep
。
class ModuleBarn
{
public:
/***/
private:
void m_Link( FunctionSet* fs, const char* functionName );
Field* m_FindField( Function* fun, uint32_t argIdx );
Function* m_FindCall( const char* functionName, const char* moduleName );
}
alldeMac-mini:~ all$ strip libBootloader.so
alldeMac-mini:~ all$ strings libBootloader.so | grep m_Link
_ZN10ModuleBarn6m_LinkEPNS_11FunctionSetEPKc
How do I strip the public and private function names in a class?如何去除类中的公共和私有函数名称?
Because there's .so
in your output I assume you're doing all that on Linux?因为在你的输出中有.so
我假设你在 Linux 上做所有这些? If yes, you need to do 2 things.如果是,您需要做两件事。
Modify your build scripts/make files/cmake lists/whatever build environment you use adding following compiler switches: -fvisibility=hidden -fvisibility-inlines-hidden
Very likely you'll lose exported symbols, mark them individually in the source code with __attribute__((visibility("default")))
.修改您的构建脚本/制作文件/cmake 列表/您使用的任何构建环境,添加以下编译器开关: -fvisibility=hidden -fvisibility-inlines-hidden
您很可能会丢失导出的符号,请在源代码中使用__attribute__((visibility("default")))
。
Use the strip
binary that shipped with the OS.使用操作系统附带的strip
二进制文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.