This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bug in gnu-as 2.9.5 and later ?


On Tue, Feb 27, 2001 at 12:37:41PM +0100, Honza Fikar wrote:
> Hello,
> 
> the problem is, that I get different results using as version 2.9.1 and
> 2.9.5 or later. I'm working on Psion5 linux port
> (linux-7110.sourceforge.net), it has CLPS7110 (ARM7) processor and I'm
> corss-compiling using i386 host.
> The 2.9.5.0.37 binutils are from http://www.emdebian.org/crossdev.html,
> while the 2.9.1 are on linux-7110 site.
> 
> The difference concerns the bootloader :
> ftp://linux-7110.sourceforge.net/pub/linux-7110/KernelPatches/crash+burn-26.patch.gz
> 
> The bootloader made with as 2.9.1 works, while with 2.9.5 doesn't. The
> command line is :
> 
> as -o boot.o boot.S
> 
> I have attached the boot.S and the two results as well. If I add -a flag
> and compare the results, I can see, that there is a difference between
> the two outputs and it's only around instructions bne, b, beq, bl, bleq,
> blt.
> 
> I also tried version 2.10 but with the same result as 2.9.5. It comes
> from ftp://ftp.netwinder.org/users/c/chagas/arm-linux-cross/
> 
> Is this a bug in gnu-as, or am I missing some command-line parameter, or
> should be the source changed?
> 
> Thank you and best regards
> Jan Fikar
> jan.fikar@epfl.ch

I don't know anything about ARM. But from the disassmebled code, it
seems that the difference is in the branch instructions. The only
things I can tell is boot-ok.o has no relocation and boot-bad.o
has many relocations. Even for this simple code:

---
        tst     r1,#0xff
        bne     optcplp
optcplp:ldrb    r1,[r2],#1               
        tst     r1,#0xff
        bne     optcplp
----

There are relocations:

Relocation section '.rel.text' at offset 0x21c contains 2 entries:
  Offset    Info  Type            Symbol's Value  Symbol's Name
  00000004  00101 R_ARM_PC24            00000000  .text                    
  00000010  00101 R_ARM_PC24            00000000  .text                    

I have no ideas what those relocations are for. Maybe some people who
know more about ARM can tell you.


-- 
H.J. Lu (hjl@valinux.com)
---
--- 1	Tue Feb 27 09:44:36 2001
+++ 2	Tue Feb 27 09:44:41 2001
@@ -1,5 +1,5 @@
 
-boot-ok.o:     file format elf32-littlearm
+boot-bad.o:     file format elf32-littlearm
 
 Disassembly of section .text:
 
@@ -17,7 +17,7 @@ Disassembly of section .text:
   28:	e3858c0e 	orr	r8, r5, #3584	; 0xe00
   2c:	e598a000 	ldr	sl, [r8]
   30:	e35a0000 	cmp	sl, #0	; 0x0
-  34:	0a00007a 	beq	224 <findmem>
+  34:	0a000087 	beq	224 <findmem>
 
 00000038 <bffm>:
   38:	e1a0562f 	mov	r5, pc, lsr #12
@@ -28,12 +28,12 @@ Disassembly of section .text:
   4c:	e5902000 	ldr	r2, [r0]
   50:	e5d21000 	ldrb	r1, [r2]
   54:	e31100ff 	tst	r1, #255	; 0xff
-  58:	0a000033 	beq	12c <entry>
+  58:	0a000049 	beq	12c <entry>
 
 0000005c <optelp>:
   5c:	e4d71001 	ldrb	r1, [r7], #1
   60:	e31100ff 	tst	r1, #255	; 0xff
-  64:	1afffffc 	bne	5c <optelp>
+  64:	1a000015 	bne	5c <optelp>
   68:	e3a01020 	mov	r1, #32	; 0x20
   6c:	e5471001 	strb	r1, [r7, -#1]
 
@@ -41,19 +41,19 @@ Disassembly of section .text:
   70:	e4d21001 	ldrb	r1, [r2], #1
   74:	e4c71001 	strb	r1, [r7], #1
   78:	e31100ff 	tst	r1, #255	; 0xff
-  7c:	1afffffb 	bne	70 <optcplp>
-  80:	ea000029 	b	12c <entry>
+  7c:	1a00001a 	bne	70 <optcplp>
+  80:	ea000049 	b	12c <entry>
 
 00000084 <exit>:
   84:	e5902004 	ldr	r2, [r0, #4]
   88:	e3520000 	cmp	r2, #0	; 0x0
-  8c:	0a000018 	beq	f4 <dncpf>
+  8c:	0a00003b 	beq	f4 <dncpf>
   90:	e3858c0e 	orr	r8, r5, #3584	; 0xe00
 
 00000094 <fefllp>:
   94:	e5b81008 	ldr	r1, [r8, #8]!
   98:	e3510000 	cmp	r1, #0	; 0x0
-  9c:	1afffffc 	bne	94 <fefllp>
+  9c:	1a000023 	bne	94 <fefllp>
   a0:	e1a0a000 	mov	sl, r0
   a4:	e3a0b000 	mov	fp, #0	; 0x0
   a8:	e3a06000 	mov	r6, #0	; 0x0
@@ -61,7 +61,7 @@ Disassembly of section .text:
 000000ac <fsbwlp>:
   ac:	e5ba2004 	ldr	r2, [sl, #4]!
   b0:	e3520000 	cmp	r2, #0	; 0x0
-  b4:	0a000008 	beq	dc <fsbwdn>
+  b4:	0a000035 	beq	dc <fsbwdn>
   b8:	e28bba01 	add	fp, fp, #4096	; 0x1000
   bc:	e3560000 	cmp	r6, #0	; 0x0
   c0:	09380042 	ldmeqdb	r8!, {r1, r6}
@@ -70,7 +70,7 @@ Disassembly of section .text:
   cc:	e2411a01 	sub	r1, r1, #4096	; 0x1000
   d0:	e2466a01 	sub	r6, r6, #4096	; 0x1000
   d4:	e2899a01 	add	r9, r9, #4096	; 0x1000
-  d8:	eafffff3 	b	ac <fsbwlp>
+  d8:	ea000029 	b	ac <fsbwlp>
 
 000000dc <fsbwdn>:
   dc:	e2852b02 	add	r2, r5, #2048	; 0x800
@@ -78,7 +78,7 @@ Disassembly of section .text:
   e4:	e4821004 	str	r1, [r2], #4
   e8:	e582b000 	str	fp, [r2]
   ec:	e2888008 	add	r8, r8, #8	; 0x8
-  f0:	ea000012 	b	140 <loop1>
+  f0:	ea00004e 	b	140 <loop1>
 
 000000f4 <dncpf>:
   f4:	e3a0c103 	mov	ip, #-1073741824	; 0xc0000000
@@ -92,7 +92,7 @@ Disassembly of section .text:
  10c:	e4925004 	ldr	r5, [r2], #4
  110:	e4835004 	str	r5, [r3], #4
  114:	e2544001 	subs	r4, r4, #1	; 0x1
- 118:	1afffffb 	bne	10c <pclp>
+ 118:	1a000041 	bne	10c <pclp>
  11c:	e3a00000 	mov	r0, #0	; 0x0
  120:	e3a01009 	mov	r1, #9	; 0x9
  124:	e3a0c103 	mov	ip, #-1073741824	; 0xc0000000
@@ -108,7 +108,7 @@ Disassembly of section .text:
 00000140 <loop1>:
  140:	e5b02004 	ldr	r2, [r0, #4]!
  144:	e3520000 	cmp	r2, #0	; 0x0
- 148:	0affffcd 	beq	84 <exit>
+ 148:	0a00001f 	beq	84 <exit>
  14c:	e1a0c000 	mov	ip, r0
 
 00000150 <scanloop>:
@@ -116,46 +116,46 @@ Disassembly of section .text:
  154:	e3540000 	cmp	r4, #0	; 0x0
  158:	05bc4004 	ldreq	r4, [ip, #4]!
  15c:	03540000 	cmpeq	r4, #0	; 0x0
- 160:	0a000002 	beq	170 <endscan>
+ 160:	0a00005a 	beq	170 <endscan>
  164:	e1540001 	cmp	r4, r1
- 168:	0a000015 	beq	1c4 <relocpage>
- 16c:	eafffff7 	b	150 <scanloop>
+ 168:	0a00006f 	beq	1c4 <relocpage>
+ 16c:	ea000052 	b	150 <scanloop>
 
 00000170 <endscan>:
  170:	e1550001 	cmp	r5, r1
- 174:	0b000019 	bleq	1e0 <relocself>
+ 174:	0b000076 	bleq	1e0 <relocself>
  178:	e1530001 	cmp	r3, r1
- 17c:	1a000007 	bne	1a0 <donereloc>
+ 17c:	1a000066 	bne	1a0 <donereloc>
  180:	e1a0c001 	mov	ip, r1
  184:	e1a0100d 	mov	r1, sp
  188:	e1a02003 	mov	r2, r3
  18c:	e0400003 	sub	r0, r0, r3
  190:	e1a03001 	mov	r3, r1
  194:	e0800003 	add	r0, r0, r3
- 198:	eb00001b 	bl	20c <copypage>
+ 198:	eb000081 	bl	20c <copypage>
  19c:	e1a0100c 	mov	r1, ip
 
 000001a0 <donereloc>:
  1a0:	e5902000 	ldr	r2, [r0]
  1a4:	e1510002 	cmp	r1, r2
  1a8:	02811a01 	addeq	r1, r1, #4096	; 0x1000
- 1ac:	0a000001 	beq	1b8 <page_done>
- 1b0:	eb000015 	bl	20c <copypage>
+ 1ac:	0a00006c 	beq	1b8 <page_done>
+ 1b0:	eb000081 	bl	20c <copypage>
  1b4:	e242da01 	sub	sp, r2, #4096	; 0x1000
 
 000001b8 <page_done>:
  1b8:	e2599a01 	subs	r9, r9, #4096	; 0x1000
  1bc:	08b80202 	ldmeqia	r8!, {r1, r9}
- 1c0:	eaffffde 	b	140 <loop1>
+ 1c0:	ea00004e 	b	140 <loop1>
 
 000001c4 <relocpage>:
  1c4:	e1a06001 	mov	r6, r1
  1c8:	e1a0100d 	mov	r1, sp
  1cc:	e1a02004 	mov	r2, r4
- 1d0:	eb00000d 	bl	20c <copypage>
+ 1d0:	eb000081 	bl	20c <copypage>
  1d4:	e58cd000 	str	sp, [ip]
  1d8:	e1a01006 	mov	r1, r6
- 1dc:	eaffffef 	b	1a0 <donereloc>
+ 1dc:	ea000066 	b	1a0 <donereloc>
 
 000001e0 <relocself>:
  1e0:	e1a0c001 	mov	ip, r1
@@ -165,7 +165,7 @@ Disassembly of section .text:
  1f0:	e0488005 	sub	r8, r8, r5
  1f4:	e1a05001 	mov	r5, r1
  1f8:	e0888005 	add	r8, r8, r5
- 1fc:	eb000002 	bl	20c <copypage>
+ 1fc:	eb000081 	bl	20c <copypage>
  200:	e0412002 	sub	r2, r1, r2
  204:	e1a0100c 	mov	r1, ip
  208:	e086f002 	add	pc, r6, r2
@@ -177,7 +177,7 @@ Disassembly of section .text:
  210:	e8b20c00 	ldmia	r2!, {sl, fp}
  214:	e1520007 	cmp	r2, r7
  218:	e8a10c00 	stmia	r1!, {sl, fp}
- 21c:	bafffffb 	blt	210 <copyloop>
+ 21c:	ba000082 	blt	210 <copyloop>
  220:	e1a0f00e 	mov	pc, lr
 
 00000224 <findmem>:
@@ -193,5 +193,5 @@ Disassembly of section .text:
  240:	e8b200c0 	ldmia	r2!, {r6, r7}
  244:	e8a800c0 	stmia	r8!, {r6, r7}
  248:	e3560000 	cmp	r6, #0	; 0x0
- 24c:	1afffffb 	bne	240 <emtclp>
- 250:	eaffff78 	b	38 <bffm>
+ 24c:	1a00008e 	bne	240 <emtclp>
+ 250:	ea00000c 	b	38 <bffm>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]