public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug tools/24795] New: eu-unstrip doesn't recognize MIPS_DWARF as debug section
@ 2019-07-09 21:41 vries at gcc dot gnu.org
  2019-07-09 21:54 ` [Bug tools/24795] " mark at klomp dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2019-07-09 21:41 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=24795

            Bug ID: 24795
           Summary: eu-unstrip doesn't recognize MIPS_DWARF as debug
                    section
           Product: elfutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tools
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

Consider the section header table of a hello world exec on debian 7 MIPS:
...
$ readelf -S hello
There are 42 section headers, starting at offset 0xcf4:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf
Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0 
0
  [ 1] .interp           PROGBITS        00400154 000154 00000d 00   A  0   0 
1
  [ 2] .note.ABI-tag     NOTE            00400164 000164 000020 00   A  0   0 
4
  [ 3] .reginfo          MIPS_REGINFO    00400184 000184 000018 18   A  0   0 
4
  [ 4] .note.gnu.build-i NOTE            0040019c 00019c 000024 00   A  0   0 
4
  [ 5] .dynamic          DYNAMIC         004001c0 0001c0 0000f8 08   A  8   0 
4
  [ 6] .hash             HASH            004002b8 0002b8 000040 04   A  7   0 
4
  [ 7] .dynsym           DYNSYM          004002f8 0002f8 0000b0 10   A  8   1 
4
  [ 8] .dynstr           STRTAB          004003a8 0003a8 000085 00   A  0   0 
1
  [ 9] .gnu.version      VERSYM          0040042e 00042e 000016 02   A  7   0 
2
  [10] .gnu.version_r    VERNEED         00400444 000444 000020 00   A  8   1 
4
  [11] .rel.plt          REL             00400464 000464 000008 08   A  7  13 
4
  [12] .init             PROGBITS        0040046c 00046c 000068 00  AX  0   0 
4
  [13] .plt              PROGBITS        004004e0 0004e0 000030 00  AX  0   0
32
  [14] .text             PROGBITS        00400510 000510 000290 00  AX  0   0
16
  [15] .MIPS.stubs       PROGBITS        004007a0 0007a0 000020 00  AX  0   0 
4
  [16] .fini             PROGBITS        004007c0 0007c0 000038 00  AX  0   0 
4
  [17] .rodata           PROGBITS        00400800 000800 000020 00   A  0   0
16
  [18] .eh_frame         PROGBITS        00400820 000820 000004 00   A  0   0 
4
  [19] .ctors            PROGBITS        00410824 000824 000008 00  WA  0   0 
4
  [20] .dtors            PROGBITS        0041082c 00082c 000008 00  WA  0   0 
4
  [21] .jcr              PROGBITS        00410834 000834 000004 00  WA  0   0 
4
  [22] .data             PROGBITS        00410840 000840 000010 00  WA  0   0
16
  [23] .rld_map          PROGBITS        00410850 000850 000004 00  WA  0   0 
4
  [24] .got.plt          PROGBITS        00410854 000854 00000c 00  WA  0   0 
4
  [25] .got              PROGBITS        00410860 000860 000028 04 WAp  0   0
16
  [26] .sdata            PROGBITS        00410888 000888 000004 00 WAp  0   0 
4
  [27] .bss              NOBITS          00410890 00088c 000010 00  WA  0   0
16
  [28] .comment          PROGBITS        00000000 00088c 000039 01  MS  0   0 
1
  [29] .pdr              PROGBITS        00000000 0008c8 000060 00      0   0 
4
  [30] .debug_aranges    MIPS_DWARF      00000000 000928 000020 00      0   0 
1
  [31] .debug_info       MIPS_DWARF      00000000 000948 000088 00      0   0 
1
  [32] .debug_abbrev     MIPS_DWARF      00000000 0009d0 00003f 00      0   0 
1
  [33] .debug_line       MIPS_DWARF      00000000 000a0f 000064 00      0   0 
1
  [34] .debug_frame      MIPS_DWARF      00000000 000a74 00002c 00      0   0 
4
  [35] .debug_str        MIPS_DWARF      00000000 000aa0 000095 01  MS  0   0 
1
  [36] .debug_loc        MIPS_DWARF      00000000 000b35 00002c 00      0   0 
1
  [37] .gnu.attributes   LOOS+ffffff5    00000000 000b61 000010 00      0   0 
1
  [38] .mdebug.abi32     PROGBITS        00000000 000b71 000000 00      0   0 
1
  [39] .shstrtab         STRTAB          00000000 000b71 000181 00      0   0 
1
  [40] .symtab           SYMTAB          00000000 001384 000550 10     41  58 
4
  [41] .strtab           STRTAB          00000000 0018d4 000273 00      0   0 
1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)
...

After doing:
...
eu-strip hello -o hello.stripped -f hello.debug
...

we have:
...
$ readelf -S hello.debug | grep NOBITS
  [ 1] .interp           NOBITS          00400154 000154 00000d 00   A  0   0 
1
  [ 3] .reginfo          NOBITS          00400184 000174 000018 18   A  0   0 
4
  [ 5] .dynamic          NOBITS          004001c0 000198 0000f8 08   A  8   0 
4
  [ 6] .hash             NOBITS          004002b8 000198 000040 04   A  7   0 
4
  [ 7] .dynsym           NOBITS          004002f8 000198 0000b0 10   A  8   1 
4
  [ 8] .dynstr           NOBITS          004003a8 000198 000085 00   A  0   0 
1
  [ 9] .gnu.version      NOBITS          0040042e 000198 000016 02   A  7   0 
2
  [10] .gnu.version_r    NOBITS          00400444 000198 000020 00   A  8   1 
4
  [11] .rel.plt          NOBITS          00400464 000198 000008 08   A  7  13 
4
  [12] .init             NOBITS          0040046c 000198 000068 00  AX  0   0 
4
  [13] .plt              NOBITS          004004e0 0001a0 000030 00  AX  0   0
32
  [14] .text             NOBITS          00400510 0001a0 000290 00  AX  0   0
16
  [15] .MIPS.stubs       NOBITS          004007a0 0001a0 000020 00  AX  0   0 
4
  [16] .fini             NOBITS          004007c0 0001a0 000038 00  AX  0   0 
4
  [17] .rodata           NOBITS          00400800 0001a0 000020 00   A  0   0
16
  [18] .eh_frame         NOBITS          00400820 0001a0 000004 00   A  0   0 
4
  [19] .ctors            NOBITS          00410824 0001a0 000008 00  WA  0   0 
4
  [20] .dtors            NOBITS          0041082c 0001a0 000008 00  WA  0   0 
4
  [21] .jcr              NOBITS          00410834 0001a0 000004 00  WA  0   0 
4
  [22] .data             NOBITS          00410840 0001a0 000010 00  WA  0   0
16
  [23] .rld_map          NOBITS          00410850 0001a0 000004 00  WA  0   0 
4
  [24] .got.plt          NOBITS          00410854 0001a0 00000c 00  WA  0   0 
4
  [25] .got              NOBITS          00410860 0001a0 000028 04 WAp  0   0
16
  [26] .sdata            NOBITS          00410888 0001a0 000004 00 WAp  0   0 
4
  [27] .bss              NOBITS          00410890 0001a0 000010 00  WA  0   0
16
  [28] .comment          NOBITS          00000000 0001a0 000039 01  MS  0   0 
1
  [30] .debug_aranges    NOBITS          00000000 000200 000020 00      0   0 
1
  [31] .debug_info       NOBITS          00000000 000200 000088 00      0   0 
1
  [32] .debug_abbrev     NOBITS          00000000 000200 00003f 00      0   0 
1
  [33] .debug_line       NOBITS          00000000 000200 000064 00      0   0 
1
  [34] .debug_frame      NOBITS          00000000 000200 00002c 00      0   0 
4
  [35] .debug_str        NOBITS          00000000 000200 000095 01  MS  0   0 
1
  [36] .debug_loc        NOBITS          00000000 000200 00002c 00      0   0 
1
  [37] .gnu.attributes   NOBITS          00000000 000200 000010 00      0   0 
1
...

The .debug_* section should not be NOBITS here.

This is with an old eu-strip (0.152), but I don't manage building from git for
now, so atm I cannot say whether this is fixed on trunk or not.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2019-07-10 10:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-09 21:41 [Bug tools/24795] New: eu-unstrip doesn't recognize MIPS_DWARF as debug section vries at gcc dot gnu.org
2019-07-09 21:54 ` [Bug tools/24795] " mark at klomp dot org
2019-07-09 22:08 ` vries at gcc dot gnu.org
2019-07-10 10:41 ` mark at klomp dot org
2019-07-10 10:44 ` mark at klomp dot org

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).