This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Regression on prelinked-sepdebug-shlibs
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 4 Jan 2010 11:23:17 +0100
- Subject: Re: Regression on prelinked-sepdebug-shlibs
- References: <20091225200440.GA3747@host0.dyn.jankratochvil.net> <3346A919-88F5-457A-B6D1-0A35EB2C17F1@adacore.com>
On Mon, 04 Jan 2010 10:50:49 +0100, Tristan Gingold wrote:
> my understanding is that separate debug info and its binary file have the
> same ordering of sections, or to be more precise, the separate debug info
> only appends new debug sections to the binary file while making content
> sections empty.
$ rpm -V bash bash-debuginfo; rpm -qf /bin/bash /usr/lib/debug/bin/bash.debug
bash-4.0.35-2.fc12.x86_64
bash-debuginfo-4.0.35-2.fc12.x86_64
/bin/bash:
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 0000000000400238 000238 00001c 00 A 0 0 1
[ 2] .note.ABI-tag NOTE 0000000000400254 000254 000020 00 A 0 0 4
[ 3] .note.gnu.build-id NOTE 0000000000400274 000274 000024 00 A 0 0 4
[ 4] .gnu.hash GNU_HASH 0000000000400298 000298 0035a4 00 A 5 0 8
[ 5] .dynsym DYNSYM 0000000000403840 003840 00c360 18 A 28 1 8
[ 6] .gnu.liblist GNU_LIBLIST 000000000040fba0 00fba0 000050 14 A 28 0 4
[ 7] .gnu.conflict RELA 000000000040fbf0 00fbf0 000468 18 A 5 0 8
[ 8] .gnu.version VERSYM 0000000000417a2c 017a2c 001048 02 A 5 0 2
[ 9] .gnu.version_r VERNEED 0000000000418a78 018a78 000080 00 A 28 2 8
[10] .rela.dyn RELA 0000000000418af8 018af8 0000c0 18 A 5 0 8
[11] .rela.plt RELA 0000000000418bb8 018bb8 001278 18 A 5 13 8
[12] .init PROGBITS 0000000000419e30 019e30 000018 00 AX 0 0 4
[13] .plt PROGBITS 0000000000419e48 019e48 000c60 10 AX 0 0 4
[14] .text PROGBITS 000000000041aab0 01aab0 0833c8 00 AX 0 0 16
[15] .fini PROGBITS 000000000049de78 09de78 00000e 00 AX 0 0 4
[16] .rodata PROGBITS 000000000049dea0 09dea0 01bbe8 00 A 0 0 32
[17] .eh_frame_hdr PROGBITS 00000000004b9a88 0b9a88 003a4c 00 A 0 0 4
[18] .eh_frame PROGBITS 00000000004bd4d8 0bd4d8 0134cc 00 A 0 0 8
[19] .ctors PROGBITS 00000000006d09a8 0d09a8 000010 00 WA 0 0 8
[20] .dtors PROGBITS 00000000006d09b8 0d09b8 000010 00 WA 0 0 8
[21] .jcr PROGBITS 00000000006d09c8 0d09c8 000008 00 WA 0 0 8
[22] .dynamic DYNAMIC 00000000006d09d0 0d09d0 0001b0 10 WA 28 0 8
[23] .got PROGBITS 00000000006d0b80 0d0b80 000008 08 WA 0 0 8
[24] .got.plt PROGBITS 00000000006d0b88 0d0b88 000640 08 WA 0 0 8
[25] .data PROGBITS 00000000006d11e0 0d11e0 008364 00 WA 0 0 32
[26] .dynbss PROGBITS 00000000006d9560 0d9560 000058 00 WA 0 0 32
[27] .bss NOBITS 00000000006d95b8 0d95b8 0057b8 00 WA 0 0 32
[28] .dynstr STRTAB 00000000008d95b8 0d95b8 007edf 00 A 0 0 1
[29] .gnu_debuglink PROGBITS 0000000000000000 0e1498 000010 00 0 0 4
[30] .gnu.prelink_undo PROGBITS 0000000000000000 0e14a8 0008c0 01 0 0 8
[31] .shstrtab STRTAB 0000000000000000 0e1d68 000129 00 0 0 1
/usr/lib/debug/bin/bash.debug
Section Headers:
[Nr] Name Type Address Off Size ES Flg Lk Inf Al
[ 0] NULL 0000000000000000 000000 000000 00 0 0 0
[ 1] .interp NOBITS 0000000000400200 000200 00001c 00 A 0 0 1
[ 2] .note.ABI-tag NOTE 000000000040021c 000200 000020 00 A 0 0 4
[ 3] .note.gnu.build-id NOTE 000000000040023c 000220 000024 00 A 0 0 4
[ 4] .gnu.hash NOBITS 0000000000400260 000248 0035a4 00 A 5 0 8
[ 5] .dynsym NOBITS 0000000000403808 000248 00c360 18 A 6 1 8
[ 6] .dynstr NOBITS 000000000040fb68 000248 007ec3 00 A 0 0 1
[ 7] .gnu.version NOBITS 0000000000417a2c 000248 001048 02 A 5 0 2
[ 8] .gnu.version_r NOBITS 0000000000418a78 000248 000080 00 A 6 2 8
[ 9] .rela.dyn NOBITS 0000000000418af8 000248 0000c0 18 A 5 0 8
[10] .rela.plt NOBITS 0000000000418bb8 000248 001278 18 A 5 12 8
[11] .init NOBITS 0000000000419e30 000248 000018 00 AX 0 0 4
[12] .plt NOBITS 0000000000419e48 000248 000c60 10 AX 0 0 4
[13] .text NOBITS 000000000041aab0 000250 0833c8 00 AX 0 0 16
[14] .fini NOBITS 000000000049de78 000250 00000e 00 AX 0 0 4
[15] .rodata NOBITS 000000000049dea0 000260 01bbe8 00 A 0 0 32
[16] .eh_frame_hdr NOBITS 00000000004b9a88 000260 003a4c 00 A 0 0 4
[17] .eh_frame NOBITS 00000000004bd4d8 000260 0134cc 00 A 0 0 8
[18] .ctors NOBITS 00000000006d09a8 000260 000010 00 WA 0 0 8
[19] .dtors NOBITS 00000000006d09b8 000260 000010 00 WA 0 0 8
[20] .jcr NOBITS 00000000006d09c8 000260 000008 00 WA 0 0 8
[21] .dynamic NOBITS 00000000006d09d0 000260 0001b0 10 WA 6 0 8
[22] .got NOBITS 00000000006d0b80 000260 000008 08 WA 0 0 8
[23] .got.plt NOBITS 00000000006d0b88 000260 000640 08 WA 0 0 8
[24] .data NOBITS 00000000006d11e0 000260 008364 00 WA 0 0 32
[25] .bss NOBITS 00000000006d9560 000260 005810 00 WA 0 0 32
[26] .comment PROGBITS 0000000000000000 000260 001ca7 00 0 0 1
[27] .debug_aranges PROGBITS 0000000000000000 001f07 001d10 00 0 0 1
[28] .debug_pubnames PROGBITS 0000000000000000 003c17 00a4e6 00 0 0 1
[29] .debug_info PROGBITS 0000000000000000 00e0fd 085cf8 00 0 0 1
[30] .debug_abbrev PROGBITS 0000000000000000 093df5 01677e 00 0 0 1
[31] .debug_line PROGBITS 0000000000000000 0aa573 022fb4 00 0 0 1
[32] .debug_str PROGBITS 0000000000000000 0cd527 013a03 01 MS 0 0 1
[33] .debug_loc PROGBITS 0000000000000000 0e0f2a 0998d3 00 0 0 1
[34] .debug_pubtypes PROGBITS 0000000000000000 17a7fd 00b5b6 00 0 0 1
[35] .debug_ranges PROGBITS 0000000000000000 185db3 012850 00 0 0 1
[36] .shstrtab STRTAB 0000000000000000 198603 000177 00 0 0 1
[37] .symtab SYMTAB 0000000000000000 198780 013d10 18 38 1300 8
[38] .strtab STRTAB 0000000000000000 1ac490 00d961 00 0 0 1
This is different after prelink-ing /bin/bash. After "prelink -u" there are still differences:
(from section 26)
/tmp/bashu:
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 0000000000400200 000200 00001c 00 A 0 0 1
[ 2] .note.ABI-tag NOTE 000000000040021c 00021c 000020 00 A 0 0 4
[ 3] .note.gnu.build-id NOTE 000000000040023c 00023c 000024 00 A 0 0 4
[ 4] .gnu.hash GNU_HASH 0000000000400260 000260 0035a4 00 A 5 0 8
[ 5] .dynsym DYNSYM 0000000000403808 003808 00c360 18 A 6 1 8
[ 6] .dynstr STRTAB 000000000040fb68 00fb68 007ec3 00 A 0 0 1
[ 7] .gnu.version VERSYM 0000000000417a2c 017a2c 001048 02 A 5 0 2
[ 8] .gnu.version_r VERNEED 0000000000418a78 018a78 000080 00 A 6 2 8
[ 9] .rela.dyn RELA 0000000000418af8 018af8 0000c0 18 A 5 0 8
[10] .rela.plt RELA 0000000000418bb8 018bb8 001278 18 A 5 12 8
[11] .init PROGBITS 0000000000419e30 019e30 000018 00 AX 0 0 4
[12] .plt PROGBITS 0000000000419e48 019e48 000c60 10 AX 0 0 4
[13] .text PROGBITS 000000000041aab0 01aab0 0833c8 00 AX 0 0 16
[14] .fini PROGBITS 000000000049de78 09de78 00000e 00 AX 0 0 4
[15] .rodata PROGBITS 000000000049dea0 09dea0 01bbe8 00 A 0 0 32
[16] .eh_frame_hdr PROGBITS 00000000004b9a88 0b9a88 003a4c 00 A 0 0 4
[17] .eh_frame PROGBITS 00000000004bd4d8 0bd4d8 0134cc 00 A 0 0 8
[18] .ctors PROGBITS 00000000006d09a8 0d09a8 000010 00 WA 0 0 8
[19] .dtors PROGBITS 00000000006d09b8 0d09b8 000010 00 WA 0 0 8
[20] .jcr PROGBITS 00000000006d09c8 0d09c8 000008 00 WA 0 0 8
[21] .dynamic DYNAMIC 00000000006d09d0 0d09d0 0001b0 10 WA 6 0 8
[22] .got PROGBITS 00000000006d0b80 0d0b80 000008 08 WA 0 0 8
[23] .got.plt PROGBITS 00000000006d0b88 0d0b88 000640 08 WA 0 0 8
[24] .data PROGBITS 00000000006d11e0 0d11e0 008364 00 WA 0 0 32
[25] .bss NOBITS 00000000006d9560 0d9544 005810 00 WA 0 0 32
[26] .gnu_debuglink PROGBITS 0000000000000000 0d9544 000010 00 0 0 4
[27] .shstrtab STRTAB 0000000000000000 0d9554 0000f4 00 0 0 1
> Also, if you look at symfile.c:reread_separate_symbols (before my patch),
> there was this code:
OK, so reread_separate_symbols was wrong. This rereading code needs
a rewrite - to unify it with the common loading code.
> BTW, where can I find prelink ? Looks like it is not available on RHEL S 5.2
It has been always provided in RHELs, Fedoras etc.:
ftp://ftp.redhat.com/redhat/linux/enterprise/5Server/en/os/SRPMS/prelink-0.3.9-2.1.src.rpm
> > There was some description of these data structures in:
> > [patch 05/15] PIE: Move some symfile code into subroutines
> > http://sourceware.org/ml/gdb-patches/2009-11/msg00172.html
> > [patch 06/15] PIE: Fix displacement of separate debug info files
> > http://sourceware.org/ml/gdb-patches/2009-11/msg00173.html
> >
> > (I see a big conflict now there for my unchecked-in PIE patch, oops.)
>
> Will read these patches.
I meant rather just the initial comments, not the patches themselves.
> The main drawback of addr-table is that is it much slower.
IMO this kind of performance difference is negligible to be considered.
It is some overhead per-section while now GDB has many overheads per-symbol.
Regards,
Jan