From owner-freebsd-ports Mon May 13 15:30:12 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id PAA01085 for ports-outgoing; Mon, 13 May 1996 15:30:12 -0700 (PDT) Received: from birk04.studby.uio.no (birk04.studby.uio.no [129.240.214.13]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id PAA01071 for ; Mon, 13 May 1996 15:30:09 -0700 (PDT) Received: (from aagero@localhost) by birk04.studby.uio.no (8.7.5/sendmail95) id AAA02514; Tue, 14 May 1996 00:30:01 +0200 (MET DST) Date: Tue, 14 May 1996 00:30:01 +0200 (MET DST) Message-Id: <199605132230.AAA02514@birk04.studby.uio.no> Mime-Version: 1.0 From: =?iso-8859-1?Q?=22=C5ge?= =?iso-8859-1?Q?R=F8bekk=22?= To: chuckr@Glue.umd.edu CC: FreeBSD-Ports@FreeBSD.ORG In-reply-to: (message from Chuck Robey on Mon, 13 May 1996 00:50:13 -0400 (EDT)) Subject: Re: dynamic linking Sender: owner-ports@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk [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 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