From owner-freebsd-current Fri Nov 6 01:18:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA06739 for freebsd-current-outgoing; Fri, 6 Nov 1998 01:18:42 -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 BAA06730 for ; Fri, 6 Nov 1998 01:18:38 -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 TAA03849 for ; Fri, 6 Nov 1998 19:18:28 +1000 (EST) (envelope-from simon@oz.org) Date: Fri, 6 Nov 1998 19:18:28 +1000 (EST) From: Simon Coggins Reply-To: chaos@ultra.net.au To: current@FreeBSD.ORG Subject: dynamic libs on elf. 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 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