Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Gdb, PIE and scan_dyntag(DT_DEBUG)
@ 2014-03-25 20:43 Robert Jarzmik
  2014-03-31 18:47 ` Jan Kratochvil
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Jarzmik @ 2014-03-25 20:43 UTC (permalink / raw)
  To: gdb; +Cc: robert.jarzmik

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.


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

end of thread, other threads:[~2014-04-01 21:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-25 20:43 Gdb, PIE and scan_dyntag(DT_DEBUG) Robert Jarzmik
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox