This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add reallocarray function.
* Dennis Wölfing:
> But another question occurred to me: Should __libc_reallocarray be
> listed in malloc/Versions and the abilist files?
It has to be listed under GLIBC_PRIVATE because otherwise, code
outside of libc.so proper (such as nss_nis) would not be able to call
it. Separate programs such as nscd can directly call reallocarray.
> I would guess no because this name should only be used internally,
> but most other memory allocation functions do have their __libc_
> prefixed name listed as part of the public abi.
That's more or less a historical accident. The dynamic linker used
memalign internally, but calling it under this name would result in a
namespace violation, so it uses __libc_memalign instead. This symbol
was made part of the public ABI so that external mallocs can interpose
it (although interposition would have worked just fine for a
GLIBC_PRIVATE symbol, too). I assume some of the other __libc_*
aliases were just added for consistency. Today, this is just historic
cruft, which we could replace with compat symbols.