[ld] Allow custom sections to be under PT_GNU_RELRO

Cary Coutant ccoutant@gmail.com
Tue Apr 7 16:37:07 GMT 2020


> For that case, inventing new stuff DT_GNU_RELRO/DT_GNU_RELROSZ is not
> really meaningful. Rich Felker reminded me that this is about how
> segments are mapped/protected. PT_* (the current design) is more
> appropriate.

I disagree with this, but not strongly. I believe that the program
header table entries are for the kernel loader, and the more things we
add there for the dynamic loader means more spam that the kernel
loader has to sift through. Of course, PT_DYNAMIC is needed, but once
we have that, the dynamic loader can find everything else it needs in
the dynamic table. I think PT_xxx_UNWIND probably should have been a
pair of dynamic table entries, too (that might fit in with Rich's
logic).

If I were designing ELF from scratch, I'd be tempted to combine the
program header table and the dynamic table into one, perhaps
partitioning it so that kernel-significant entries all come first.

-cary


More information about the Binutils mailing list