All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Anatol Pomozov <anatol.pomozov@gmail.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>,
	qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Alexander Graf <agraf@suse.de>, Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] How to make ELF headers/symbol sections available for multiboot?
Date: Wed, 2 Aug 2017 15:45:24 -0700	[thread overview]
Message-ID: <3270e67a-7ebc-6e2e-daeb-bb434dcd781b@twiddle.net> (raw)
In-Reply-To: <CAOMFOmVN74ghnqWGyfxHB_LqcSLC8XzRkrk88VXaPh4JRvYRNQ@mail.gmail.com>

On 08/02/2017 03:00 PM, Anatol Pomozov wrote:
> What ELF specification says about it? Does it tell a loader to load
> only PT_LOAD segments?

Yes.  In https://refspecs.linuxfoundation.org/ there is a link to "System V ABI
Edition 4.1", which AFAIK is the latest version of the ELF "gABI" spec.
Section 5 describes program loading.

> Here is my current linker script:
> 
> ======================
> ENTRY(start)
> 
> SECTIONS {
>     . = 1M;
> 
>     .text : {
>         KEEP(*(.data.multiboot))
>         *(.text .text*)
>     }
> 
>     .rodata : {
>         *(.rodata .rodata*)
>     }
> 
>     .data : {
>         *(.data .data.*)
>     }
> 
>     .bss : {
>         __bss_start = .;
>         *(.bss .bss*)
>         . = ALIGN(8);
>         __bss_end = .;
>     }
> }
> =======================

In the gnu ld manual, read about the PHDRS command, which describes all of the
ways you can manipulate the program header table.

Re-reading that now, I see FILEHDR and PHDR as keywords that can be used to
induce those portions of the file into the loadable segment, but I do not see
anything that could be used to load the section header.

You could force the symbol table and string table to be loaded, by referencing
their sections, but that won't affect the section header itself.


r~

  reply	other threads:[~2017-08-02 22:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-28 21:28 [Qemu-devel] How to make ELF headers/symbol sections available for multiboot? Anatol Pomozov
2017-07-30 21:42 ` Eduardo Habkost
2017-07-31  6:25   ` Alexander Graf
2017-07-31 11:27   ` Kevin Wolf
2017-07-31 17:21   ` Anatol Pomozov
2017-07-31 18:20     ` Richard Henderson
2017-08-02 22:00       ` Anatol Pomozov
2017-08-02 22:45         ` Richard Henderson [this message]
2017-08-03  8:39         ` Kevin Wolf
2017-08-04  4:53           ` Anatol Pomozov
2017-08-08 15:04             ` Kevin Wolf
2017-08-17 20:54               ` Anatol Pomozov
2017-09-11 18:48                 ` Anatol Pomozov
2017-09-11 18:49                 ` Anatol Pomozov
2017-08-01 14:06     ` Kevin Wolf
2017-07-31  8:50 ` Peter Maydell
2017-07-31 13:04   ` Richard Henderson

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=3270e67a-7ebc-6e2e-daeb-bb434dcd781b@twiddle.net \
    --to=rth@twiddle.net \
    --cc=agraf@suse.de \
    --cc=anatol.pomozov@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.