Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Apr 1999 15:25:26 -0400
From:      Dan Moschuk <dan@trinsec.com>
To:        hackers@freebsd.org
Subject:   Re: dlopen() and family?
Message-ID:  <19990426152526.B42727@trinsec.com>
In-Reply-To: <Pine.BSF.3.96.990426141757.2095w-100000@cygnus.rush.net>; from Alfred Perlstein on Mon, Apr 26, 1999 at 02:22:57PM -0500
References:  <19990426134633.A41603@trinsec.com> <Pine.BSF.3.96.990426141757.2095w-100000@cygnus.rush.net>

next in thread | previous in thread | raw e-mail | index | archive | help

| 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990426152526.B42727>