This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: confused about symbol version table


2010/7/23 Ian Lance Taylor <iant@google.com>:
>
> They do mean that.
>
> However, the relevant data here is not the PT_DYNAMIC segment, it is the
> DT_SYMTAB section referenced from the PT_DYNAMIC segment. ?In section
> terms, it is the .dynsym section, not the .dynamic section.
>
> Ian
>

So how to understand the .dynamic and .gnu.version sections don't
contain the same number of entries?
More detailed information about the ELF is as following:
$readelf -p libc-2.8.so

Elf file type is DYN (Shared object file)
Entry point 0x727740
There are 10 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  PHDR           0x000034 0x00711034 0x00711034 0x00140 0x00140 R E 0x4
  INTERP         0x13bf70 0x0084cf70 0x0084cf70 0x00013 0x00013 R   0x1
      [Requesting program interpreter: /lib/ld-linux.so.2]
  LOAD           0x000000 0x00711000 0x00711000 0x162d9c 0x162d9c R E 0x1000
  LOAD           0x1631cc 0x008741cc 0x008741cc 0x027b0 0x05484 RW  0x1000
  DYNAMIC        0x164d7c 0x00875d7c 0x00875d7c 0x000f8 0x000f8 RW  0x4
  NOTE           0x000174 0x00711174 0x00711174 0x00044 0x00044 R   0x4
  TLS            0x1631cc 0x008741cc 0x008741cc 0x00008 0x00040 R   0x4
  GNU_EH_FRAME   0x13bf84 0x0084cf84 0x0084cf84 0x06984 0x06984 R   0x4
  STACK          0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4
  LOOS+474e552   0x1631cc 0x008741cc 0x008741cc 0x01e34 0x01e34 R   0x1

 Section to Segment mapping:
  Segment Sections...
   00
   01     .interp
   02     .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr
.gnu.version .gnu.version_d .gnu.version_r .rel.dyn .rel.plt .plt
.text __libc_freeres_fn __libc_thread_freeres_fn .rodata .interp
.eh_frame_hdr .eh_frame .gcc_except_table .hash
   03     .tdata .tbss .fini_array .ctors .dtors __libc_subfreeres
__libc_atexit __libc_thread_subfreeres .data.rel.ro .dynamic .got
.got.plt .data .bss
   04     .dynamic
   05     .note.gnu.build-id .note.ABI-tag
   06     .tdata .tbss .fini_array .ctors .dtors
   07     .eh_frame_hdr
   08
   09     .tdata .tbss .fini_array .ctors .dtors __libc_subfreeres
__libc_atexit __libc_thread_subfreeres .data.rel.ro .dynamic .got
$objdump -h 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
  5 .gnu.version_d 00000324  007245c0  007245c0  000135c0  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .gnu.version_r 00000040  007248e4  007248e4  000138e4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .rel.dyn      000029e0  00724924  00724924  00013924  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .rel.plt      00000030  00727304  00727304  00016304  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .plt          00000070  00727334  00727334  00016334  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 10 .text         0010c8d8  007273b0  007273b0  000163b0  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 11 __libc_freeres_fn 000011a7  00833c90  00833c90  00122c90  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 12 __libc_thread_freeres_fn 00000285  00834e40  00834e40  00123e40  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 13 .rodata       00017e90  008350e0  008350e0  001240e0  2**5
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 14 .interp       00000013  0084cf70  0084cf70  0013bf70  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 15 .eh_frame_hdr 00006984  0084cf84  0084cf84  0013bf84  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 16 .eh_frame     0001cc48  00853908  00853908  00142908  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 17 .gcc_except_table 000004af  00870550  00870550  0015f550  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 18 .hash         0000339c  00870a00  00870a00  0015fa00  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 19 .tdata        00000008  008741cc  008741cc  001631cc  2**2
                  CONTENTS, ALLOC, LOAD, DATA, THREAD_LOCAL
 20 .tbss         00000038  008741d4  008741d4  001631d4  2**2
                  ALLOC, THREAD_LOCAL
 21 .fini_array   00000004  008741d4  008741d4  001631d4  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 22 .ctors        0000000c  008741d8  008741d8  001631d8  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 23 .dtors        00000008  008741e4  008741e4  001631e4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 24 __libc_subfreeres 0000006c  008741ec  008741ec  001631ec  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 25 __libc_atexit 00000004  00874258  00874258  00163258  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 26 __libc_thread_subfreeres 0000000c  0087425c  0087425c  0016325c  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 27 .data.rel.ro  00001afc  00874280  00874280  00163280  2**5
                  CONTENTS, ALLOC, LOAD, DATA
 28 .dynamic      000000f8  00875d7c  00875d7c  00164d7c  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 29 .got          00000170  00875e74  00875e74  00164e74  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 30 .got.plt      00000024  00875ff4  00875ff4  00164ff4  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 31 .data         0000095c  00876020  00876020  00165020  2**5
                  CONTENTS, ALLOC, LOAD, DATA
 32 .bss          00002cd0  00876980  00876980  0016597c  2**5
                  ALLOC
 33 .comment      0000d0d4  00000000  00000000  0016597c  2**0
                  CONTENTS, READONLY
 34 .gnu.warning.sigstack 0000004d  00000000  00000000  00172a60  2**5
                  CONTENTS, READONLY
 35 .gnu.warning.sigreturn 0000003b  00000000  00000000  00172ac0  2**5
                  CONTENTS, READONLY
 36 .gnu.warning.siggetmask 00000039  00000000  00000000  00172b00  2**5
                  CONTENTS, READONLY
 37 .gnu.warning.tmpnam 00000037  00000000  00000000  00172b40  2**5
                  CONTENTS, READONLY
 38 .gnu.warning.tmpnam_r 00000039  00000000  00000000  00172b80  2**5
                  CONTENTS, READONLY
 39 .gnu.warning.tempnam 00000038  00000000  00000000  00172bc0  2**5
                  CONTENTS, READONLY
 40 .gnu.warning.sys_errlist 00000044  00000000  00000000  00172c00  2**5
                  CONTENTS, READONLY
 41 .gnu.warning.sys_nerr 00000041  00000000  00000000  00172c60  2**5
                  CONTENTS, READONLY
 42 .gnu.warning.gets 00000039  00000000  00000000  00172cc0  2**5
                  CONTENTS, READONLY
 43 .gnu.warning.__memset_zero_constant_len_parameter 0000005c
00000000  00000000  00172cf9  2**0
                  CONTENTS, READONLY
 44 .gnu.warning.getpw 0000003a  00000000  00000000  00172d60  2**5
                  CONTENTS, READONLY
 45 .gnu.warning.setlogin 0000003a  00000000  00000000  00172da0  2**5
                  CONTENTS, READONLY
 46 .gnu.warning.re_max_failures 0000003d  00000000  00000000  00172de0  2**5
                  CONTENTS, READONLY
 47 .gnu.warning.lchmod 00000038  00000000  00000000  00172e20  2**5
                  CONTENTS, READONLY
 48 .gnu.warning.getwd 0000007a  00000000  00000000  00172e60  2**5
                  CONTENTS, READONLY
 49 .gnu.warning.sstk 00000036  00000000  00000000  00172ee0  2**5
                  CONTENTS, READONLY
 50 .gnu.warning.revoke 00000038  00000000  00000000  00172f20  2**5
                  CONTENTS, READONLY
 51 .gnu.warning.mktemp 00000037  00000000  00000000  00172f60  2**5
                  CONTENTS, READONLY
 52 .gnu.warning.gtty 00000036  00000000  00000000  00172fa0  2**5
                  CONTENTS, READONLY
 53 .gnu.warning.stty 00000036  00000000  00000000  00172fe0  2**5
                  CONTENTS, READONLY
 54 .gnu.warning.chflags 00000039  00000000  00000000  00173020  2**5
                  CONTENTS, READONLY
 55 .gnu.warning.fchflags 0000003a  00000000  00000000  00173060  2**5
                  CONTENTS, READONLY
 56 .gnu.warning.llseek 0000003f  00000000  00000000  001730a0  2**5
                  CONTENTS, READONLY
 57 .gnu.warning.__gets_chk 00000039  00000000  00000000  001730e0  2**5
                  CONTENTS, READONLY
 58 .gnu.warning.inet6_option_space 0000003c  00000000  00000000  00173120  2**5
                  CONTENTS, READONLY
 59 .gnu.warning.inet6_option_init 0000003b  00000000  00000000  00173160  2**5
                  CONTENTS, READONLY
 60 .gnu.warning.inet6_option_append 0000003d  00000000  00000000
001731a0  2**5
                  CONTENTS, READONLY
 61 .gnu.warning.inet6_option_alloc 0000003c  00000000  00000000  001731e0  2**5
                  CONTENTS, READONLY
 62 .gnu.warning.inet6_option_next 0000003b  00000000  00000000  00173220  2**5
                  CONTENTS, READONLY
 63 .gnu.warning.inet6_option_find 0000003b  00000000  00000000  00173260  2**5
                  CONTENTS, READONLY
 64 .gnu.warning.fattach 00000039  00000000  00000000  001732a0  2**5
                  CONTENTS, READONLY
 65 .gnu.warning.fdetach 00000039  00000000  00000000  001732e0  2**5
                  CONTENTS, READONLY
 66 .gnu_debuglink 00000018  00000000  00000000  001ab7ac  2**2
                  CONTENTS, READONLY
 67 .gnu.libstr   00000014  00000000  00000000  001ab7d8  2**0
                  CONTENTS, READONLY
 68 .gnu.prelink_undo 00000c8c  00000000  00000000  001ab7ec  2**2
                  CONTENTS, READONLY


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]