Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 May 1996 00:30:01 +0200 (MET DST)
From:      =?iso-8859-1?Q?=22=C5ge?=  =?iso-8859-1?Q?R=F8bekk=22?=  <aagero@aage.priv.no>
To:        chuckr@Glue.umd.edu
Cc:        FreeBSD-Ports@FreeBSD.ORG
Subject:   Re: dynamic linking
Message-ID:  <199605132230.AAA02514@birk04.studby.uio.no>
In-Reply-To: <Pine.OSF.3.91.960513004455.7203B-100000@thurston.eng.umd.edu> (message from Chuck Robey on Mon, 13 May 1996 00:50:13 -0400 (EDT))

next in thread | previous in thread | raw e-mail | index | archive | help
[Chuck Robey]
| ./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

I was able to load a shared object by doing

$ gcc -c -fpic dlopen.c
$ ld -Bshareable dlopen.o -o dlopen.so
$ size dlopen.o
text    data    bss     dec     hex
528     0       0       528     210
$ size dlopen.so
text    data    bss     dec     hex
4096    4096    0       8192    2000
$ ./dlopen ./dlopen.so
<works>

The reason for failing in the other case is that the object is not
page-aligned, which -Bshareable sets up.  mmap() is given an offset
which is not a multiply of the pagesize.

-aage



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