[Bug gas/33885] gas: Add an option to disable section symbol adjustment

2026-07-05 Thread sam at gentoo dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=33885

Sam James  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 CC||sam at gentoo dot org
   Target Milestone|--- |2.47
 Status|NEW |RESOLVED

--- Comment #3 from Sam James  ---
Fixed for 2.47.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/33885] gas: Add an option to disable section symbol adjustment

2026-07-05 Thread cvs-commit at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=33885

--- Comment #2 from Sourceware Commits  ---
The master branch has been updated by Fangrui Song :

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=eec25cabd2d004cfc2a9898b1ec93cbdef2fcd77

commit eec25cabd2d004cfc2a9898b1ec93cbdef2fcd77
Author: Fangrui Song 
Date:   Sun Feb 8 11:56:49 2026 -0800

gas: add --reloc-section-sym={all,internal,none} option for ELF

When generating relocations for non-ifunc local symbols that satisfies
several conditions, GAS converts them to reference the section symbol
(STT_SECTION) instead, folding the original symbol's offset into the
addend.  This allows the original local symbol to be omitted from
.symtab, but the STT_SECTION symbol itself must be present, so the
conversion saves .symtab entries only when a section has more than one
local symbol referenced by relocations.

Add --reloc-section-sym to control this conversion:

- all (default): convert all eligible local symbols
- internal: only convert compiler-generated locals (.L prefix)
- none: never convert; keep all symbols as-is in relocations

This is useful for debugging and for tools that benefit from preserved
symbol names.

PR gas/33885

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug gas/33885] gas: Add an option to disable section symbol adjustment

2026-02-08 Thread maskray at sourceware dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=33885

--- Comment #1 from Fangrui Song  ---
Added the write-up to
https://maskray.me/blog/2025-03-16-relocation-generation-in-assemblers#section-symbol-adjustment

Candidate option name: --adjust-reloc-syms={none,nonlocal,all}

* all: adjust all eligible relocations to reference STT_SECTION
* nonlocal: adjust eligible relocations that reference a non-local symbol
* none: don't adjust relocations

-- 
You are receiving this mail because:
You are on the CC list for the bug.