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]

Do we need section symbols for .shstrtab, .symtab, .strtab?


I got

hjl@gnu-10 tmp]$ cat x.c
_start ()
{
}
[hjl@gnu-10 tmp]$ gcc -c x.c
[hjl@gnu-10 tmp]$ readelf -sS x.o
There are 9 section headers, starting at offset 0xb0:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        00000000 000034 000005 00  AX  0   0  4
  [ 2] .data             PROGBITS        00000000 00003c 000000 00  WA  0   0  4
  [ 3] .bss              NOBITS          00000000 00003c 000000 00  WA  0   0  4
  [ 4] .comment          PROGBITS        00000000 00003c 00002d 00      0   0  1
  [ 5] .note.GNU-stack   PROGBITS        00000000 000069 000000 00      0   0  1
  [ 6] .shstrtab         STRTAB          00000000 000069 000045 00      0   0  1
  [ 7] .symtab           SYMTAB          00000000 000218 000080 10      8   7  4
  [ 8] .strtab           STRTAB          00000000 000298 00000c 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)

Symbol table '.symtab' contains 8 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 FILE    LOCAL  DEFAULT  ABS x.c
     2: 00000000     0 SECTION LOCAL  DEFAULT    1 
     3: 00000000     0 SECTION LOCAL  DEFAULT    2 
     4: 00000000     0 SECTION LOCAL  DEFAULT    3 
     5: 00000000     0 SECTION LOCAL  DEFAULT    5 
     6: 00000000     0 SECTION LOCAL  DEFAULT    4 
     7: 00000000     5 FUNC    GLOBAL DEFAULT    1 _start
[hjl@gnu-10 tmp]$ ld x.o
[hjl@gnu-10 tmp]$ readelf -sS a.out
There are 6 section headers, starting at offset 0xf0:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        08048094 000094 000005 00  AX  0   0  4
  [ 2] .comment          PROGBITS        00000000 000099 00002d 00      0   0  1
  [ 3] .shstrtab         STRTAB          00000000 0000c6 00002a 00      0   0  1
  [ 4] .symtab           SYMTAB          00000000 0001e0 0000b0 10      5   7  4
  [ 5] .strtab           STRTAB          00000000 000290 000024 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)

Symbol table '.symtab' contains 11 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 08048094     0 SECTION LOCAL  DEFAULT    1 
     2: 00000000     0 SECTION LOCAL  DEFAULT    2 
     3: 00000000     0 SECTION LOCAL  DEFAULT    3 
     4: 00000000     0 SECTION LOCAL  DEFAULT    4 
     5: 00000000     0 SECTION LOCAL  DEFAULT    5 
     6: 00000000     0 FILE    LOCAL  DEFAULT  ABS x.c
     7: 08048094     5 FUNC    GLOBAL DEFAULT    1 _start
     8: 08049099     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
     9: 08049099     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
    10: 0804909c     0 NOTYPE  GLOBAL DEFAULT  ABS _end

Do we need section symbols for .shstrtab, .symtab, .strtab in
executable and shared library?


H.J.


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