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


On Thu, Feb 23, 2006 at 01:33:05PM +0800, Eric Fisher wrote:
> $ 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.
> 
> $ mips-elf-readelf -r fun.so

There are no GOT relocations in shared libraries.  They're resolved by
the linker.

> I have no idea about the error and the symble 'b' of pic codes.
> Yet, when use this below
> $ mips-elf-as fun.s -call_shared -o fun.so
> 
> $ mips-elf-readelf -r fun.so

That's not a shared object, no matter what you call it.  You have to
assemble and then link; please let GCC do the linking, it knows how
to invoke the linker properly for each platform.

-- 
Daniel Jacobowitz
CodeSourcery


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