Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 1996 14:27:48 -0400 (EDT)
From:      Chuck Robey <chuckr@Glue.umd.edu>
To:        Gary Palmer <gpalmer@FreeBSD.ORG>
Cc:        FreeBSD Ports <FreeBSD-Ports@FreeBSD.ORG>
Subject:   Re: dynamic linking 
Message-ID:  <Pine.OSF.3.91.960513142648.3531K-100000@ginger.eng.umd.edu>
In-Reply-To: <14528.832010080@palmer.demon.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 13 May 1996, Gary Palmer wrote:

> Chuck Robey wrote in message ID
> <Pine.OSF.3.91.960513004455.7203B-100000@thurston.eng.umd.edu>:
> > One more time, in case you missed it.  If I don't get an answer this 
> > time, I'll stop bugging you.  I am working on getting the tcl code to 
> > dynamically load modules, and to do that I'm trying to understand the 
> > dlopen/dlsym calls.  I wrote a very simple program to test it, which just 
> > takes a file from the command line and dloads it.  To use a file I knew 
> > was in correct format, I used one from libc, but I always get this kind 
> > of error:
> > 
> > ./dltests /usr/obj/lib/libc/rmdir.so
> > testing file /usr/obj/lib/libc/rmdir.so ... dlopen call returned pointer 
> > value 0
> > dlerror call returns mmap failed for "/usr/obj/lib/libc/rmdir.so" : 
> > Invalid argument
> > 
> > OK, below is the code I wrote to test it.  Anyone got any idea why it's 
> > failing?
> 
> My first guess would be that you aren't using a linked shared library,
> but rather the component of one. Try using dlopen() on something like
> /usr/lib/libncurses.so.2.0 and see if that works (after checking that
> I got the filename right :-) ) I have an example program here which
> (worst case) dlopen()s about, umm, 7 or 8 libraries before it does
> ANYTHING else, so I know that it works :-)

Oh, I thought that dlopen (and kin) were supposed to operate on the 
object files that went into a library, not the library itself.  Thanks 
for the pointer, I'll start testing now.

> 
> Gary
> --
> Gary Palmer                                            FreeBSD Core Team Member
> FreeBSD - Turning PC's into workstations. See http://www.FreeBSD.ORG/ for info.
> 

==========================================================================
Chuck Robey chuckr@eng.umd.edu, I run FreeBSD-current on n3lxx + Journey2
 
Three Accounts for the Super-users in the sky,
  Seven for the Operators in their halls of fame,
Nine for Ordinary Users doomed to crie,
  One for the Illegal Cracker with his evil game
In the Domains of Internet where the data lie.
  One Account to rule them all, One Account to watch them,
  One Account to make them all and in the network bind them.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.3.91.960513142648.3531K-100000>