This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
confused about symbol version table
- From: Pan ruochen <panruochen at gmail dot com>
- To: binutils at sourceware dot org
- Date: Fri, 23 Jul 2010 13:21:41 +0800
- Subject: confused about symbol version table
Hi All,
I am studying ELF symbol versioning recently. I get a document from:
http://refspecs.freestandards.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/symversion.html
It says:
======================================================
11.7.2. Symbol Version Table
The special section .gnu.version which has a section type of
SHT_GNU_versym shall contain the Symbol Version Table. This section
shall have the same number of entries as the Dynamic Symbol Table in
the .dynsym section.
The .gnu.version section shall contain an array of elements of type
Elfxx_Half. Each entry specifies the version defined for or required
by the corresponding symbol in the Dynamic Symbol Table.
======================================================
But these descriptions don't seem to match a real ELF.
$objdump -h /lib/libc-2.8.so
======================================================
libc-2.8.so: file format elf32-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .note.gnu.build-id 00000024 00711174 00711174 00000174 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .note.ABI-tag 00000020 00711198 00711198 00000198 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .dynsym 00008e60 00714d08 00714d08 00003d08 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .dynstr 0000588b 0071db68 0071db68 0000cb68 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .gnu.version 000011cc 007233f4 007233f4 000123f4 2**1
CONTENTS, ALLOC, LOAD, READONLY, DATA
... ...
======================================================
The size of the .dynsym section is 0x8e60 and the size of an Elf32_Dyn
structure is 8. Thus the dynamic symbol table contains 0x8e60/8=4556 entries.
The size of the .gnu.version section is 0x11cc and the size of an Elf32_Half
structure is 2. Thus the symbol version table contains 0x11cc/2=2278 entries.
This really voilates the manual. What's wrong?
--
PRC