public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
To: binutils@sourceware.org
Subject: Feature request: spare program headers
Date: Fri, 17 Nov 2023 00:23:43 -0300	[thread overview]
Message-ID: <03e9069f821eb383d1391f0a7f8b70f6@gmail.com> (raw)

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

             reply	other threads:[~2023-11-17  3:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17  3:23 Matheus Afonso Martins Moreira [this message]
2023-11-17  8:08 ` Simon Richter
2023-11-18  0:18   ` Matheus Afonso Martins Moreira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03e9069f821eb383d1391f0a7f8b70f6@gmail.com \
    --to=matheus.a.m.moreira@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).