[PATCH 2/2] aarch64: Add workaround for GDB bug handling string literals

Yury Khrustalev yury.khrustalev@arm.com
Wed Jul 1 08:39:05 GMT 2026


On Tue, Jun 30, 2026 at 01:15:04PM -0300, Adhemerval Zanella Netto wrote:
> 
> On 30/06/26 12:29, Yury Khrustalev wrote:
> > On Tue, Jun 30, 2026 at 12:17:37PM -0300, Adhemerval Zanella Netto wrote:
> >>
> >> On 30/06/26 11:15, Wilco Dijkstra wrote:
> >>> Hi,
> >>>
> >>>> I don't like it either, but I don't see a better alternative to keep some
> >>>> compatibility with old gdb.
> >>>>
> >>>> But I also think this approach is fragile: it require some assumptions on how
> >>>> gdb implements this and adds some magic number.� I think a better alternative
> >>>> is invert the assumption: the only exactly legitimate caller of an IFUNC
> >>>> resolver is the the dynamic loader's relocation machinery
> >>>> (elf_ifunc_invoke / _dl_fixup):
> >>>
> >>> On AArch64 we can just check for !(arg0 & IFUNC_ARG_HWCAP) since we always
> >>> invoke ifuncs with that bit set from GLIBC (obviously the value is way too large to
> >>> ever be a valid allocation). You could also check arg0 == GLRO (dl_hwcap) for other
> >>> targets.
> > 
> > Yes, we should do this, I'll make a patch.
> 
> I think if we want to add this workaround, doing in a platform neutral is better
> than adding arch-specific knobs.

You probably missed second part of my reply. The idea is not to provide
a work-around for the problem in GDB. The idea is to fail early with a
clear error message when resolver is called incorrectly.

The patch series at the start of this thread *is* "arch-specific knobs".

Also, we're talking about code under sysdeps/aarch64 so I don't see
anything wrong with it being arch-specific.

As machine maintainer for AArch64 I'm against the Florian's patch and I
think the right way ahead is to implement Wilco's suggestion.

Thanks,
Yury



More information about the Libc-alpha mailing list