0

I have two very similar .so files. Using readelf --syms --wide on them I receive...

... for the first:

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)

... for the second:

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)

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

gebbissimo
  • 2,137
  • 2
  • 25
  • 35

1 Answers1

1

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

It's the value of .vd_version from corresponding version definition (ElfXX_Verdef in elf.h). For example:

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

Note that GLIBC_2.2.5 has Version: 3 and GLIBC_2.17 has Version: 5.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • Can you explain a bit more, please? In my case, the two files both output "GLIBC_2.2.5" among other things, but once with Version 16 and once with Version 18. In a similar manner they both show "CXXABI_1.3" once with Version 18 and once with Version 21. So this Version does not really specify the version of the library, does it? What does it represent then? – gebbissimo Jan 21 '19 at 10:09
  • @gebbissimo Please edit your question (or ask a new one) with *actual* output you are confused about. "What does it represent then?"-- it represents the value of `.vd_version` field. Your question appears to be: "how is that value set", which is an entirely different question. – Employed Russian Jan 21 '19 at 16:27