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: [PATCH] Define secure_getenv (v2)


> Oh, will fix.  Is this about static linking?

Today in practice in most cases it only makes a difference for static
linking.  That's only because of our arcane PLT avoidance techniques.
It's still not the case for references between shared libraries, like
a libc function called by libm or librt, etc.

> The existing sources do not follow this rule in all cases, so I assumed 
> it was expendable.

The actual rule is more subtle than this.  So it may be that what
you've observed are cases that are actually kosher.  If not, then
those are bugs and we'd appreciate your reporting (or fixing!) any
such cases you noticed.

The subtlety is that there is actually a whole collection of
different standards with their own name space constraints that we
support, and each standard incorporates some of the other standards
but not all of them.  So, anything can call C89 functions like memcpy
and printf (and there are no __ names for those at all).  But the
implementation of a C89 function like printf cannot call a function
not in C89, such as read (so it calls __read instead).  The
implementation of any POSIX.1 function can call other POSIX.1
functions, so readdir can call read (though my tendency is always to
use the internal names like __read instead); but the implementation
of a POSIX.1 function cannot call a function not in POSIX.1 or C89.
And so on.


Thanks,
Roland


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