Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!bywater!arnor!arnor!marc From: marc@watson.ibm.com (Marc Auslander) Newsgroups: comp.unix.aix Subject: Re: rebuilding the shared libc Message-ID: Date: 7 Jun 91 13:19:46 GMT References: <676126057.15477@minster.york.ac.uk> Sender: news@watson.ibm.com (NNTP News Poster) Organization: IBM T.J. Watson Research Center, Hawthorne, New York Lines: 36 In-Reply-To: forsyth@minster.york.ac.uk's message of 5 Jun 91 12:47:37 GMT Nntp-Posting-Host: marc You need a file called libc.exp. But its not shipped! So you have to hack one. Extract the old shr.o from libc.a. Then dump -n shr.o. The output is a list of all the imported and/or exported symbols for the object. In general, you need to reduce this to a list of exported symbols. The IMEX field is supposed to tell you this, but its coding is apparently funny. It should correspond to the l_smtype field in /usr/include/loader.h, but the bits appear scrambled. BUT, for libc.a[shr.o] all the symbols are in fact exported, so just take them all. Then, to replace a program, for example malloc.o, do: ld malloc.o shr.o -o newshr.o -bE:libc.exp -bI:/lib/syscalls.exp and put the new shr.o (named shr.o) into libc.a. You can test the new libc.a first by setting LIBPATH=mydir:/lib:/usr/lib where mydir contains the new libc.a and running stuff. If that looks good, you can (as root) mount mydir/libc.a /lib/libc.a which will override all subsequent uses in the system until you reboot or unmount. To replace libc.a, you should, as root: cp mydir/libc.a /lib/newlibc.a cp -p /lib/libc.a /lib/libc.a.orig (only do this once) mv /lib/newlibc.a /lib/libc.a mv is atomic, so you don't risk winding up with no libc.a at all. If the new libc.a breaks the system, you will have to boot from diskette to fix it! -- Marc Auslander (IBM) (Internet)