android - .so(共享库)文件中的符号名称是如何生成的?

标签 android linux shared-libraries

在共享库文件中生成的符号名称是如何出现的?例如,使用elfread -Ws读取libutils.so文件(android系统utils库)中的符号时,得到几个格式的符号名:

_ZN7android10VectorImpl14insertVectorAtERKS0_j 

等你如何解读这个符号名称?

最佳答案

这似乎是一个错位的名称,例如,对于 C++,您可以使用 nm-C 选项更好地理解这些名称。 :

-C
--demangle[=style]
Decode (demangle) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different mangling styles. The optional demangling style argument can be used to choose an appropriate demangling style for your compiler. See c++filt, for more information on demangling.

在共享库上使用 nm 时,此选项显示它们的符号:

-D
--dynamic
Display the dynamic symbols rather than the normal symbols. This is only meaningful for dynamic objects, such as certain types of shared libraries.

关于android - .so(共享库)文件中的符号名称是如何生成的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35329314/

相关文章:

c++ - 保持大型 C++ 项目模块化的建议?

android - 如何为字符串资源中的文本设置额外的粗体?

android - 从 Android 中的包中抑制 toast

linux - 无法使用ssh在sh文件上调用带有变量的命令

flash - 移动和 Web 应用程序的共享代码库?

c++ - Windows 上的 DLL Main 对比。 __attribute__((constructor)) Linux 上的入口点

java - 在 Android Studio 中关闭应用程序时推送通知无法正常工作

java - 在微调器中划分值 - Android

c - 了解文件截断

c# - 连接windows客户端和linux服务器