This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: libc_hidden & weak_alias mechanism in vfork/clone/..
- From: Waldemar Brodkorb <mail at waldemar-brodkorb dot de>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: Waldemar Brodkorb <mail at waldemar-brodkorb dot de>, libc-help at sourceware dot org
- Date: Fri, 1 Jun 2018 20:01:27 +0200
- Subject: Re: libc_hidden & weak_alias mechanism in vfork/clone/..
- References: <20180530233015.GW2438@waldemar-brodkorb.de> <979ad2e4-78f7-9329-745b-611fd3bbcb82@redhat.com>
- Reply-to: Waldemar Brodkorb <mail at waldemar-brodkorb dot de>
Hi Carlos,
Carlos O'Donell wrote,
> On 05/30/2018 07:30 PM, Waldemar Brodkorb wrote:
> > Hello glibc hackers,
> >
> > I would like to understand why GNU C Library is using a lot of weak
> > aliases for C library functions like vfork or clone.
> >
> > What is the reason for it?
> >
> > Or in this case the assembly function name is __libc_vfork and
> > __vfork and vfork is somehow involved.
> > https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/riscv/vfork.S;h=6c53e93a928d736be73161954fd83bdb0672fd4f;hb=HEAD
>
> Does this answer your question?
>
> https://sourceware.org/glibc/wiki/Style_and_Conventions#Double-underscore_names_for_public_API_functions
Thanks, mostly.
Does this mean that in vfork.S all two conventions are used in
combination to avoid namespace pollution and gather better
performance by avoiding internal function calls via PLT?
There are three symbols involved:
__libc_vfork()
__vfork()
vfork()
best regards
Waldemar