From: ebiederm@xmission.com (Eric W. Biederman)
To: Vivek Goyal <vgoyal@redhat.com>
Cc: Kexec Mailing List <kexec@lists.infradead.org>
Subject: Re: Query regarding ELF loader arg style
Date: Fri, 17 Jan 2014 10:03:10 -0800 [thread overview]
Message-ID: <87zjmubi5d.fsf@xmission.com> (raw)
In-Reply-To: <20140117140347.GB24394@redhat.com> (Vivek Goyal's message of "Fri, 17 Jan 2014 09:03:47 -0500")
Vivek Goyal <vgoyal@redhat.com> writes:
> On Thu, Jan 16, 2014 at 03:27:13PM -0800, Eric W. Biederman wrote:
>
> [..]
>> > - ELF does not tell anything whether it is self relocating or not. So we
>> > are forced to load it at a address it has been compiled for (In case of
>> > kdump). And that address is already occupied by current running kernel
>> > so it does not work.
>>
>> ELF does tell you if it is relocatable in the e_type field of the main
>> elf header. In particular ET_DYN vs ET_EXEC. ET_DYN can be loaded
>> anywhere, and ET_EXEC must be loaded at the specified address. It would
>> not surprise me if the kernel build process is using ET_EXEC in error.
>>
>> ET_DYN is also what is used for PIE executables and shared libraires.
>>
>> The rule with ET_DYN without a dynamic linker is that a constant offset
>> must be added to the load address of all of the program segments but
>> otherwise nothing changes. I thought I had support for that form in
>> kexec-tools.
>>
>> Perhaps not.
>
> Hi Eric,
>
> Kexec-tools supports ET_DYN. I saw code for that. Current kernel vmlinux
> is ET_EXEC though and expects to be loaded at the address for it has been
> compiled for.
>
> I think in intial version of patches I will just support ET_EXEC and then
> support for ET_DYN can be added later. It should really be simple as all
> the core structure to find a memory hole and load buffers there will
> already be present. And at that time one can look into converting vmlinux
> to a ET_DYN instead of ET_EXEC.
Sounds good.
Eric
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
prev parent reply other threads:[~2014-01-17 18:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-09 15:37 Query regarding ELF loader arg style Vivek Goyal
2014-01-15 1:42 ` Eric W. Biederman
2014-01-16 15:13 ` Vivek Goyal
2014-01-16 23:27 ` Eric W. Biederman
2014-01-17 14:03 ` Vivek Goyal
2014-01-17 18:03 ` Eric W. Biederman [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=87zjmubi5d.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=kexec@lists.infradead.org \
--cc=vgoyal@redhat.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