[uClibc]BINFMT_FLAT bad magic, elf2flt 'input file contains no relocation info' m68k

Phil Wilshire philwil at earthlink.net
Mon Jan 13 22:44:05 UTC 2003


Brad Clements wrote:
> 
> (Summary)
> 
> 3 questions (see below)
> 
> 1. is the BINFMT problem caused by the executable not being in FLT format?
Yes

> 
> 2. elf2flt doesn't work, is that because i'm not using PIC?
you may need -msep-data as a compile option


> 
> 3. How do I get uClibc 0.9.16 to compile with PIC enabled for the m68k platform?
See 2

> 

Really close and almost a cigar

remind me again the compiler you are using please..

regards
  Phil Wilshire

> ---
> 
> (Details)
> 
> I'm on the home stretch.. I temporarily commented out the call to __libc_fork in ptfork.c
> 
> But, the generated static link (no PIC) python doesn't run, most likely because its not in
> flt format.
> 
> linking ends with:
> 
> c++  -Xlinker -export-dynamic -o python \
>                 Modules/python.o \
>                 libpython2.3.a -lpthread -lutil   -lm
> 
> which produces a python, when I try to run it (via nfs) on my 5727 board:
> 
>  # ./python
>       BINFMT_FLAT: bad magic/rev (0x1020100, need 0x4)
>       BINFMT_FLAT: bad magic/rev (0x1020100, need 0x4)
>       .ELF...: not found
>       #
> 
> Indeed,
> 
> od -txa python | head -n2
> 0000000 464c457f 00010201 00000000 00000000
>         del   E   L   F soh stx soh nul nul nul nul nul nul nul nul nul
> 
> I expect BFT here.
> 
> But:
> 
> [bkc at marimba m68k-python]$ /usr/local/bin/m68k-elf-elf2flt python
> python: Input file contains no relocation info
> 
> Argh..
> 
> --
> 
> Note that compiling with PIC enabled just fails miserably with lots of errors.
> 
> And, I still can't get make in the uClibc test directory to work.. (using the cross compile
> tools, is it supposed to work?)
> 
> --
> 
> trying to build uClibc for m68k with PIC enabled (I applied this patch
> http://www.uclibc.org/lists/uclibc/2002-August/006407.html)
> 
> I get reams of errors like this:
> 
> <snip>
> usershell.o(.text+0xd2): relocation truncated to fit: R_68K_PLT16 fgets
> libc.a(getopt.o)(.text+0x126): relocation truncated to fit: R_68K_PLT16 getenv
> libc.a(getopt.o): In function `_getopt_internal':
> getopt.o(.text+0x2a4): relocation truncated to fit: R_68K_PLT16 strcmp
> getopt.o(.text+0x3b4): relocation truncated to fit: R_68K_PLT16 strchr
> getopt.o(.text+0x44c): relocation truncated to fit: R_68K_PLT16 strncmp
> getopt.o(.text+0x45e): relocation truncated to fit: R_68K_PLT16 strlen
> getopt.o(.text+0x4ac): relocation truncated to fit: R_68K_PLT16 fprintf
> getopt.o(.text+0x4be): relocation truncated to fit: R_68K_PLT16 strlen
> getopt.o(.text+0x528): relocation truncated to fit: R_68K_PLT16 fprintf
> getopt.o(.text+0x558): relocation truncated to fit: R_68K_PLT16 fprintf
> getopt.o(.text+0x56a): relocation truncated to fit: R_68K_PLT16 strlen
> getopt.o(.text+0x5c8): relocation truncated to fit: R_68K_PLT16 fprintf
> getopt.o(.text+0x5da): relocation truncated to fit: R_68K_PLT16 strlen
> getopt.o(.text+0x60a): relocation truncated to fit: R_68K_PLT16 strlen
> getopt.o(.text+0x66c): relocation truncated to fit: R_68K_PLT16 strchr
> getopt.o(.text+0x6b4): relocation truncated to fit: R_68K_PLT16 fprintf
> getopt.o(.text+0x6e6): relocation truncated to fit: R_68K_PLT16 fprintf
> getopt.o(.text+0x72a): relocation truncated to fit: R_68K_PLT16 strchr
> getopt.o(.text+0x76a): relocation truncated to fit: R_68K_PLT16 fprintf
> getopt.o(.text+0x7ec): relocation truncated to fit: R_68K_PLT16 fprintf
> libc.a(getopt.o): In function `getopt':
> getopt.o(.text+0x846): relocation truncated to fit: R_68K_PLT16 _getopt_internal
> libc.a(getopt.o): In function `getopt_long':
> getopt.o(.text+0x868): relocation truncated to fit: R_68K_PLT16 _getopt_internal
> libc.a(getopt.o): In function `getopt_long_only':
> getopt.o(.text+0x88c): relocation truncated to fit: R_68K_PLT16 _getopt_internal
> libc.a(getsubopt.o): In function `getsubopt':
> getsubopt.o(.text+0x24): relocation truncated to fit: R_68K_PLT16 __strchrnul
> getsubopt.o(.text+0x38): relocation truncated to fit: R_68K_PLT16 memchr
> getsubopt.o(.text+0x58): relocation truncated to fit: R_68K_PLT16 memcmp
> <snip>
> 
> --
> Brad Clements,                bkc at murkworks.com   (315)268-1000
> http://www.murkworks.com                          (315)268-9812 Fax
> http://www.wecanstopspam.org/                   AOL-IM: BKClements
> 
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://uclibc.org/mailman/listinfo/uclibc

-- 
SDCS -- System Design & Consulting Services LLC, http://www.sysdcs.com
** Embedded Linux Training **  email me for details  
630 Springhouse Sq., Leesburg VA 20175 t: 703 669 9766 f: 703 669 9768



More information about the uClibc mailing list