From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Rich Felker <dalias@libc.org>
Cc: libc-alpha@sourceware.org, gdb-patches@sourceware.org
Subject: Re: [libc patch] __tls_get_addr with link_map * instead of modid
Date: Sat, 18 Oct 2014 21:27:00 -0000 [thread overview]
Message-ID: <20141018212727.GA27805@host2.jankratochvil.net> (raw)
In-Reply-To: <20141018212048.GH32028@brightrain.aerifal.cx>
On Sat, 18 Oct 2014 23:20:48 +0200, Rich Felker wrote:
> > Additionally one could also fetch the module id from R_X86_64_DTPMOD64 but that
> > would require arch specific code in GDB. I do not plan to implement this way.
>
> I don't see how this would work; how would you request the dynamic
> linker to resolve that for you?
When the inferior is running the relocation is already resolved. So GDB can
just read the module id from relocation's location. The problem is that
'.rela.dyn' is not parsed by BFD so one would either have to extend BFD to
parse it or provide a separate '.rela.dyn' parser in GDB for each arch.
From '.rela.dyn' one can find the symbol name and relocation's location.
Relocation section '.rela.dyn' at offset 0x520 contains 10 entries:
Offset Info Type Symbol's Value Symbol's Name + Addend
0000000000200fd0 0000000a00000010 R_X86_64_DTPMOD64 0000000000000000 x + 0
0000000000200fd8 0000000a00000011 R_X86_64_DTPOFF64 0000000000000000 x + 0
7ac: 66 48 8d 3d 1c 08 20 data32 lea 0x20081c(%rip),%rdi # 200fd0 <_DYNAMIC+0x1d8>
7b3: 00
7b4: 66 66 48 e8 d4 fe ff data32 data32 callq 690 <__tls_get_addr@plt>
7bb: ff
But that is an offtopic discussion for this patch.
Jan
next prev parent reply other threads:[~2014-10-18 21:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-18 20:15 Jan Kratochvil
2014-10-18 21:20 ` Rich Felker
2014-10-18 21:27 ` Jan Kratochvil [this message]
2014-10-18 21:44 ` Rich Felker
2014-10-23 10:03 ` Alexandre Oliva
2014-10-23 12:52 ` Jan Kratochvil
2014-10-24 1:47 ` Mike Frysinger
2014-10-24 2:21 ` Carlos O'Donell
[not found] ` <20141024093834.GA24090@host2.jankratochvil.net>
2014-10-24 14:22 ` Carlos O'Donell
2014-10-24 14:40 ` Jan Kratochvil
2014-10-24 15:00 ` Carlos O'Donell
2014-10-25 5:55 ` Rich Felker
2014-10-25 6:14 ` Jan Kratochvil
2014-10-25 6:26 ` Rich Felker
2014-10-24 15:56 ` Pedro Alves
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=20141018212727.GA27805@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=dalias@libc.org \
--cc=gdb-patches@sourceware.org \
--cc=libc-alpha@sourceware.org \
/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