From: Robert Jarzmik <robert.jarzmik@free.fr>
To: gdb@sourceware.org
Cc: robert.jarzmik@intel.com
Subject: Gdb, PIE and scan_dyntag(DT_DEBUG)
Date: Tue, 25 Mar 2014 20:43:00 -0000 [thread overview]
Message-ID: <87bnwuuhzp.fsf@free.fr> (raw)
Hello,
I'm pretty sure this was already covered somewhere, so a pointer would be great.
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.
After putting traces here and there, it boils down to :
- the executable is placed at a random address (ASLR in linux)
- the displacement is correctly input in AUXV
- the linker base is not correctly computed
The trouble lies in the scan_dyntag(DT_DEBUG) called by elf_locate_base() for me
:
- it tries first target_ops=core_ops, and looks at non-displaced address of
.dynamic => failure => that's great
- it then tries target_ops=exec_ops, and looks at non-displaced address of
.dynamic => it succeeds, returning 0 => that's my problem
As the call succeeded, elf_locate_base() won't call scan_dyntag_auxv()
I manually "forced" elf_locate_base() to call scan_dyntag_aux() and then all my
shared libraries appear.
Could somebody tell me what's wrong in my core/executable/whatever, and why GDB
is looking at the executable file .dynamic section before attempting AUXV
AT_BASE reading and memory read accordingly ?
Cheers.
--
Robert
PS: I'm using GDB 7.6. If it was fixed later I'll happily cherry-pick the patch.
next reply other threads:[~2014-03-25 20:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 20:43 Robert Jarzmik [this message]
2014-03-31 18:47 ` Jan Kratochvil
2014-03-31 22:57 ` Robert Jarzmik
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=87bnwuuhzp.fsf@free.fr \
--to=robert.jarzmik@free.fr \
--cc=gdb@sourceware.org \
--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