position independent code on MIPS

Paul Kohout pkohout@evitechnology.com
Mon Jan 16 20:29:00 GMT 2006

I see. So the -mabicalls is the only way to get the code position

So what would a dynamic linker have to do differently using "-mabicalls
-fpic -G 0" versus "-membedded-pic"? I assume that there would be some
processing of relocation tables. Is this documented somewhere?

Thanks again,

>>> Ian Lance Taylor <ian@airs.com> 01/16/06 2:51 PM >>>
"Paul Kohout" <pkohout@evitechnology.com> writes:

> How do I generate position independent code using a gcc v4.0.2
> cross-compiler targeted for the mips-elf platform?
> In the past, I have used the -membedded-pic option with gcc v3.3.1,
> this seems to have been deprecated in v4.0.2. I tried using the
> option, but it does not seem to create any dynamic relocation table
> entries for the .text section, just for data sections. Also, I've
> using the -mabicalls option, but I can't get it to work either.

It normally works to use -mabicalls -fpic -G 0.

But note that this is not the same as -membedded-pic.


More information about the Gcc-help mailing list