public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* libc_hidden & weak_alias mechanism in vfork/clone/..
@ 2018-05-30 23:32 Waldemar Brodkorb
  2018-05-31  3:40 ` Carlos O'Donell
  0 siblings, 1 reply; 3+ messages in thread
From: Waldemar Brodkorb @ 2018-05-30 23:32 UTC (permalink / raw)
  To: libc-help

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

best regards
 Waldemar

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libc_hidden & weak_alias mechanism in vfork/clone/..
  2018-05-30 23:32 libc_hidden & weak_alias mechanism in vfork/clone/ Waldemar Brodkorb
@ 2018-05-31  3:40 ` Carlos O'Donell
  2018-06-01 18:01   ` Waldemar Brodkorb
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos O'Donell @ 2018-05-31  3:40 UTC (permalink / raw)
  To: Waldemar Brodkorb, libc-help

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

Cheers,
Carlos.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: libc_hidden & weak_alias mechanism in vfork/clone/..
  2018-05-31  3:40 ` Carlos O'Donell
@ 2018-06-01 18:01   ` Waldemar Brodkorb
  0 siblings, 0 replies; 3+ messages in thread
From: Waldemar Brodkorb @ 2018-06-01 18:01 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: Waldemar Brodkorb, libc-help

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-01 18:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30 23:32 libc_hidden & weak_alias mechanism in vfork/clone/ Waldemar Brodkorb
2018-05-31  3:40 ` Carlos O'Donell
2018-06-01 18:01   ` Waldemar Brodkorb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).