Re: Text relocations in shared libs

"Valeriy E. Ushakov" <[email protected]> Tue, 27 Dec 2005 12:00:39 +0300
Newsgroups gmane.os.netbsd.devel.toolchain,gmane.os.netbsd.ports.sh3
Message-ID <[email protected]>
On Tue, Dec 27, 2005 at 08:51:33 +0000, Nick Hudson wrote:

> On Sunday 25 December 2005 13:02, Valeriy E. Ushakov wrote:
> [...]
> > The benefits of calling cerror via plt are not clear, b/c there's
> > little point in allowing cerror to be overridden, after all it's just
> > the error path factored out of all the syscalls.  I'm really inclined
> > to think that making cerror .protected or even .hidden is the right
> > thing to do.
> 
> Aren't there *lots* of symbols in libc that don't need to be
> exposed?  Why special case cerror and the others with text
> relocations in libc?

Well, ideally we should use version script to only export from libc.so
(and other shared libs) what's meant to be exported, but that's a
topic for another thread.

cerror is "special" in that it does not even have a defined interface,
except a private one between it and SYSCALL macros.  It's really just
a common error path factored out of syscall functions.  Pretending
that it is really exported and thus forthing all *jumps* (not even
calls) to it from the syscall functions go via PLT seems just
counterproductive.

SY, Uwe
-- 
[email protected]                         |       Zu Grunde kommen
http://snark.ptc.spbu.ru/~uwe/          |       Ist zu Grunde gehen