Date: Fri, 6 Nov 1998 19:40:13 +1000 (EST) From: Simon Coggins <simon@oz.org> To: current@FreeBSD.ORG Subject: Re: dynamic libs on elf. Message-ID: <Pine.BSF.4.05.9811061939450.3928-100000@chaotic.oz.org> In-Reply-To: <Pine.BSF.4.05.9811061911410.3815-100000@chaotic.oz.org>
next in thread | previous in thread | raw e-mail | index | archive | help
For the record I just found out what it is. gcc -rdynamic fixes this. Sorry for wasting bandwidth. On Fri, 6 Nov 1998, Simon Coggins wrote: > > Hi, > > Well I finally got my system changed from aout to elf and now I notice that > dynamic libs are handled totaly differently on ELF and have broken all of my > dynamic lib'ed programs. Here's what it's doing differently now and > hopefully someone can tell me how to fix it. > > When loading a dynamic lib with RTLD_NOW, it always fails if the module > calls a function that is in the main progran that is loading the module. Now > this use to work on aout but now it won't work anymore. > > There is some example code at the end of this message which is the code I'm > using. > > [simon@chaotic]:/tmp/p> gcc -o dynamic dynamic.c > [simon@chaotic]:/tmp/p> gcc -c -DMOD dynamic.c > [simon@chaotic]:/tmp/p> ld -Bshareable dynamic.o -o dynamic.so > [simon@chaotic]:/tmp/p> ./dynamic > dlopen(): ./dynamic.so: Undefined symbol "print_data" > > So when loading the module it couldn't find the function print_data which is > in the main program. > > HELP! :) > > Regards > Simon > > --- > +---------------------------------------------------------------+ > | Email: chaos@ultra.net.au, chaos@oz.org, simon@bofh.com.au | > | http://www.ultra.net.au/~chaos Simon.Coggins@jcu.edu.au. | > | Chaos on IRC, IRC Operator for the OzORG Network | > +---------------------------------------------------------------+ > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message > Regards Simon --- +---------------------------------------------------------------+ | Email: chaos@ultra.net.au, chaos@oz.org, simon@bofh.com.au | | http://www.ultra.net.au/~chaos Simon.Coggins@jcu.edu.au. | | Chaos on IRC, IRC Operator for the OzORG Network | +---------------------------------------------------------------+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9811061939450.3928-100000>