This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
[ECOS] arm-elf-ld problems
- To: Ecos Discuss <ecos-discuss@sourceware.cygnus.com>
- Subject: [ECOS] arm-elf-ld problems
- From: Dan Hovang <dh@ctech.ideon.se>
- Date: Thu, 20 May 1999 17:20:06 +0200
- Organization: CTechnologies
Hi all,
I'm trying to make eCos 1.2.1 run on our StrongARM-based platform. It
compiles fine when compiling to ELF but when trying to make a binary
image I get failed assertions in arm-elf-ld:
------------------------------------------------
bash-2.02$ arm-elf-gcc -I../include -L. -Ttarget.ld -nostdlib
-Wl,--oformat=binary -Wl,-t main.c
main.c: In function `main':
main.c:4: warning: initialization makes pointer from integer without a
cast
main.c:2: warning: return type of `main' is not `int'
/c/cygnus/ecosSWtools-arm-990321/H-i586-cygwin32/arm-elf/bin/ld: mode
armelf
vectors.o
C:\TEMP/ccub0Ql4.o
extras.o
(libtarget.a)infra_startup.o
(libtarget.a)infra_prestart.o
[..snip..]
(libtarget.a)infra_memcpy.o
(libtarget.a)infra_memset.o
(libtarget.a)libc_errno.o
(c:\cygnus\ecosSWtools-arm-990321\H-i586-cygwin32\bin/../lib/gcc-lib/arm-elf/2.9-ecosSWtools-arm-990321/libgcc.a)_ctors.o
(c:\cygnus\ecosSWtools-arm-990321\H-i586-cygwin32\bin/../lib/gcc-lib/arm-elf/2.9-ecosSWtools-arm-990321/libgcc.a)_divsi3.o
(c:\cygnus\ecosSWtools-arm-990321\H-i586-cygwin32\bin/../lib/gcc-lib/arm-elf/2.9-ecosSWtools-arm-990321/libgcc.a)_dvmd_tls.o
(c:\cygnus\ecosSWtools-arm-990321\H-i586-cygwin32\bin/../lib/gcc-lib/arm-elf/2.9-ecosSWtools-arm-990321/libgcc.a)_udivdi3.o
(c:\cygnus\ecosSWtools-arm-990321\H-i586-cygwin32\bin/../lib/gcc-lib/arm-elf/2.9-ecosSWtools-arm-990321/libgcc.a)_udivsi3.o
(c:\cygnus\ecosSWtools-arm-990321\H-i586-cygwin32\bin/../lib/gcc-lib/arm-elf/2.9-ecosSWtools-arm-990321/libgcc.a)_umodsi3.o
/c/cygnus/ecosSWtools-arm-990321/H-i586-cygwin32/arm-elf/bin/ld: bfd
assertion fail /c/cygnus/ecosSWtools-arm-990321/src/bfd/elf32-arm.h:488
/c/cygnus/ecosSWtools-arm-990321/H-i586-cygwin32/arm-elf/bin/ld: bfd
assertion fail /c/cygnus/ecosSWtools-arm-990321/src/bfd/elf32-arm.h:488
[..repeated some 30 times or so..]
/c/cygnus/ecosSWtools-arm-990321/H-i586-cygwin32/arm-elf/bin/ld: bfd
assertion fail /c/cygnus/ecosSWtools-arm-990321/src/bfd/elf32-arm.h:488
/c/cygnus/ecosSWtools-arm-990321/H-i586-cygwin32/arm-elf/bin/ld: bfd
assertion fail /c/cygnus/ecosSWtools-arm-990321/src/bfd/elf32-arm.h:488
/c/cygnus/ecosSWtools-arm-990321/H-i586-cygwin32/arm-elf/bin/ld:
warning: no memory region specified for section `.glue_7'
/c/cygnus/ecosSWtools-arm-990321/H-i586-cygwin32/arm-elf/bin/ld:
warning: no memory region specified for section `.glue_7t'
------------------------------------------------
I get the a.out however; but it is incorrect and differs from the
ELF in a strange way:
------------------------------------------------ binary
a.out: file format binary
Disassembly of section .data:
00000000 <.data>:
0: ea000100 b 0x408
4: e59ff018 ldr pc, [pc, #18] ; 0x24
8: e59ff018 ldr pc, [pc, #18] ; 0x28
c: e59ff018 ldr pc, [pc, #18] ; 0x2c
10: e59ff018 ldr pc, [pc, #18] ; 0x30
14: 00000000 andeq r0, r0, r0
18: e59ff018 ldr pc, [pc, #18] ; 0x38
1c: e59ff018 ldr pc, [pc, #18] ; 0x3c
20: 00000400 andeq r0, r0, r0, lsl #8
24: 00000490 muleq r0, r0, r4
28: 000004f0 streqsh r0, [r0], -r0
2c: 00000550 andeq r0, r0, r0, asr r5
30: 000005b0 streqh r0, [r0], -r0
34: 00000000 andeq r0, r0, r0
38: 000006b4 streqh r0, [r0], -r4
3c: 00000610 andeq r0, r0, r0, lsl r6
40: 00000400 andeq r0, r0, r0, lsl #8
44: e1a00000 nop (mov r0,r0)
48: e1a00000 nop (mov r0,r0)
4c: e1a00000 nop (mov r0,r0)
50: e1a00000 nop (mov r0,r0)
[..snip..]
3f8: e1a00000 nop (mov r0,r0)
3fc: e1a00000 nop (mov r0,r0)
400: e59f3440 ldr r3, [pc, #440] ; 0x848
404: e59f4440 ldr r4, [pc, #440] ; 0x84c
408: e59f5440 ldr r5, [pc, #440] ; 0x850
40c: e1540005 cmp r4, r5
410: 0a000328 beq 0x10b8
414: e2433004 sub r3, r3, #4
418: e2444004 sub r4, r4, #4
41c: e5b30004 ldr r0, [r3, #4]!
420: e5a40004 str r0, [r4, #4]!
424: e1540005 cmp r4, r5
428: 1a000312 bne 0x1078
------------------------------------------------ ELF
a.out: file format elf32-littlearm
a.out
architecture: arm, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00000400
[..snip..]
Disassembly of section .rom_vectors:
00000000 <__exception_handlers>:
0: ea0000fe b 400 <reset_vector>
4: e59ff018 ldr pc, [pc, #18] ; 24 <.undefined_instruction>
8: e59ff018 ldr pc, [pc, #18] ; 28 <.software_interrupt>
c: e59ff018 ldr pc, [pc, #18] ; 2c <armreg_fp>
10: e59ff018 ldr pc, [pc, #18] ; 30 <armreg_sp>
14: 00000000 andeq r0, r0, r0
18: e59ff018 ldr pc, [pc, #18] ; 38 <armreg_pc>
1c: e59ff018 ldr pc, [pc, #18] ; 3c <armreg_cpsr>
00000020 <vectors>:
20: 00000400 andeq r0, r0, r0, lsl #8
00000024 <.undefined_instruction>:
24: 00000490 muleq r0, r0, r4
00000028 <.software_interrupt>:
28: 000004f0 streqsh r0, [r0], -r0
0000002c <.abort_prefetch>:
2c: 00000550 andeq r0, r0, r0, asr r5
00000030 <.abort_data>:
30: 000005b0 streqh r0, [r0], -r0
34: 00000000 andeq r0, r0, r0
00000038 <.IRQ>:
38: 000006b4 streqh r0, [r0], -r4
0000003c <.FIQ>:
3c: 00000610 andeq r0, r0, r0, lsl r6
00000040 <.start>:
40: 00000400 andeq r0, r0, r0, lsl #8
00000044 <guru>:
44: e1a00000 nop (mov r0,r0)
48: e1a00000 nop (mov r0,r0)
4c: e1a00000 nop (mov r0,r0)
50: e1a00000 nop (mov r0,r0)
[..snip..]
3f4: e1a00000 nop (mov r0,r0)
3f8: e1a00000 nop (mov r0,r0)
3fc: e1a00000 nop (mov r0,r0)
00000400 <reset_vector>:
400: e59f3440 ldr r3, [pc, #440] ; 848 <.__rom_data_start>
404: e59f4440 ldr r4, [pc, #440] ; 84c <.__ram_data_start>
408: e59f5440 ldr r5, [pc, #440] ; 850 <.__ram_data_end>
40c: e1540005 cmp r4, r5
410: 0a000005 beq 42c <reset_vector+0x2c>
414: e2433004 sub r3, r3, #4
418: e2444004 sub r4, r4, #4
41c: e5b30004 ldr r0, [r3, #4]!
420: e5a40004 str r0, [r4, #4]!
424: e1540005 cmp r4, r5
428: 1afffffb bne 41c <reset_vector+0x1c>