This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
mcore-mcore-elf gas b[tf] problems in 000421
- To: binutils at sourceware dot cygnus dot com
- Subject: mcore-mcore-elf gas b[tf] problems in 000421
- From: Rodney Brown <rdb at localhost>
- Date: Wed, 26 Apr 2000 23:27:13 +1000 (EST)
- Reply-To: RDBrown at mira dot net, RodneyBrown at pmsc dot com
binutils snapshots 000228 and 000421 configured as --target=mcore-mcore-elf
fail to assemble mcore 'bf' and 'bt' instructions as expected.
This shows up as failures running any of the execute gcc testsuite
tests.
$ head -30 newlib-1.8.2/libgloss/mcore/crt0.S
// MCore StartUp Code.
.import main
.import exit
.text
.export _start
_start:
.export _mainCRTStartup
_mainCRTStartup:
// Initialise the stack pointer
lrw r1, _stack
mov r0, r1
// Zero the .bss data space
lrw r1, __bss_start__
lrw r2, __bss_end__
movi r3, 0
.L0:
st r3, (r1, 0)
addi r1, 4
cmphs r1, r2
bf .L0
#ifdef __ELF__
// Call the global/static constructors
jbsr _init
// Setup destructors to be called from exit,
// just in case main never returns...
lrw r2, _fini
$ mcore-mcore-elf-run -t egcs-20000417.mcore/gcc/testsuite/20000112-1.x0
0028: inst = 710a LRW of 0x80000 from 0x50 to reg 1
002a: inst = 1210 MOV 80000 into reg 0
002c: inst = 710a LRW of 0x25e4 from 0x54 to reg 1
002e: inst = 720a LRW of 0x25e8 from 0x58 to reg 2
0030: inst = 6003
0032: inst = 9301 store reg 3 (containing 0x0) to 0x25e4
0034: inst = 2031
0036: inst = 0c21
0038: inst = fc07
PC loaded at 0x38 is outside of available memory! (0xfffff848)
program stopped with signal 11.
$ mcore-mcore-elf-objdump --disassemble \
egcs-20000417.mcore/gcc/testsuite/20000112-1.x0 | head -60
egcs-20000417.mcore/gcc/testsuite/20000112-1.x0: file format elf32-mcore-little
Disassembly of section .init:
00000000 <_init>:
0: 24f0 subi r0, 16
2: 9f30 st r15, (r0, 12)
4: 1200 mov r0, r0
6: 1200 mov r0, r0
8: 1200 mov r0, r0
a: 1200 mov r0, r0
c: 1200 mov r0, r0
e: 1200 mov r0, r0
10: 7f01 jsri 0xE08 // e08 <__do_global_ctors_aux>
12: f200 br 0x414
14: 0e08 tst r8, r0
16: 0000 bkpt
18: 0e0e tst r14, r0
1a: 0e0e tst r14, r0
1c: 0e0e tst r14, r0
1e: 0e0e tst r14, r0
20: 8f30 ld r15, (r0, 12)
22: 20f0 addi r0, 16
24: 00cf jmp r15
Disassembly of section .text:
00000028 <_mainCRTStartup>:
28: 710a lrw r1, 0x80000
2a: 1210 mov r0, r1
2c: 710a lrw r1, 0x25E4
2e: 720a lrw r2, 0x25E8
30: 6003 movi r3, 0
32: 9301 st r3, (r1, 0)
34: 2031 addi r1, 4
36: 0c21 cmphs r1, r2
38: fc07 bsr 0xfffff848 // fffff848 <_stack+0xfff7f848>
3a: 7f08 jsri 0x0 // from address pool at 0x5c
3c: 7209 lrw r2, 0xE30
3e: 7f09 jsri 0x2C4 // 2c4 <atexit>
40: 6002 movi r2, 0
42: 6003 movi r3, 0
44: 6004 movi r4, 0
46: 7f08 jsri 0x26E // 26e <__wrap_main>
48: 6002 movi r2, 0
4a: 7f08 jsri 0x1C4 // 1c4 <__wrap_exit>
4c: 0000 bkpt
4e: 0000 bkpt
50: 0000 bkpt
52: 0008 trap 0
Broken pipe
$ cat ../junk.s
.text
.export _junk
_junk:
st r3, (r1, 0)
addi r1, 4
.L0:
cmphs r1, r2
bf .L0
bf .L1
bf _junk
.L1:
bf -2
st r3, (r1, 0)
addi r1, 4
.L2:
cmphs r1, r2
bt .L2
bt .L3
bt _junk
.L3:
bt -2
bkpt
$ binutils-000421.mcore/gas/as-new --version
GNU assembler 000421
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
This assembler was configured for a target of `mcore-mcore-elf'.
$ binutils-000421.mcore/gas/as-new -o junk.o ../junk.s
$ binutils-000421.mcore/binutils/objdump --disassemble junk.o
junk.o: file format elf32-mcore-little
Disassembly of section .text:
00000000 <_junk>:
0: 9301 st r3, (r1, 0)
2: 2031 addi r1, 4
4: 0c21 cmphs r1, r2
6: fe07 bsr 0xfffffc16 // fffffc16 <*ABS*+0xfffffc16>
8: e900 bf 0x20a
a: fa07 bsr 0x41a // 41a <*ABS*+0x41a>
c: e800 bf 0xe
e: 9301 st r3, (r1, 0)
10: 2031 addi r1, 4
12: 0c21 cmphs r1, r2
14: fe07 bsr 0xfffffc24 // fffffc24 <*ABS*+0xfffffc24>
16: e100 bt 0x218
18: f307 br 0x628
1a: e000 bt 0x1c
...