Problems about generating dynamic library using mipsisa32-elf target toolchain

Jie Zhang zhangjie@magima.com.cn
Wed May 19 10:04:00 GMT 2004


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



More information about the Binutils mailing list