[PATCH 0/7] bfd: local IFUNC symbols referenced only from non-alloc sections

Jan Beulich jbeulich@suse.com
Fri Nov 13 12:39:33 GMT 2026


On 13.11.2026 13:36, Harshit Kumar wrote:
>> I have some doubt that x86 and the others that have followed x86 are
>> correct regarding not applying relocs in debug sections.  Debug
>> sections certainly should not generate dynamic relocations, but why
>> would you not apply the reloc to the debug section?
> 
> I could not find a reason either.  PR ld/18808 was an abort () on such a
> relocation; the first fix (97dc35c88d) used "break", and the same day
> 0eace2105d changed it to "continue", without saying why skipping is
> the right outcome.  The series only copied that.
> 
> It also gives wrong debug info.  With a global IFUNC "ifn" at 0x10001,
> "ld -e _start -Ttext=0x10000" leaves ".quad ifn" in .debug_info as 0
> on x86-64, while the same reference in a non-alloc note gets 0x10001.
> On i386 ".long ifn+4" stays 4.  arm, ppc32, ppc64, alpha, arc, csky,
> hppa, s390 and LoongArch already apply the reloc there, with the
> resolver address.
> 
> So I'd apply it the way the SHT_NOTE case does, as against an STT_FUNC
> symbol.  If you and Jan agree, v2 would do that for debugging
> sections, for global and local symbols alike, on x86, AArch64, RISC-V
> and SPARC.

Sgtm, fwiw.

Jan


More information about the Binutils mailing list