qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] How to make ELF headers/symbol sections available for m


From: Richard Henderson
Subject: Re: [Qemu-devel] How to make ELF headers/symbol sections available for multiboot?
Date: Wed, 2 Aug 2017 15:45:24 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

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 via email to

[Prev in Thread] Current Thread [Next in Thread]