This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB 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]

[Bug symtab/11409] New: syms_from_objfile mishandles duplicate section names


When gdb reads a separate debug info that contains two sections with the same
name it miscalculates the section offset of the duplicate section.  Any symbols
defined in such a section are get the wrong address.

There are 41 section headers, starting at offset 0x10e1ce8:

Section Headers:
  [Nr] Name              Type            Address          Off    Size   ES Flg
Lk Inf Al
  [ 0]                   NULL            0000000000000000 000000 000000 00     
0   0  0
  [ 1] .interp           PROGBITS        0000000010000200 000200 000011 00   A 
0   0  1
  [ 2] .note.ABI-tag     NOTE            0000000010000214 000214 000020 00   A 
0   0  4
  [ 3] .note.SuSE        NOTE            0000000010000234 000234 000018 00   A 
0   0  4
  [ 4] .note.gnu.build-id NOTE            000000001000024c 00024c 000024 00   A 
0   0  4
  [ 5] .hash             HASH            0000000010000270 000270 001634 04   A 
7   0  8
  [ 6] .gnu.hash         GNU_HASH        00000000100018a8 0018a8 0000b4 00   A 
7   0  8
  [ 7] .dynsym           DYNSYM          0000000010001960 001960 005430 18   A 
8   1  8
  [ 8] .dynstr           STRTAB          0000000010006d90 006d90 003bbc 00   A 
0   0  1
  [ 9] .gnu.version      VERSYM          000000001000a94c 00a94c 000704 02   A 
7   0  2
  [10] .gnu.version_r    VERNEED         000000001000b050 00b050 0000e0 00   A 
8   5  8
  [11] .rela.toc         RELA            000000001000b130 00b130 0003f0 18   A 
7   0  8
  [12] .rela.plt         RELA            000000001000b520 00b520 0050b8 18   A 
7  25  8
  [13] .init             PROGBITS        00000000100105d8 0105d8 000050 00  AX 
0   0  8
  [14] .text             PROGBITS        0000000010010630 010630 2014f8 00  AX 
0   0 16
  [15] .fini             PROGBITS        0000000010211b28 211b28 000020 00  AX 
0   0  8
  [16] .rodata           PROGBITS        0000000010211b48 211b48 01d158 00   A 
0   0  8
  [17] .eh_frame_hdr     PROGBITS        000000001022eca0 22eca0 006a04 00   A 
0   0  4
  [18] .eh_frame         PROGBITS        00000000102356a8 2356a8 01fe98 00   A 
0   0  8
  [19] .data.rel.ro      PROGBITS        0000000010265a00 255a00 000200 00  WA 
0   0  8
  [20] .dynamic          DYNAMIC         0000000010265c00 255c00 000400 10  WA 
8   0  8
  [21] .data             PROGBITS        0000000010266000 256000 2a5bd8 00  WA 
0   0  8
  [22] .opd              PROGBITS        000000001050bbd8 4fbbd8 013e18 00  WA 
0   0  8
  [23] .branch_lt        PROGBITS        000000001051f9f0 50f9f0 000000 00  WA 
0   0  8
  [24] .got              PROGBITS        000000001051f9f0 50f9f0 010068 08  WA 
0   0  8
  [25] .data             PROGBITS        000000001052fa58 51fa58 6765a8 00  WA 
0   0  8
  [26] .plt              NOBITS          0000000010ba6000 b96000 000000 18  WA 
0   0 16
  [27] .bss              NOBITS          0000000010ba6000 b96000 000000 00  WA 
0   0  1
  [28] .comment.SUSE.OPTs PROGBITS        0000000000000000 b96000 000006 01  MS 
0   0  1
  [29] .comment          PROGBITS        0000000000000000 b96006 000120 00     
0   0  1
  [30] .debug_aranges    PROGBITS        0000000000000000 b96126 000f30 00     
0   0  1
  [31] .debug_pubnames   PROGBITS        0000000000000000 b97056 01b0dc 00     
0   0  1
  [32] .debug_info       PROGBITS        0000000000000000 bb2132 1e3976 00     
0   0  1
  [33] .debug_abbrev     PROGBITS        0000000000000000 d95aa8 015847 00     
0   0  1
  [34] .debug_line       PROGBITS        0000000000000000 dab2ef 041121 00     
0   0  1
  [35] .debug_str        PROGBITS        0000000000000000 dec410 03c4fb 01  MS 
0   0  1
  [36] .debug_loc        PROGBITS        0000000000000000 e2890b 270020 00     
0   0  1
  [37] .debug_ranges     PROGBITS        0000000000000000 109892b 049230 00     
0   0  1
  [38] .shstrtab         STRTAB          0000000000000000 10e1b5b 000186 00     
0   0  1
  [39] .symtab           SYMTAB          0000000000000000 10e2728 032a48 18    
40 2633  8
  [40] .strtab           STRTAB          0000000000000000 1115170 02a295 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)

(top-gdb) p addrs.other [0]@addrs .num_sections 
$48 = {{addr = 0x0, name = 0x107e0b20 ".interp", sectindex = 0x0}, {
    addr = 0x0, name = 0x108171c0 ".note.ABI-tag", sectindex = 0x1}, {
    addr = 0x0, name = 0x108171e0 ".note.SuSE", sectindex = 0x2}, {
    addr = 0x0, name = 0x10817200 ".note.gnu.build-id", sectindex = 0x3}, {
    addr = 0x0, name = 0x10817220 ".hash", sectindex = 0x4}, {addr = 0x0, 
    name = 0x10817240 ".gnu.hash", sectindex = 0x5}, {addr = 0x0, 
    name = 0x10817260 ".dynsym", sectindex = 0x6}, {addr = 0x0, 
    name = 0x10817280 ".dynstr", sectindex = 0x7}, {addr = 0x0, 
    name = 0x108172a0 ".gnu.version", sectindex = 0x8}, {addr = 0x0, 
    name = 0x108172c0 ".gnu.version_r", sectindex = 0x9}, {addr = 0x0, 
    name = 0x108172e0 ".rela.toc", sectindex = 0xa}, {addr = 0x0, 
    name = 0x10817300 ".rela.plt", sectindex = 0xb}, {addr = 0x0, 
    name = 0x10817320 ".init", sectindex = 0xc}, {addr = 0x0, 
    name = 0x10817340 ".text", sectindex = 0xd}, {addr = 0x0, 
    name = 0x10817360 ".fini", sectindex = 0xe}, {addr = 0x0, 
    name = 0x10817380 ".rodata", sectindex = 0xf}, {addr = 0x0, 
    name = 0x108173a0 ".eh_frame_hdr", sectindex = 0x10}, {addr = 0x0, 
    name = 0x108173c0 ".eh_frame", sectindex = 0x11}, {addr = 0x0, 
    name = 0x108173e0 ".data.rel.ro", sectindex = 0x12}, {addr = 0x0, 
    name = 0x10817400 ".dynamic", sectindex = 0x13}, {addr = 0x0, 
    name = 0x10817420 ".data", sectindex = 0x14}, {addr = 0x0, 
    name = 0x10817440 ".opd", sectindex = 0x15}, {addr = 0x0, 
    name = 0x10817460 ".branch_lt", sectindex = 0x16}, {addr = 0x0, 
    name = 0x107f3680 ".got", sectindex = 0x17}, {addr = 0x2e41b0, 
    name = 0x10817480 ".data", sectindex = 0x14}, {addr = 0x0, 
    name = 0x107b55b0 ".plt", sectindex = 0x19}, {addr = 0x0, 
    name = 0x107b55d0 ".bss", sectindex = 0x1a}, {addr = 0x0, name = 0x0, 
    sectindex = 0x0}, {addr = 0x0, name = 0x0, sectindex = 0x0}}

-- 
           Summary: syms_from_objfile mishandles duplicate section names
           Product: gdb
           Version: 7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: symtab
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: schwab at linux-m68k dot org
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=11409

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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