Subject: Re: libgcc & PIC
To: Hubert Feyrer <>
From: Todd Vierling <>
List: tech-toolchain
Date: 04/29/1999 09:23:54
On Thu, 29 Apr 1999, Hubert Feyrer wrote:

: > No, it's a flaw in src/gnu/lib/libgcc/Makefile.
: > Egcs builds libgcc.a with -fpic.  We don't.  (And we probably should.)  :-P
: IC... is there a way to find out if a object file/library was compiled
: with -fpic?

Not particularly easily, but if you `objdump -r' on it, on most platforms
you will find reloc types with GOT and PLT in their names:  that's a good
indicator of PIC-compiled code.

You *can* link our gcc with shared objects; you'll just get RRS text
relocation warnings from ld and a higher startup overhead for the library
(in  However, if we compile libgcc -fpic, there's a small runtime
penalty for *lesser used* functions such as C++ exception handling, which
wouldn't be too bad.

-- Todd Vierling (Personal; Bus.