in my library (ELF arm64, Android) I see the same mangled symbol name twice (names changed):
>> nm --format sysv libAPP.so.dbg | grep _ZL15s_symbolNameXYs
_ZL15s_symbolNameXYs|0000000003a9c758| d | OBJECT|0000000000000578| |.data.rel.ro
_ZL15s_symbolNameXYs|0000000016604940| b | OBJECT|00000000000005c0| |.bss
I thought names must be unique? what is the reason for that?
I dont have the C/C code for the library, if you know what code generates this I would be very happy.
Thanks
Update: also this happens, which makes even less sense to me:
>> nm --format sysv --defined-only libAPP.so.dbg | grep _ZL12aisomes_list
_ZL12aisomes_list |0000000000834780| r | OBJECT|0000000000000030| |.rodata
_ZL12aisomes_list |0000000000834980| r | OBJECT|0000000000000030| |.rodata
CodePudding user response:
Lower case letters in the symbol type (in your example, d
, b
, and r
) indicate local symbols. These are not subject to linkage and may hence appear multiple times in the same binary. There is nothing wrong with that.
The main source of such symbols are local symbols in object files. The linker just transfers the local symbols of all object files involved into the symbol table of the binary without linking them together. So most likely, multiple object files defined a local symbol named _ZL15s_symbolNameXYs
.