Re: [PATCH v3] gas: add --reloc-section-sym={all, internal, none} option for ELF

Project / Subsystem

binutils / binutils/gas

Date

2026-06-13

Proposer

Fangrui Song <i@maskray.me>

Source type

public_inbox

Consensus

Under Review

Sentiment

/10

Technical tradeoffs

  • Smaller symbol tables and object file sizes versus maintaining full symbol information for debugging and analysis tools.
  • Default behavior (all conversion) potentially obscuring local symbols versus an explicit choice by developers (internal/none).

All attributes

project
binutils
subsystem
binutils/gas
patch_id
discussion_id
CAN30aBG7V0wmurYvQqHOi2GOuyuit9shhdb6uX=GJgNMAbm1pg@mail.gmail.com
source_type
public_inbox
title
Re: [PATCH v3] gas: add --reloc-section-sym={all, internal, none} option for ELF
headline
Adds new option to GAS for controlling local symbol conversion to section symbols in relocations
tldr
A new `gas` option, `--reloc-section-sym`, controls how local symbols are converted to section symbols in relocations for ELF files, offering `all`, `internal`…
proposer
Fangrui Song <i@maskray.me>
consensus
Under Review
outcome
under_review
sentiment_score
technical_tradeoffs
  • Smaller symbol tables and object file sizes versus maintaining full symbol information for debugging and analysis tools.
  • Default behavior (all conversion) potentially obscuring local symbols versus an explicit choice by developers (internal/none).
series_id
series_role
standalone
series_parts
[]
tags
  • gas
  • elf
  • relocations
  • symbols
  • optimization
bugzilla_url
date
2026-06-13T00:00:00.000Z

Re: [PATCH v3] gas: add --reloc-section-sym={all, internal, none} option for ELF

Fangrui Song proposes a new command-line option, --reloc-section-sym, for the GNU Assembler (GAS) when building ELF files. This option provides fine-grained control over how GAS transforms local symbols into section symbols within relocation entries during assembly. Historically, GAS converts eligible local symbols to section symbols, potentially reducing the size of the symbol table. The new option offers three modes: all (the current default behavior), internal (only converting compiler-generated symbols), and none (disabling this conversion entirely), which is useful for debugging and tools that rely on preserved symbol names.