This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Problems about generating dynamic library using mipsisa32-elf targettoolchain
- From: Jie Zhang <zhangjie at magima dot com dot cn>
- To: binutils at sources dot redhat dot com
- Date: Wed, 19 May 2004 18:04:17 +0800
- Subject: Problems about generating dynamic library using mipsisa32-elf targettoolchain
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.
2. What is there an error when readelf t.so? What's wrong about it?
Thanks!
Jie