From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb@sourceware.org, robert.jarzmik@intel.com
Subject: Re: Gdb, PIE and scan_dyntag(DT_DEBUG)
Date: Mon, 31 Mar 2014 22:57:00 -0000 [thread overview]
Message-ID: <877g7augck.fsf@free.fr> (raw)
In-Reply-To: <20140331184724.GA6038@host2.jankratochvil.net> (Jan Kratochvil's message of "Mon, 31 Mar 2014 20:47:24 +0200")
Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> On Tue, 25 Mar 2014 21:43:22 +0100, Robert Jarzmik wrote:
>> I have a problem with gdb not finding the shared library list when analyzing a
>> core dump of an ELF-X86-64 binary on Linux.
>
> The problem is it works for me. Tested on Fedora 20 x86_64 although I am not
> aware of any distro-specific stuff which could affect this functionality.
> It is also relevant to know prelink status but I have tested this
> functionality now even with unprelinked ld.so and libc.so:
OK, you're right.
I finally found the culprit : in my case, it was the linker and strip
discrepency.
To be more precise, the ELF program headers of the unstripped binary and the
stripped binary didn't match, as in the unstripped one the .bss section was
aligned (fileoffset wise) on 8 bytes, while in the stripped version it was
aligned on 4 (as the .bss section alignement).
This was creating different filesizes for the segment containing the .bss
section, and therefore gdb's svr4_relocate_*() function was lost and did not
relocate my PIE executable.
GDB was right, it's the linker which was faulty in my case.
Cheers.
--
Robert
next prev parent reply other threads:[~2014-03-31 22:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 20:43 Robert Jarzmik
2014-03-31 18:47 ` Jan Kratochvil
2014-03-31 22:57 ` Robert Jarzmik [this message]
2014-04-01 6:48 ` Jan Kratochvil
2014-04-01 21:00 ` Robert Jarzmik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877g7augck.fsf@free.fr \
--to=robert.jarzmik@free.fr \
--cc=gdb@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=robert.jarzmik@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox