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: question about pic and relocation


"Eric Fisher" <joefoxreal@gmail.com> writes:
> $ mips-elf-gcc -shared -fpic fun.c -o fun.so -save-temps
>
> We can see this below from fun.s,
> lw      $2,%gp_rel(b)($28)
>
> I think symble 'b' should be of GOT relocation.
> But it isn't.

What platform are you targetting?

mips-elf does not support shared libraries out of the box.
You can compile individual PIC objects using "mips-elf-gcc -mabicalls"
(which implies "-fpic", you don't need to add "-fpic" as well).  However,
the libraries built by mips-elf configurations, such as libgcc, are not
PIC, so you won't be able to link PIC code against them.  You should
really use a target that creates PIC by default, in the same way as
mips-linux-gnu and mips-sgi-irix* do.

Richard


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