Subject: Re: Shared libraries
To: Ian Dall <ian@beware.dropbear.id.au>
From: Todd Vierling <tv@pobox.com>
List: tech-toolchain
Date: 07/01/1999 09:47:07
On Thu, 1 Jul 1999, Ian Dall wrote:
: > libgcc _is_ compiled -fpic.
:
: The error messages I get are like this:
:
: c++ -shared -o libreg.so.1.0 ./reg.o ./VerReg.o ./vr_stubs.o
:
: ld: /usr/lib/libgcc.a(_op_vdel.o): RRS text relocation at 0x73a4 for "___get_eh_context"
:
: I presume this is because libgcc.a was not compiled with -fpic.
Hrm. Thewn this is broken. libgcc.a should most certainly be -fpic, as
Cygnus compiles it that way.
: Also, it it really correct to compile all of libgcc.a with -fpic? If
: one compiles a statically liked executable and links with libgcc.a,
: then nothing will fill out the global offset table and whatever.
Actually, ld takes care of this; the GOT is filled in with absolute
addresses when linking PIC code to an executable statically. And in fact,
there's relatively few `callouts' from libgcc, making its GOT pretty small.
--
-- Todd Vierling (tv@pobox.com)