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

Brad Clements bkc at murkworks.com
Mon Jan 13 22:41:01 UTC 2003


(Summary)


3 questions (see below)

1. is the BINFMT problem caused by the executable not being in FLT format?

2. elf2flt doesn't work, is that because i'm not using PIC?

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

---

(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




More information about the uClibc mailing list