RFC: Add SHT_GNU_PHDRS
Cary Coutant
ccoutant@gmail.com
Thu Sep 27 22:35:00 GMT 2018
> > 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
> > 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.
It seems to me that the kernel loader should make the program headers
available to the dynamic loader through the aux vector, whether
they're part of a PT_LOAD segment or not. That should be part of the
psABI. The gABI clearly requires that the dynamic loader has access to
the program headers (e.g., it needs to find PT_DYNAMIC), but it
doesn't care how the implementation accomplishes that.
-cary
More information about the Binutils
mailing list