From: Simon Richter <Simon.Richter@hogyros.de>
To: binutils@sourceware.org
Subject: Re: Feature request: spare program headers
Date: Fri, 17 Nov 2023 17:08:47 +0900 [thread overview]
Message-ID: <765a162a-e44d-45c2-95d0-28c0ca47114f@hogyros.de> (raw)
In-Reply-To: <03e9069f821eb383d1391f0a7f8b70f6@gmail.com>
Hi,
On 11/17/23 12:23, Matheus Afonso Martins Moreira wrote:
> 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.
You can specify PHDRs in your linker script. For example,
PHDRS {
one 0;
two 0;
}
$ ld -o test.elf -x test.x
ld: warning: cannot find entry symbol _start; not setting start address
$ objdump -p test.elf
test.elf: file format elf64-x86-64
Program Header:
NULL off 0x0000000000000000 vaddr 0x0000000000000000 paddr
0x0000000000000000 align 2**3
filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
NULL off 0x0000000000000000 vaddr 0x0000000000000000 paddr
0x0000000000000000 align 2**3
filesz 0x0000000000000000 memsz 0x0000000000000000 flags ---
Simon
next prev parent reply other threads:[~2023-11-17 8:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-17 3:23 Matheus Afonso Martins Moreira
2023-11-17 8:08 ` Simon Richter [this message]
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=765a162a-e44d-45c2-95d0-28c0ca47114f@hogyros.de \
--to=simon.richter@hogyros.de \
--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).