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

Wilco Dijkstra Wilco.Dijkstra@arm.com
Wed Jul 1 11:00:20 GMT 2026


Hi Florian,

>> Also, we're talking about code under sysdeps/aarch64 so I don't see
>> anything wrong with it being arch-specific.
>
> The goal is to move all IFUNC-enabled architectures to malloc IFUNCs, so
> that the we can use specialized code for the __libc_initial case (main
> libc.so.6, not secondary namespace) that stores per-thread data directly
> in the TCB.

Or seamlessly add more checks or switch to a more performance optimized
malloc etc. There is no doubt ifuncs are useful in general.


However I think the question is whether it is possible to solve this in a target
independent way. The check I proposed triggers in valgrind too (looks like the
same bug as GDB). There are 2 cases that need fixing:

1. Application doesn't understand ifuncs and just calls an ifunc resolver assuming
    it is a normal function. Always wrong.

2. Application understands ifuncs and calls the resolver directly (likely passing
    only HWCAP, possibly selecting the wrong ifunc).

Could any check detect the difference between (1) and (2) or whether the right
HWCAP values are passed for each target?

Should we, given ifunc ABIs are target specific, disallow directly calling ifunc
resolvers in all cases?

Cheers,
Wilco


More information about the Libc-alpha mailing list