bad branches from assembler, gcc3.4 arm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I've written some very simple assembler code (included as test.S) and
compiled it with "arm-linux-gcc -c test.S". The disassembled code
(included as output.txt) shows that the branches are not pointed to the
right address.

Any idea what would cause this? Something missing in the source file, or a
compile option, or a compiler bug?

Please CC responses to me, as I'm not subscribed to the list.

Scottie Shore <umshore4@xxxxxxxxxxxxxxx>
 - In general, if you notice double vision, you've gone too far.
test.o:     file format elf32-littlearm

Disassembly of section .text:

00000000 <.text>:
   0:	e59f003c 	ldr	r0, [pc, #60]	; 44 <TEST_PATTERN>
   4:	eb000001 	bl	10 <transmit+0x4>
   8:	eaffffff 	b	c <transmit>
   c:	e59f2038 	ldr	r2, [pc, #56]	; 4c <UTSR1>
  10:	e5921000 	ldr	r1, [r2]
  14:	e3110004 	tst	r1, #4	; 0x4
  18:	1a000008 	bne	40 <fifo_free+0x18>
  1c:	e5921000 	ldr	r1, [r2]
  20:	e3110004 	tst	r1, #4	; 0x4
  24:	0a000005 	beq	40 <fifo_free+0x18>
  28:	e59f2018 	ldr	r2, [pc, #24]	; 48 <UTDR>
  2c:	e20000ff 	and	r0, r0, #255	; 0xff
  30:	e5921000 	ldr	r1, [r2]
  34:	e3c110ff 	bic	r1, r1, #255	; 0xff
  38:	e1800001 	orr	r0, r0, r1
  3c:	e5820000 	str	r0, [r2]
  40:	e1a0f00e 	mov	pc, lr
  44:	2b2b2b2b 	blcs	acacf8 <UTSR1+0xacacac>
  48:	80050014 	andhi	r0, r5, r4, lsl r0
  4c:	80050020 	andhi	r0, r5, r0, lsr #32
.text
	ldr	r0, TEST_PATTERN
loop:
	bl	transmit
	b	loop

/* serial output code */
transmit:
	ldr	r2, UTSR1
	ldr	r1, [r2]
	tst	r1, #4
	bne	fifo_free
fifo_full:
	/* we don't bother handling timeouts here */
	ldr	r1, [r2]
	tst	r1, #4
	beq	fifo_full
fifo_free:
	ldr	r2, UTDR
	and	r0, r0, #0xff
	ldr	r1, [r2]
	bic	r1, r1, #0xff
	orr	r0, r0, r1
	str	r0, [r2]
	mov	pc, lr


TEST_PATTERN:	.word	0x2b2b2b2b
UTDR:		.word	0x80050014
UTSR1:		.word	0x80050020

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux