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

Brad Clements bkc at murkworks.com
Mon Jan 13 23:33:04 UTC 2003


On 13 Jan 2003 at 17:44, Phil Wilshire wrote:

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

ahh.

> Really close and almost a cigar
> 
> remind me again the compiler you are using please..

[bkc at marimba m68k-python]$ gcc -v
Invoked as gcc
arg[ 0] = /usr/local/bin/m68k-elf-gcc
arg[ 1] = -v
Reading specs from /usr/local/lib/gcc-lib/m68k-elf/2.95.3/specs
gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(-msep-data patches)


1. I added -msep-data to extra/Config/Config.m68k ARCH_CFLAGS, then rebuild 
uClibc with PIC enabled, and I still got "relocation truncated to fit" errors.

2. rebuild without PIC, but leave -msep-data in there.

3. edit Python makefile to add -elf2flt to LDFLAGS and -msep-data to CFLAGS

gcc -c  -DNDEBUG -g -O3 -Wall -Wstrict-prototypes  -msep-data -I. -I/usr/local/src/python-cvs/python/dist/src/Include  -DPy_BUILD_CORE -o Objects/typeobject.o /usr/local/src/python-cvs/python/dist/src/Objects/typeobject.c
In file included from /usr/local/src/python-cvs/python/dist/src/Include/Python.h:39,
                 from /usr/local/src/python-cvs/python/dist/src/Objects/typeobject.c:3:
/var/local/src/m68k-linux-uclibc/include/unistd.h:247: warning: empty declaration
In file included from /usr/local/src/python-cvs/python/dist/src/Include/Python.h:48,
                 from /usr/local/src/python-cvs/python/dist/src/Objects/typeobject.c:3:
/usr/local/src/python-cvs/python/dist/src/Include/pyport.h:360: warning: `struct winsize' declared inside parameter list
/usr/local/src/python-cvs/python/dist/src/Include/pyport.h:360: warning: its scope is only this definition or declaration, which is probably not what you want.
/usr/local/src/python-cvs/python/dist/src/Include/pyport.h:361: warning: `struct winsize' declared inside parameter list
/tmp/cc0403Pk.s: Assembler messages:
/tmp/cc0403Pk.s:30347: Error: value out of range
/tmp/cc0403Pk.s:30442: Error: value out of range
/tmp/cc0403Pk.s:30468: Error: value out of range
/tmp/cc0403Pk.s:30496: Error: value out of range
/tmp/cc0403Pk.s:30533: Error: value out of range
/tmp/cc0403Pk.s:30547: Error: value out of range
/tmp/cc0403Pk.s:30622: Error: value out of range
/tmp/cc0403Pk.s:30637: Error: value out of range
/tmp/cc0403Pk.s:30699: Error: value out of range
/tmp/cc0403Pk.s:30725: Error: value out of range
/tmp/cc0403Pk.s:30751: Error: value out of range
/tmp/cc0403Pk.s:30788: Error: value out of range
/tmp/cc0403Pk.s:30802: Error: value out of range
/tmp/cc0403Pk.s:30893: Error: value out of range
/tmp/cc0403Pk.s:30933: Error: value out of range
/tmp/cc0403Pk.s:30957: Error: value out of range
/tmp/cc0403Pk.s:30981: Error: value out of range
/tmp/cc0403Pk.s:31005: Error: value out of range
/tmp/cc0403Pk.s:31029: Error: value out of range
/tmp/cc0403Pk.s:31053: Error: value out of range
/tmp/cc0403Pk.s:31077: Error: value out of range

<snip>

I suppose this is due to -msep-data

4. remove -msep-data from python make file and make again

ranlib libpython2.3.a
c++ -elf2flt -Xlinker -export-dynamic -o python \
                Modules/python.o \
                libpython2.3.a -lpthread -lutil   -lm  
/var/local/src/m68k-linux-uclibc/lib: file not recognized: Is a directory
collect2: ld returned 1 exit status

this is why I started playing around with hand elf2flt..

5. ld -elf2flt -o python Modules/python.o libpython2.3.a -lpthread -lutil -lm -lc

produces:

usr/local/src/python-cvs/python/dist/src/Python/structmember.c:164: relocation truncated to fit: R_68K_PLT16 __rpc_thread_variables
/usr/local/src/python-cvs/python/dist/src/Python/structmember.c:164: relocation truncated to fit: R_68K_PLT16 __rpc_thread_variables
/usr/local/src/python-cvs/python/dist/src/Python/structmember.c:164: relocation truncated to fit: R_68K_PLT16 sprintf
/usr/local/src/python-cvs/python/dist/src/Python/structmember.c:164: relocation truncated to fit: R_68K_PLT16 strcpy
/usr/local/src/python-cvs/python/dist/src/Python/structmember.c:164: relocation truncated to fit: R_68K_PLT16 strlen
/usr/local/src/python-cvs/python/dist/src/Python/structmember.c:164: relocation truncated to fit: R_68K_PLT16 sprintf
/usr/local/src/python-cvs/python/dist/src/Python/structmember.c:164: relocation truncated to fit: R_68K_PLT16 strcpy
/usr/local/src/python-cvs/python/dist/src/Python/structmember.c:164: relocation truncated to fit: R_68K_PLT16 strlen
/usr/local/src/python-cvs/python/dist/src/Python/structmember.c:164: relocation truncated to fit: R_68K_PLT16 strcpy
/usr/local/src/python-cvs/python/dist/src/Python/structmember.c:164: relocation truncated to fit: R_68K_PLT16 strlen

<snip>

Perhaps this is due to NOT having -msep-data

6. also tried David's suggestion:

cc -Wl -elf2flt -o python Modules/python.o libpython2.3.a -lpthread -lutil -lm -lc 
/var/local/src/m68k-linux-uclibc/lib: file not recognized: Is a directory
collect2: ld returned 1 exit status


strange..

Clearly I'm missing a clue here.

A while back I was able to compile the user/python dist for emulation under xcopilot, 
now that I have real hardware I can't get anywhere.



-- 
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