RFC: Add SHT_GNU_PHDRS
H.J. Lu
hjl.tools@gmail.com
Thu Sep 27 13:21:00 GMT 2018
More information about the Binutils mailing list
Thu Sep 27 13:21:00 GMT 2018
- Previous message (by thread): RFC: Add SHT_GNU_PHDRS
- Next message (by thread): RFC: Add SHT_GNU_PHDRS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Sep 27, 2018 at 6:07 AM, Carlos O'Donell <carlos@redhat.com> wrote: > On 9/27/18 8:57 AM, Florian Weimer wrote: >> * H. J. Lu: >> >>> On Thu, Sep 27, 2018 at 5:42 AM, Florian Weimer <fweimer@redhat.com> wrote: >>>> * H. J. Lu: >>>> >>>>> On Thu, Sep 27, 2018 at 3:35 AM, Szabolcs Nagy <nsz@port70.net> wrote: >>>>>> an alloc .phdr section covering the program headers solves >>>>>> this problem. if sections are not required for segments >>>>>> then simply the linker should ensure that there is always >>>>>> a load segment covering the program headers, possibly >>>>>> without containing any sections, however elf says >>>>>> "An object file segment contains one or more sections". >>>>>> >>>>>> i don't understand why a zero-size section is enough, what >>>>>> if phdr > pagesize? will that get covered by the load >>>>>> segment that is created for the zero-size section? >>>>> >>>>> Linker must keep this zero-size section in output and >>>>> create a PT_LOAD segment to cover it even if it is >>>>> the only SHF_ALLOC section in the PT_LOAD segment. >>>> >>>> Based on Szabolcs' comment, I don't think the section can be zero-sized. >>>> >>> >>> Why can't we put a zero-size section in a PT_LOAD segment? >>> Of course, we need to change linker to do it. >> >> I'm now under the impression that the bits that are PT_LOAD'ed all need >> to be covered by (allocated) sections. A zero-sized section doesn't >> cover anything, so it doesn't address this requirement of the ELF It depends on how we define it. I did experiment SHT_GNU_PHDRS to cover the whole program header. But other tools don't expect a section covering the program header. >> specification. > > I agree. What we did in the past by relying on phdrs to be accidentally > in the first PT_LOAD segment always irked me as bad design. > > If we need access to program header we need clear semantics for doing so, > not hackish kludges to force the linker to get it onto a page that also > happened to be mapped. This is just poor engineering on our part. > My current dummy program property note section sounds much better now :-). -- H.J.
- Previous message (by thread): RFC: Add SHT_GNU_PHDRS
- Next message (by thread): RFC: Add SHT_GNU_PHDRS
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list