From: Vivek Goyal <vgoyal@redhat.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Kexec Mailing List <kexec@lists.infradead.org>
Subject: Re: Query regarding ELF loader arg style
Date: Fri, 17 Jan 2014 09:03:47 -0500 [thread overview]
Message-ID: <20140117140347.GB24394@redhat.com> (raw)
In-Reply-To: <87fvonwlri.fsf@xmission.com>
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.
Thanks
Vivek
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2014-01-17 14:04 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 [this message]
2014-01-17 18:03 ` Eric W. Biederman
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=20140117140347.GB24394@redhat.com \
--to=vgoyal@redhat.com \
--cc=ebiederm@xmission.com \
--cc=kexec@lists.infradead.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