RFC: Add GNU_PROPERTY_NEED_PHDRS

Cary Coutant ccoutant@gmail.com
Thu Oct 4 15:10:00 GMT 2018


> If you specify PHDRS in a script, ld uses exactly those program
> headers, and I believe it should continue to operate that way.  So to
> add PT_GNU_EH_FRAME, say, when an executable has .eh_frame_hdr, you'd
> need a script with PT_GNU_EH_FRAME specified in PHDRS.  And another
> without PT_GNU_EH_FRAME when the executable doesn't have
> .eh_frame_hdr.  That soon becomes impractial considering the number of
> optional headers, requiring auto-generation of the PHDRS script
> snippet.

Oh, I see. Yeah, that does make it impractical.

Still, I'd like to understand why HJ claims it's intrusive to have ld
create a PT_LOAD segment for the headers. I haven't tried it yet in
gold (don't support -z separate-code), but it doesn't seem like it
would be at all difficult or intrusive.

-cary



More information about the Binutils mailing list