From: Stefano Bonifazi <stefboombastic@gmail.com>
To: Mike Frysinger <vapier@gentoo.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [RFC/PATCH] elfload: add FDPIC support
Date: Mon, 24 Jan 2011 23:07:01 +0100 [thread overview]
Message-ID: <4D3DF805.4010004@gmail.com> (raw)
In-Reply-To: <AANLkTi=Q2XdWiy43ppBZhWpfWUB4H0urPeyWbJ+8HgNM@mail.gmail.com>
On 01/24/2011 10:27 PM, Mike Frysinger wrote:
> On Mon, Jan 24, 2011 at 16:06, Stefano Bonifazi wrote:
>> I don't understand.. what is the difference between pie binary for pcc and
>> for your architecture?
> as i said, i think this is all irrelevant to what you want to do. but
> since you asked and i feel like writing ...
>
> i have no idea what "pcc" is. there are really two stark differences
> between FDPIC ELF and a PIE ELF on say x86. since the data/text
> sections can be relocated independently of each other, the PIC cannot
> assume a fixed offset between its text and GOT. so every PLT entry is
> actually two sets of addresses -- the function address and the
> function's GOT address. the other big difference is that an FDPIC ELF
> app must first do a little relocation processing of itself as soon as
> it starts ... in order to do so, the kernel provides a loadmap (made
> up of multiple loadsegs) which describes the executable's PT_LOADs
> (the addr encoded in the program header and the addr the chunk was
> actually relocated to) as well as the (optional) executable's
> interpreter's PT_LOADs.
>
>> As far as I understood pie code is independent from addresses, so it should
>> not care if the OS running them would have an mmu at all.. it should be just
>> the task of the dynamic linker to relocate it properly, am I wrong?
> but the PIE code still has fixed offsets between its text and its
> data. so FDPIC ELF is even more flexible than a PIE ELF.
> -mike
Thank you very much!
As a student, understanding how things work is even more precious than
making things work ;)
You know? I was just trying to figure out today how the code could
locate the .got in x86 when relocation is needed..
I am studying ELF and relocation now, reading all possible material
online, but I did not find yet about the fixed offset!
PPC stands for PowerPC.
Now also your code is much clearer for me, though not useful in my case..
Thank you again!
Best regards!
Stefano B.
prev parent reply other threads:[~2011-01-24 22:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-09 8:48 [Qemu-devel] [RFC/PATCH] elfload: add FDPIC support Mike Frysinger
2011-01-09 18:20 ` Mike Frysinger
2011-01-23 19:51 ` [Qemu-devel] [PATCH] linux-user/FLAT: allow targets to override FLAT reloc processing Mike Frysinger
2011-01-23 19:54 ` Mike Frysinger
2011-01-23 19:51 ` [Qemu-devel] [PATCH v2] linux-user/elfload: add FDPIC support Mike Frysinger
2011-01-24 13:34 ` [Qemu-devel] Re: [RFC/PATCH] elfload: " Stefano Bonifazi
2011-01-24 19:11 ` Mike Frysinger
2011-01-24 21:06 ` Stefano Bonifazi
2011-01-24 21:27 ` Mike Frysinger
2011-01-24 22:07 ` Stefano Bonifazi [this message]
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=4D3DF805.4010004@gmail.com \
--to=stefboombastic@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=vapier@gentoo.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;
as well as URLs for NNTP newsgroup(s).