SUMMARY: How to change SOLARIS libc

From: Matthew Donaldson (matthew@cs.adelaide.edu.au)
Date: Tue Aug 22 1995 - 22:10:31 CDT


Hi all. A while ago I asked:

> For obscure reasons (like making netgroups work with files rather
> than NIS - grrrr why doesn't Sun EVER fix this?) I need to change the libc
> under Solaris 2.4. I know this is easy under SunOS, so on the Solaris box
> I go for the shlib.etc directory to find it is not there!
>
> I realise that most people do not need to change the libc anymore, but does
> anyone know how it might be done - either by getting hold of the modules that
> make it up (as per SunOS) or by linking in new .o files to replace selected
> functions?

Well, I got quite a good number of answers. The winning entry on how to change
libc came from Casper Dik <casper@Holland.Sun.COM>, who said:

> Look in /usr/lib/pics. There are all the objects needed for libc.so.
>
> The right order of linking isn't given. (but can be reversed from libc.so)
>
> Also link as:
> cc -dy -G <objects> -o libc.so.1 -h libc.so.1 -ldl
>
> link with "cc", not "ld".

The winner for telling me how to get netgroups working from files was
Chris Phillips <chris@otter.cs.yorku.ca> who referred me to John DiMarco
(jdd@cdf.utoronto.ca). It would appear that Sun have implemented the front
end for netgroups properly, but have just not got around to producing a back
end that gets from from files. John DiMarco has written a shared library which
does this, so the libc does not have to be changed for this purpose. Copies
of his package can be obtained by mailing him, or from ftp.cs.adelaide.edu.au
in /pub/net.sh.Z.

Also, Dave Mitchell <D.Mitchell@dcs.shef.ac.uk> mentioned the use of the
LD_PRELOAD environment variable, which specifies .o files which are loaded
after your program but before any libraries.

Many thanks to all who replied:

"Chris Phillips" <chris@otter.cs.yorku.ca>
chane@comm.mot.com (Ernie Chan)
Ian MacPhedran <macphed@dvinci.usask.ca>
Leif Hedstrom <leif@infoseek.com>
chane@comm.mot.com (Ernie Chan)
sweh@mpn.com (Stephen Harris)
Todd Pfaff <todd@water.Eng.McMaster.CA>
Andy_Feldt@phyast.nhn.uoknor.edu (Andy Feldt)
Dave Mitchell <D.Mitchell@dcs.shef.ac.uk>
Casper Dik <casper@Holland.Sun.COM>

                -Matthew

+--------------------------------------------------------------------------+
| Matthew Donaldson Email: matthew@cs.adelaide.edu.au |
| Computer Science Department Phone: +61 8 303 5583 _ |
| University of Adelaide Fax: +61 8 303 4366 John / \/ |
| South Australia 5005 Telex: UNIVAD AA89141 3:16 \_/\ |
+--------------------------------------------------------------------------+



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:32 CDT