From: Pedro Alves <palves@redhat.com>
To: Tom de Vries <tdevries@suse.de>, Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org, Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [PATCH][gdb] Fix gdb.dwarf2/amd64-entry-value-param.exp with -fPIE/-pie
Date: Fri, 16 Aug 2019 18:33:00 -0000 [thread overview]
Message-ID: <6c25bce6-baaf-9820-e140-12c0e80fa2cc@redhat.com> (raw)
In-Reply-To: <c488f464-21c0-8947-c68e-bc4e025720d0@suse.de>
On 8/12/19 2:10 PM, Tom de Vries wrote:
>> Tom> + CORE_ADDR baseaddr
>> Tom> + = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
>>
>> I guess this assumes the text section - but then can the call to
>> find_pc_section give anything else? Maybe it's just something to
>> comment and move on.
>>
> I suppose that find_pc_section also can return .init or .fini., but I
> imagine these wil have the same sections offsets as .text.
>
Hmm. That'll usually be the case on GNU/Linux and other standard
operating systems, where you have a single text segment containing all sections.
But they might well not have the same offsets if you're debugging a relocatable
object, for example. Some targets' shared libraries are relocatable objects
instead of fully linked binaries. See "Library List Format" in the manual:
~~~
For the common case of libraries that are fully linked binaries, the
library should have a list of segments. If the target supports
dynamic linking of a relocatable object file, its library XML element
should instead include a list of allocated sections. The segment or
section bases are start addresses, not relocation offsets; they do not
depend on the library's link-time base addresses.
~~~
Linux kernel modules would be something like that too, I think.
If easy, it seems better to look up the section.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2019-08-16 18:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-09 7:54 Tom de Vries
2019-08-09 8:33 ` Jan Kratochvil
2019-08-09 18:16 ` Tom Tromey
2019-08-12 13:10 ` Tom de Vries
2019-08-16 18:33 ` Pedro Alves [this message]
[not found] ` <ec0c10a4-ff73-4159-bce4-f1c702834d80@suse.de>
2019-09-02 11:08 ` [PING][PATCH][gdb] " Tom de Vries
2019-09-10 15:49 ` [PING^2][PATCH][gdb] " Tom de Vries
2019-09-13 19:45 ` Tom de Vries
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=6c25bce6-baaf-9820-e140-12c0e80fa2cc@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=tdevries@suse.de \
--cc=tom@tromey.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