From: David Beamonte (dbeamonte@intelnet.es)
Date: Fri Mar 16 2001 - 10:00:59 EST
I have a problem similar to yours. I do the following:
m68k-elf-gcc -msep-data -m68000 -O2 -c test_elf.c -o test_elf.o
m68k-elf-ld -v -r -Map mapa.map /home/opt2/uClibc_new/crt0.o test_elf.o -o test_elf.elf /home/opt2/uClibc_new/libc.a /usr/local/lib/gcc-lib/m68k-elf/2.95.2/libgcc.a
GNU ld version 2.10 (with BFD 2.10)
elf2flt -v test_elf.elf -o test_elf
TEXT -> vma=0 len=f5a
lma=0 clen=f5a oo=0 ap=2 fp=34
DATA -> vma=0 len=b0
lma=0 clen=b0 oo=0 ap=2 fp=fa4
ERROR: text=f5a overlaps data=0 ?
make: *** [test1] Error 1
or if I omit the -r directive i get:
m68k-elf-gcc -msep-data -m68000 -O2 -c test_elf.c -o test_elf.o
m68k-elf-ld -v -Map mapa.map /home/opt2/uClibc_new/crt0.o test_elf.o -o test_elf.elf /home/opt2/uClibc_new/libc.a /usr/local/lib/gcc-lib/m68k-elf/2.95.2/libgcc.a
GNU ld version 2.10 (with BFD 2.10)
elf2flt -v test_elf.elf -o test_elf
TEXT -> vma=80000074 len=f5a
lma=80000074 clen=f5a oo=0 ap=2 fp=74
DATA -> vma=80002fe4 len=b0
lma=80002fe4 clen=b0 oo=0 ap=2 fp=fe4
WARNING: data=80002fe4 does not directly follow text=f5a
BSS -> vma=800030b0 len=410
lma=800030b0 clen=410 oo=0 ap=4 fp=10b0
WARNING: bss=800030b0 does not directly follow text=80002fe4 + data=b0(80003094)
SECTION: .text [80cc1dc]: flags=233 vma=80000074
RELOCS: .text [80cc1dc]: flags=233 vma=80000074
SECTION: .rodata [80cc31c]: flags=253 vma=80000fce
SECTION: .data [80cc45c]: flags=243 vma=80002fe4
RELOCS: .data [80cc45c]: flags=243 vma=80002fe4
SECTION: .ctors [80cc59c]: flags=243 vma=80003094
SECTION: .dtors [80cc6dc]: flags=243 vma=80003098
SECTION: .got [80cc81c]: flags=243 vma=8000309c
SECTION: .bss [80cc95c]: flags=1 vma=800030b0
SECTION: .stab [80cca9c]: flags=10210 vma=0
SECTION: .stabstr [80ccd30]: flags=10210 vma=0
SECTION: .comment [80cce70]: flags=210 vma=0
No relocations in code!
SIZE: .text=0x80002fe4, .data=0x800030b0, .bss=0x0410
This generates a test_elf but when I execute it in the board I get this:
# test_elf
bFLT: not found
#
I guess I am not using the correct directives in the compiler or the linker.
David
-----Mensaje original-----
De: uclinux@jline.com [SMTP:uclinux@jline.com]
Enviado el: viernes, 16 de marzo de 2001 10:45
Para: uclinux-dev@uClinux.org
Asunto: Re: [uClinux-dev] M68k ELF tools update
hmm, i'm still missing something. my test program still doesn't run. i
checked out uClibc from cvs and used the 'build-m68k-elf.sh uclibc'
command to build the various combinations.
so far this is what i have below: compile, result files, and test runs
which don't show much. further below, if i let gcc locate libc.a, i
get booted to the monitor. neither of these results give me the
expected 'hello world'.
my next step will be to try and compile the latest uClibc using the
original m68k-pic-coff tools to make sure it's not something in libc.a
that is causing the problem. this is my first time diverging from the
original RPM's.
any help will be greatly appreciated!
jae
608 jchang@wbox:~/proj/uclinux/elf $ m68k-elf-gcc -msep-data -v -Wl,-elf2flt,-v -o test-elf test.c -L../uClibc/m68k-elf-lib/m68000/msep-data -lc
Reading specs from /usr/local/lib/gcc-lib/m68k-elf/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/usr/local/lib/gcc-lib/m68k-elf/2.95.2/cpp -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -Dmc68000 -D__embedded__ -D__mc68000__ -D__embedded__ -D__mc68000 -Asystem(embedded) -Amachine(mc68000) -D__HAVE_68881__ -Dmc68020 -D__mc68020 -D__mc68020__ -D__PIC__ -D__pic__ test.c /tmp/ccIXCbEt.i
GNU CPP version 2.95.2 19991024 (release) (68k, MIT syntax)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/lib/gcc-lib/m68k-elf/2.95.2/include
/usr/local/lib/gcc-lib/m68k-elf/2.95.2/../../../../m68k-elf/sys-include
/usr/local/lib/gcc-lib/m68k-elf/2.95.2/../../../../m68k-elf/include
End of search list.
The following default directories have been omitted from the search path:
/usr/local/lib/gcc-lib/m68k-elf/2.95.2/../../../../include/g++-3
End of omitted list.
/usr/local/lib/gcc-lib/m68k-elf/2.95.2/cc1 /tmp/ccIXCbEt.i -quiet -dumpbase test.c -msep-data -version -o /tmp/ccaonDEi.s
GNU C version 2.95.2 19991024 (release) (m68k-elf) compiled by GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).
/usr/local/m68k-elf/bin/as -mc68020 -o /tmp/ccaUHwui.o /tmp/ccaonDEi.s
/usr/local/lib/gcc-lib/m68k-elf/2.95.2/collect2 -o test-elf /usr/local/m68k-elf/lib/crt0.o -L../uClibc/m68k-elf-lib/m68000/msep-data -L/usr/local/lib/gcc-lib/m68k-elf/2.95.2 -L/usr/local/m68k-elf/lib -elf2flt -v /tmp/ccaUHwui.o -lc -lgcc -lgcc
collect2 version 2.95.2 19991024 (release) (68k, MIT syntax)
/usr/local/m68k-elf/bin/ld -o test-elf /usr/local/m68k-elf/lib/crt0.o -L../uClibc/m68k-elf-lib/m68000/msep-data -L/usr/local/lib/gcc-lib/m68k-elf/2.95.2 -L/usr/local/m68k-elf/lib -elf2flt -v /tmp/ccaUHwui.o -lc -lgcc -lgcc
GNU ld version 2.10 (with BFD 2.10)
609 jchang@wbox:~/proj/uclinux/elf $ ls -l
-rwxr--r-- 1 jchang jchang 4548 Mar 16 01:26 test-elf
-rw-r--r-- 1 jchang jchang 194574 Mar 16 01:25 test-elf.elf
-rwxr-xr-x 1 jchang jchang 80716 Mar 16 01:26 test-elf.gdb
# ./test-elf
# ./test-elf
# test-elf
#
610 jchang@wbox:~/proj/uclinux/elf $ m68k-elf-gcc -msep-data -v -elf2flt,-v -o test-elf test.c -lc
# ./test-elf
privilege violation
PC[0000000b] SSP[000b8ff8] USP[000af4ec] BootstrapSP[0001ff6e]
D0 D1 D2 D3 D4 D5 D6 D7
00000000 000b47e0 007d03dc 007d0370 007d0370 000ae018 00000000 00000001
A0 A1 A2 A3 A4 A5 A6
0000002e 007d03c0 000b47eb 000b4028 10c9439d 000ae018 000af4f0
B$
finally, if my test program just calls "putchar('a');" i get this
result:
# ./test-elf
address error
PC[00000108] SSP[007d7ff0] USP[007d14bc] BootstrapSP[0001fe4e]
D0 D1 D2 D3 D4 D5 D6 D7
000000c1 000ac7e0 0009037c 00090310 00090310 007d0018 00000000 00000001
A0 A1 A2 A3 A4 A5 A6
00000072 00090360 000ac7eb 000ac028 10c9439d 007d0018 007d14c0
B$
This message resent by the uclinux-dev@uclinux.org list server http://www.uClinux.org/
This archive was generated by hypermail 2.1.4 : Thu Sep 19 2002 - 13:19:34 EDT