public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Do we need section symbols for .shstrtab, .symtab, .strtab?
@ 2006-06-01  0:41 H. J. Lu
  2006-06-01  2:52 ` Alan Modra
  0 siblings, 1 reply; 7+ messages in thread
From: H. J. Lu @ 2006-06-01  0:41 UTC (permalink / raw)
  To: binutils

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-06-02  7:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-01  0:41 Do we need section symbols for .shstrtab, .symtab, .strtab? H. J. Lu
2006-06-01  2:52 ` Alan Modra
2006-06-01  5:37   ` H. J. Lu
2006-06-01  6:08     ` Alan Modra
2006-06-02  0:35   ` PATCH: PR ld/2723: ld puts unused section symbols in symbol table H. J. Lu
2006-06-02  2:30     ` Alan Modra
2006-06-02  8:49       ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).