This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Gdb, PIE and scan_dyntag(DT_DEBUG)
- From: Robert Jarzmik <robert dot jarzmik at free dot fr>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb at sourceware dot org, robert dot jarzmik at intel dot com
- Date: Tue, 01 Apr 2014 23:00:01 +0200
- Subject: Re: Gdb, PIE and scan_dyntag(DT_DEBUG)
- Authentication-results: sourceware.org; auth=none
- References: <87bnwuuhzp dot fsf at free dot fr> <20140331184724 dot GA6038 at host2 dot jankratochvil dot net> <877g7augck dot fsf at free dot fr> <20140401064803 dot GA31557 at host2 dot jankratochvil dot net>
Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> On Tue, 01 Apr 2014 00:56:59 +0200, Robert Jarzmik wrote:
>> To be more precise, the ELF program headers of the unstripped binary and the
>> stripped binary didn't match,
>
> In general eu-strip (from elfutils; compared to binutils strip) is more
> preserving the binaries when they still should match each other.
> And Fedora is using eu-strip for the debug info packages separation.
> IIRC I have seen some other distro using regular strip for it.
And you're damn right about it. I checked the Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
*** unstripped app_process ***
[Requesting program interpreter: /system/bin/linker64]
LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000001788 0x0000000000001788 R E 1000
LOAD 0x0000000000001c20 0x0000000000002c20 0x0000000000002c20
0x00000000000003e0 0x00000000000003e8 RW 1000
*** binutils strip passed app_process ***
[Requesting program interpreter: /system/bin/linker64]
LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000001788 0x0000000000001788 R E 1000
LOAD 0x0000000000001c20 0x0000000000002c20 0x0000000000002c20
0x00000000000003d8 0x00000000000003e8 RW 1000
*** elfutils eu-strip passed app_process ***
[Requesting program interpreter: /system/bin/linker64]
LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000001788 0x0000000000001788 R E 1000
LOAD 0x0000000000001c20 0x0000000000002c20 0x0000000000002c20
0x00000000000003e0 0x00000000000003e8 RW 1000
So eu-strip makes my day :)
Thanks for the info, I didn't know there was a difference in strip between
binutils and elfutils.
Cheers.
--
Robert