Re: [PATCH v4] gas: add --reloc-section-sym={all, internal, none} option for ELF
Project / Subsystem
binutils / gas
Date
2026-07-02
Proposer
Alan Modra <amodra@gmail.com>
Source type
public_inbox
Consensus
Proposed
Sentiment
—/10
Technical tradeoffs
- • The default behavior allows for smaller executables by omitting redundant local symbols.
- • The new option provides flexibility for debugging and tool compatibility by preserving local symbol information when needed.
All attributes
- project
- binutils
- subsystem
- gas
- patch_id
- —
- discussion_id
- akXTxPKQ5CouTpe6@squeak.grove.modra.org
- source_type
- public_inbox
- title
- Re: [PATCH v4] gas: add --reloc-section-sym={all, internal, none} option for ELF
- headline
- gas: add --reloc-section-sym={all, internal, none} option for ELF
- tldr
- Adds an option to control GAS's conversion of local symbols to section symbols for ELF relocations.
- proposer
- Alan Modra <amodra@gmail.com>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- —
- technical_tradeoffs
-
- • The default behavior allows for smaller executables by omitting redundant local symbols.
- • The new option provides flexibility for debugging and tool compatibility by preserving local symbol information when needed.
- series_id
- —
- series_role
- standalone
- series_parts
- []
- tags
-
- • binutils
- • GAS
- • ELF
- • symbols
- • relocations
- bugzilla_url
- —
- date
- 2026-07-02T00:00:00.000Z
Re: [PATCH v4] gas: add --reloc-section-sym={all, internal, none} option for ELF
Alan Modra acknowledges a patch that introduces the --reloc-section-sym option to GAS. This option controls whether eligible local symbols are converted to STT_SECTION symbols for ELF relocations. The conversion is performed to omit local symbols from .symtab when multiple local symbols reference the same section, saving space. The new option allows control over this behavior, with all (default), internal (only compiler-generated locals), and none (never convert) settings, which is beneficial for debugging and tools that rely on preserved symbol names.