From owner-freebsd-hackers Mon Apr 26 12:21: 5 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from november.jaded.net (november.jaded.net [209.90.128.250]) by hub.freebsd.org (Postfix) with ESMTP id ED3D31535E for ; Mon, 26 Apr 1999 12:21:01 -0700 (PDT) (envelope-from dan@november.jaded.net) Received: (from dan@localhost) by november.jaded.net (8.9.3/8.9.3+trinsec_nospam) id PAA42818 for hackers@freebsd.org; Mon, 26 Apr 1999 15:25:26 -0400 (EDT) Date: Mon, 26 Apr 1999 15:25:26 -0400 From: Dan Moschuk To: hackers@freebsd.org Subject: Re: dlopen() and family? Message-ID: <19990426152526.B42727@trinsec.com> References: <19990426134633.A41603@trinsec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: ; from Alfred Perlstein on Mon, Apr 26, 1999 at 02:22:57PM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG | er, why did you not give us the complete commandline you used? I chopped out the names of the source files. I figured it would be pretty self-explanitory by providing only relevant parts of the command line. However, you're right, I was missing the -shared flag. Silly me. cc -shared -Wl,-export-dynamic -o foo.so foo.c does what its supposed to. Thanks! -Dan | On my system: | | .(16:01:12)(bright@thumper.reserved) | ~ % cc -aout -c | cc: No input files specified | .(16:01:17)(bright@thumper.reserved) | ~ % cc -Wl,-export-dynamic | /usr/lib/crt1.o: In function `_start': | /usr/lib/crt1.o(.text+0x6c): undefined reference to `main' | .(16:01:23)(bright@thumper.reserved) | ~ % cc -c | cc: No input files specified | | perhaps you missed the '-shared' flag? | | cc -shared -o blah.so.1 obj1.o obj2.o obj3.o | | you probably want to compiled the object files with: | | cc -c obj1.c -fpic -fPIC | | if you are compiling a program and want its local symbols visible | to dlsym(), you need the -export-dynamic flag. | | -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message