This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Abt -fpic, -fPIC Option


"Rohit Arul Raj" <rohitarulraj@gmail.com> writes:

> I have built a cross-compiler for m68k-elf with GCC 4.1.1.
> I need to know the difference in implementations of -fpic and -fPIC
> for this particular target.

-fpic uses a 16-bit offset when accessing the GOT.  -fPIC uses a
32-bit offset.  Thus -fpic may fail if you have more than 16K global
variables.  and -fPIC will fail on the 68000 (are there still 68000s
out there?).

On the 68000 only, -fPIC will use an lea/jmp sequence when calling a
function through the PLT.  -fpic will use a simple bra, which may fail
if the program text segment is more than 64K.  The 68020 and up always
use bra.l, which of course is not available on the 68000.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]