This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Document __foo symbol variants and their uses in the library sources.


On Mon 14 Apr 2014 03:36:57 Carlos O'Donell wrote:
> In response to some questions on libc-help here is a
> first attempt at documenting some of the conventions
> behind calling the double-underscore versions of the
> public API functions from within the library (to avoid
> the PLT indirect and maintain internal consistency).
> 
> https://sourceware.org/glibc/wiki/Style_and_Conventions#Double-underscore_na
> mes_for_public_API_functions
> 
> I would appreciate any review.

one point made is to try and make static linking sane.  but i'm not sure how 
that is possible when the majority of the __xxx funcs are simply aliases to 
xxx in the same object.  when you statically link, the C lib will pull in the 
__xxx since it gets used which also pulls in the xxx definition.  if the app 
already defines xxx (since it's not in the standard they've selected), they 
run into linking issues.

only way around it would be for the public xxx symbol to be marked weak.  a 
cursory scan of my current libc.so shows that is how most are declared, but 
not all.  should we enshrine this as part of the policy ?
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]