Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 1996 10:42:34 -0400 (EDT)
From:      Chuck Robey <chuckr@Glue.umd.edu>
To:        FreeBSD Current <FreeBSD-Current@freebsd.org>
Subject:   Re: dynamic linking
Message-ID:  <Pine.OSF.3.91.960513104034.2591D-100000@ginger.eng.umd.edu>
In-Reply-To: <Pine.OSF.3.91.960513004455.7203B-100000@thurston.eng.umd.edu>

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

I put this on ports, but I had it suggested to me that current was a better 
forum, since I wasn't getting any response from ports.

> 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?
> 
> Thanks.
> 
> #include <stdio.h>
> #include <dlfcn.h>
> 
> void main( int argc, char *argv[] )
> {
> 	int err_ret;
> 	void *pntr;
> 
> 	if( argc != 2 )
> 	{
> 		printf("%s: incorrect number of parameters.\n",argv[0]);
> 		printf("\tInvoke as: %s <object file to open>\n",argv[0]);
> 		exit(0);
> 	}
> 	printf("testing file %s ... ", argv[1]);
> 	pntr = dlopen( argv[1], 1 );
> 	printf("dlopen call returned pointer value %lx\n", pntr );
> 	printf("dlerror call returns %s\n", dlerror() );
> 	if( pntr )
> 	{
> 		err_ret = dlclose( pntr );
> 		printf("since open was successful, dlclose returns %d\n",
> 			err_ret );
> 		printf("and subsequent dlerror call returns %s\n",dlerror());
> 	}
> 	exit(0);
> }
> 
> 
> ==========================================================================
> 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.
> 
> 
> 

==========================================================================
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.960513104034.2591D-100000>