[PATCH] elf: Set text-segment address to the maximum page size

Project / Subsystem

binutils / elf

Date

2026-05-28

Proposer

"H.J. Lu" <hjl.tools@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

/10

Technical tradeoffs

  • Forcing the text-segment address to the maximum page size might increase the size of the executable file due to padding.
  • This change could potentially break existing applications that rely on the text-segment being loaded at a lower address, although this is unlikely.

All attributes

project
binutils
subsystem
elf
patch_id
discussion_id
CAMe9rOrEcr3WJKqWWe=puY4wDR5drynCng5o=qmcw+GUS2+1XA@mail.gmail.com
source_type
public_inbox
title
[PATCH] elf: Set text-segment address to the maximum page size
headline
elf: Set text-segment address to the maximum page size
tldr
This patch sets the text-segment address to the maximum page size for ELF Position Dependent Executables (PDEs) when specified via command-line.
proposer
"H.J. Lu" <hjl.tools@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
technical_tradeoffs
  • Forcing the text-segment address to the maximum page size might increase the size of the executable file due to padding.
  • This change could potentially break existing applications that rely on the text-segment being loaded at a lower address, although this is unlikely.
series_id
series_role
standalone
series_parts
[]
tags
  • elf
  • linker
  • page size
  • pde
  • alignment
bugzilla_url
date
2026-05-28T00:00:00.000Z

[PATCH] elf: Set text-segment address to the maximum page size

This patch modifies the linker to ensure that the text-segment address of an ELF Position Dependent Executable (PDE) is set to the maximum page size when the -z max-page-size=SIZE option is used. If the default text-segment address is lower than the specified maximum page size, the linker will adjust it. This change is intended to address issue PR ld/34184 and includes a new test case and updates to the test suite.