如何解释 .so ELF 格式文件的动态符号名称中的 @abc(01)?

How to interpret @abc(01) in dynamic symbol name of an .so ELF formatted file?

我有两个非常相似的 .so 文件。在它们上使用 readelf --syms --wide 我收到...

...第一个:

631: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __cxa_guard_acquire@CXXABI_1.3 (18)
666: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __cxa_pure_virtual@CXXABI_1.3 (18)

...第二个:

671: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __cxa_guard_acquire@CXXABI_1.3 (21)    
706: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND __cxa_pure_virtual@CXXABI_1.3 (21)

(18)和(21)分别是什么意思?

What does the (18) and (21) mean, respectively?

是相应版本定义中.vd_version的值(elf.h中的ElfXX_Verdef)。例如:

readelf -Ws /bin/date | egrep ' (setenv|clock_gettime)'
    14: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND clock_gettime@GLIBC_2.17 (5)
    15: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND setenv@GLIBC_2.2.5 (3)

readelf -V /bin/date
...
Version needs section '.gnu.version_r' contains 1 entry:
 Addr: 0x0000000000000fd8  Offset: 0x000fd8  Link: 6 (.dynstr)
  000000: Version: 1  File: libc.so.6  Cnt: 6
  0x0010:   Name: GLIBC_2.14  Flags: none  Version: 7
  0x0020:   Name: GLIBC_2.4  Flags: none  Version: 6
  0x0030:   Name: GLIBC_2.17  Flags: none  Version: 5
  0x0040:   Name: GLIBC_2.3.4  Flags: none  Version: 4
  0x0050:   Name: GLIBC_2.2.5  Flags: none  Version: 3
  0x0060:   Name: GLIBC_2.3  Flags: none  Version: 2

请注意 GLIBC_2.2.5Version: 3GLIBC_2.17Version: 5