* Oscar Bonilla <[EMAIL PROTECTED]> [000310 15:19] wrote:
> 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/

I think you'll want LD_LIBRARY_PATH to be:
/home/obonilla/freebsd/nss/libc/:/usr/lib:/usr/local/lib

> $ 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...

please use the dynamic, it's a hell of a lot easier.

> 
> $ 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?

probably, but without a traceback it's going to be hard to find
out exactly what.

> 
> 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?

Of course we are, please file a PR when you think it's pretty much
completed or email -hackers if you need/want advice. :)

-- 
-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to