Feature request: spare program headers

Matheus Afonso Martins Moreira matheus.a.m.moreira@gmail.com
Fri Nov 17 03:23:43 GMT 2023


Hello. I recently emailed this list about appending PHDRs to programs:

https://sourceware.org/pipermail/binutils/2023-November/130532.html

There turned out to be a simple and effective solution to my problem:
the linker appends a number of empty PT_NULL entries to the PHDRs table.
This allows post processing tools to overwrite those null headers
in any way they want without impacting normal linker operations.

The mold linker has already integrated this feature.
I'd like to formally request that it be included in GNU ld as well.
I have also filed an LLVM lld issue but there was no interest so far.

Relevant links:

mold
https://github.com/rui314/mold/issues/1148
https://github.com/rui314/mold/commit/eb6c213f2a9aa8a101b2b52a791be369d165e6a9


More information about the Binutils mailing list