在共享库文件中生成的符号名称是如何出现的?例如,使用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/