This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Problems about generating dynamic library using mipsisa32-elf target toolchain
- From: Daniel Jacobowitz <drow at false dot org>
- To: Jie Zhang <zhangjie at magima dot com dot cn>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 19 May 2004 10:39:44 -0400
- Subject: Re: Problems about generating dynamic library using mipsisa32-elf target toolchain
- References: <40AB3121.5000807@magima.com.cn>
On Wed, May 19, 2004 at 06:04:17PM +0800, Jie Zhang wrote:
> I have problems about generating dynamic library using mipsisa32-elf
> target toolchain, including gcc-3.3.3 and binutils-2.14.
>
> For the following simple code:
>
> /* t.c */
> extern void bar ()
>
> void foo ()
> {
> bar ();
> }
>
> > mipsisa32-elf-gcc -fpic -c t.c
>
> After this command, I get t.o.
>
> There is a relocation in its .text section:
>
> > mipsisa32-elf-readelf -r t.o
>
> Relocation section '.rel.text' at offset 0x378 contains 1 entries:
> Offset Info Type Sym.Value Sym. Name
> 0000000c 00000904 R_MIPS_26 00000000 bar
>
> But after link, there is no relocation in the dynamic library.
>
> > mipsisa32-elf-ld -shared -o t.so t.o
> > mipsisa32-elf-readelf -r t.so
>
> readelf: Error: Unable to read in 263192 bytes of dynamic segment
>
> There are no relocations in this file.
>
> Now I have two questions:
>
> 1. Why is there no relocation in the dynamic section? After all, there
> is an undefined symbol in it.
This is a peculiarity of the MIPS ABI. GOT relocations for the initial
GOT do not need explicit entries in .rel.dyn.
> 2. What is there an error when readelf t.so? What's wrong about it?
I have no idea. It souns like ld produced a corrupt binary.
--
Daniel Jacobowitz