named and SUNOS 4.1
Adrian P. van Bloois
adrian at accucx.cc.ruu.nl
Thu Dec 20 02:46:46 AEST 1990
This is a procedure you can use to substitute or add
a module in your shared libc C library.
Note! If you are interested in a System V libc, please substitute
libc_pic.a for libcs5_pic.a in step 3,
libc.so.x.y.z for libcs5.so.x.y.z in step 8.
-------------------------------------------------------------------------
1. Become super user
% su
2. Make a temporary directory
# mkdir tmp
3. Change to the "tmp" directory just made, extract the pic .o from
libc_pic.a and rm the file __.SYMDEF. The reason you need to do
the 2 (or 3) "mv" commands is because "ar" truncated filenames over
16 characters.
# cd tmp
# ar x ../libc_pic.a
# rm __.SYMDEF
# mv rpc_dtablesize. rpc_dtablesize.o
# mv rpc_commondata. rpc_commondata.o
If on a Sun-4, perform this additional `mv' command:
# mv xccs_multibyte. xccs_multibyte.o
Here are some extra instructions for building a shared libc.so that uses the
resolver for hostname/addr resolution:
3a. Extract the contents of libc_pic.a and /usr/lib/libresolv.a into the
tmp directory:
# ar x /usr/lib/libresolv.a
The libresolv.a contains object modules that are position independant, so
they can be added to the libc_pic modules.
*Note* If you have your own copy of the resolver library sources,
(perhaps from a post-4.8 BIND distribution) you can compile each of these
modules yourself using `cc -pic' and the resulting object modules *should*
be usable in this schema as well. To test that the custom resolver
modules will be usable, cd to the directory containing the custom resolver
sources and object modules and perform this test:
# ld -assert pure-text *.o
If `ld' issues no complaints, then you can assume that the object modules
are safe to use.
3b. Remove the old routine to do the hostname/addr resolution:
# rm gethostent.o
3c. Remove the libresolv module that contains `strncasecmp' (which is now
in the main C library, so it is redundant):
# rm strcasecmp.o
3d. As mentioned in step 5 below, edit the file `lorder-sparc' in the ..
directory. Remove the reference to `gethostent.o' and add the
references to the resolver library routines by applying this patch:
*** lorder-sparc.orig Thu Feb 8 05:27:46 1990
--- lorder-sparc Mon Apr 9 12:58:59 1990
***************
*** 150,154 ****
getwd.o
getnetgrent.o
! gethostent.o
ypxdr.o
ttyname.o
--- 150,161 ----
getwd.o
getnetgrent.o
! gethostnamadr.o
! sethostent.o
! res_query.o
! res_mkquery.o
! res_send.o
! res_debug.o
! res_comp.o
! res_init.o
ypxdr.o
ttyname.o
3e. Continue on, from steps 6 to 9 (i.e., skip steps 4 and 5 immediately below).
------------------------------------------------------------------------------
4. Replace or add the .o that you wanted by doing a copy. Please
note here that you are advised to create your object with
the following compiler option, i.e "cc -c -pic yourprogram.c" to make
it shareable.
# cp your.o .
5. If you add a new module then you need to do this step.
You need to edit the file "lorder-sparc" and add the name of the file
you have copied from step 4 at the end of this file.
# vi ../lorder-sparc
6. # cd ..
7. # make libc.so
8. Now you should have some libc.so.x.y.z built in the current directory.
It is recommended that you tested out this library at this point
before installing it. You can do so by setting the environment
LD_LIBRARY_PATH to the current directory for example:
# setenv LD_LIBRARY_PATH `pwd`
# your_favorite_test_cmd
Once you are satisfied that the new library worked, you can proceed
to install it with the following commands:
# cp libc.so.x.y.z /usr/lib
# ldconfig
# unsetenv LD_LIBRARY_PATH
9. You are now running with the new library. You can verify this by
doing a trace command of let's say "date".
# trace date
The output should informed you that the new library is being used.
More information about the Comp.unix.admin
mailing list