From owner-freebsd-current Fri Nov 6 01:40:29 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA08607 for freebsd-current-outgoing; Fri, 6 Nov 1998 01:40:29 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from chaotic.oz.org (chaotic.oz.org [203.20.237.203]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA08602 for ; Fri, 6 Nov 1998 01:40:20 -0800 (PST) (envelope-from simon@oz.org) Received: from localhost (localhost [127.0.0.1]) by chaotic.oz.org (8.9.1/8.8.8) with ESMTP id TAA03945 for ; Fri, 6 Nov 1998 19:40:13 +1000 (EST) (envelope-from simon@oz.org) Date: Fri, 6 Nov 1998 19:40:13 +1000 (EST) From: Simon Coggins Reply-To: chaos@ultra.net.au To: current@FreeBSD.ORG Subject: Re: dynamic libs on elf. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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