[PATCH 0/1] Revert "malloc: aarch64: Add ifuncs for malloc functions"
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Fri Jul 3 14:41:27 GMT 2026
Hi HJ,
> I have been calling IFUNC functions, like strcmp, in GDB for a long time.
> There is no issue, other than GDB can't figure out its return type. I
> have to cast the return value to int:
>
> (gdb) cond 1 (int) strcmp (name, "foo") == 0
There are several bugs here:
This calls the strcmp ifunc resolver if there is one. It can go wrong on targets
that have HWCAP2/3/4 since it only passes HWCAP. Doing this via the GOT or
dlsym() would get the correct address whether it is an ifunc or overridden.
It also calls malloc - that's the part that goes wrong if it is an ifunc. There is a
simple fix posted.
Another issue is whether GDB should ever call malloc (and creating a leak), thus
affecting the state of the application, making it harder to debug memory issues.
Cheers,
Wilco
More information about the Libc-alpha
mailing list