Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Mar 2003 15:13:26 -0800
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Arun Sharma <arun.sharma@intel.com>
Cc:        freebsd-ia64@FreeBSD.ORG, FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   Re: ia64/49081: @gprel relocation against dynamic symbol in /usr/lib/libobjc.a
Message-ID:  <20030310231326.GA1156@athlon.pn.xcllnt.net>
In-Reply-To: <uadg2suje.fsf@unix-os.sc.intel.com>
References:  <200303102150.h2ALo7Pl050754@freefall.freebsd.org> <uadg2suje.fsf@unix-os.sc.intel.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 10, 2003 at 02:53:25PM -0800, Arun Sharma wrote:
> Marcel Moolenaar <marcel@xcllnt.net> writes:
> 
> >  >  Linking bundle SSL ...
> >  > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_alloc
> >  > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_copy
> >  > /usr/bin/ld: /usr/lib/libobjc.a(objects.o): @gprel relocation against dynamic symbol _objc_object_dispose
> 
> It seems to be by design:
> 
> # pwd
> /usr/src/gnu/lib/libobjc
> # grep NOPIC Makefile
> NOPIC=  works but method lookup slowdown is significant
> 

Yes, hence my question. We cannot easily change this without affecting
other platforms (assuming for a moment we're not going to create an
ia64 specific kludge -- not gratuitously that is). At this time the
port is broken for all platforms, because of the fundamental flaw of
linking in non-PIC code in a shared library. The fact that it happens
to work on some architectures does not mean it's not broken. So, either
we change the way we build libobjc.a, or we provide a libobjc_pic.a
just like we do for libc.a, or we create a libobjc.so. For the last two
cases the port has to be changed. For the first case it pessimizes the
library (performance-wise) for the complete (or fully archive) programs.

I think the best solution is to build libobjc.a with -fpic.

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel@xcllnt.net

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ia64" in the body of the message




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