Trying to cross compile with uClibc, no sucess!

Thierry Reding thierry.reding at avionic-design.de
Fri May 7 06:04:24 UTC 2010


* Takaite Takehara wrote:
>    Tks, Thierry for your help.
> 
>    I made it and got it:
>    Elf file type is EXEC (Executable file)
>    Entry point 0x8048374
>    There are 6 program headers, starting at offset 52
> 
>    Program Headers:
>      Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
>      PHDR           0x000034 0x08048034 0x08048034 0x000c0 0x000c0 R E 0x4
>      INTERP         0x0000f4 0x080480f4 0x080480f4 0x00014 0x00014 R   0x1
>          [Requesting program interpreter: /lib/ld-uClibc.so.0]
>      LOAD           0x000000 0x08048000 0x08048000 0x00554 0x00554 R E 0x1000
>      LOAD           0x000554 0x08049554 0x08049554 0x000f4 0x00114 RW  0x1000
>      DYNAMIC        0x000568 0x08049568 0x08049568 0x000b8 0x000b8 RW  0x4
>      GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4
> 
>     Section to Segment mapping:
>      Segment Sections...
>       00    
>       01     .interp
>       02     .interp .hash .dynsym .dynstr .gnu.version .gnu.version_r
>    .rel.plt .init .plt .text .fini .rodata .eh_frame
>       03     .ctors .dtors .jcr .dynamic .got.plt .data .bss
>       04     .dynamic
>       05    
> 
>    Then I copied the files inside my toolchain to the place requested then I
>    got this error:
> 
>    can't handle reloc type 0xe in lib '/lib/libc.so.6'
> 
>    Can you help me one more time?

This looks like another problem with your setup. It seems like the linker is
using the interpreter from uClibc correctly but then links against libc from
the GNU C library. You can check which libc it links against by running
"objdump -p" on the binary. You will need to play with the linker flags some
more to get the correct C library. Also I seem to remember a certain
"-muclibc" option that you can pass to gcc when linking. Perhaps that will
help.

>    One question: Where do I change the path of the program interpreter?

You can change it when linking the binary. ld has the "--dynamic-linker=file"
option that you can use to change it. When linking with gcc you can use
"-Wl,--dynamic-linker=file".

> 
>    Best Regards
>    Taka

Cheers,
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20100507/01f38814/attachment.pgp>


More information about the uClibc mailing list