[PATCH] alpha: reallocate .got contents when relaxation grows a subsection

Project / Subsystem

binutils / alpha

Date

2026-08-14

Proposer

Matt Turner <mattst88@gmail.com>

Source type

public_inbox

Consensus

Proposed

Sentiment

—/10

Technical tradeoffs

  • • Ensuring memory safety and preventing crashes by reallocating GOT buffers vs. potential performance overhead of reallocation and assertions during relaxation.
  • • Correctly handling optimization flags like -O1 which enable relaxation by default.

All attributes

project
binutils
subsystem
alpha
patch_id
—
discussion_id
20260814202538.1039846-1-mattst88@gmail.com
source_type
public_inbox
title
[PATCH] alpha: reallocate .got contents when relaxation grows a subsection
headline
alpha: reallocate .got contents when relaxation grows a subsection
tldr
Fixes a bug where alpha GOT subsections can grow during relaxation, causing buffer overflows and crashes when not reallocated.
proposer
Matt Turner <mattst88@gmail.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Ensuring memory safety and preventing crashes by reallocating GOT buffers vs. potential performance overhead of reallocation and assertions during relaxation.
  • • Correctly handling optimization flags like -O1 which enable relaxation by default.
series_id
—
series_role
standalone
series_parts
[]
tags
  • • alpha
  • • linker
  • • optimization
  • • GOT
  • • security
bugzilla_url
—
date
2026-08-14T00:00:00.000Z

[PATCH] alpha: reallocate .got contents when relaxation grows a subsection

This patch addresses a critical bug in the Alpha linker where Global Offset Table (GOT) subsections can grow during relaxation, exceeding their initially allocated buffer size. This leads to buffer overflows, data corruption, and crashes, particularly when linking large C++ shared libraries with optimization flags. The fix involves reallocating the GOT subsection buffer if its recomputed size exceeds the allocated space during relaxation, and adding an assertion to detect and report overflows during relocation.