Date: Fri, 10 Mar 2000 16:44:28 -0600 From: Oscar Bonilla <obonilla@fisicc-ufm.edu> To: Kris Kennaway <kris@hub.freebsd.org> Cc: Alfred Perlstein <bright@wintelcom.net>, Oscar Bonilla <obonilla@fisicc-ufm.edu>, freebsd-hackers@FreeBSD.ORG Subject: Re: inner workings of the C compiler Message-ID: <20000310164428.A89006@fisicc-ufm.edu> In-Reply-To: <Pine.BSF.4.21.0003091719340.82270-100000@hub.freebsd.org> References: <20000308163057.W14279@fw.wintelcom.net> <Pine.BSF.4.21.0003091719340.82270-100000@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 09, 2000 at 05:20:31PM -0800, Kris Kennaway wrote: > On Wed, 8 Mar 2000, Alfred Perlstein wrote: > > > I'm pretty sure this can be done a hell of a lot easier by using shared > > libraries and using the enviornment variables LD_LIBRARY_PATH and > > LD_PRELOAD, see the rtld manpage for more help. > > Yes, I've done this when trying to track down buffer overflows in > libc..stick them in their own directory and use LD_LIBRARY_PATH, which > tells the dynamic linker where to search. > $ echo $LD_LIBRARY_PATH/ /home/obonilla/freebsd/nss/libc/ $ echo $LD_PRELOAD /home/obonilla/freebsd/nss/libc/libc.so.4 $ make cc -g -DYP -DFreeBSD -Wall -pedantic -ansi -o nss-test -I../../libc/include nss-test.c /tmp/ccy93427.o: In function `main': /home/obonilla/freebsd/nss/tests/libc/nss-test.c(.text+0xb0): undefined reference to `nsdispatch' *** Error code 1 Stop in /usr/home/obonilla/freebsd/nss/tests/libc. $ at this point I switch makefiles to use static building and... $ make cc -g -DYP -DFreeBSD -Wall -pedantic -ansi -c -I../../libc/include nss-test.c cc -g -nostdlib -static -L../../libc -o nss-test nss-test.o ../../csu/i386-elf/crt1.o ../../csu/i386-elf/crti.o -lc $ but when I run the binary... $ ./nss-test files called files called retval = 1 NS_SUCCESS Bus error (core dumped) $ am I doing something wrong? BTW... I've ported the Name Service Switch from NetBSD to FreeBSD and it's working on my laptop right now. However, I need some help moving all the get*by* functions in the C library to use the new nsdispatch function, especially for the NIS code... who should I talk to... anyone interested on seeing some patches? regards, -oscar -- pgp public key: finger obonilla@fisicc-ufm.edu pgp fingerprint: 6D 18 8C 90 4C DF F0 4B DF 35 1F 69 A1 33 C7 BC To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000310164428.A89006>