This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: [Patch/RFA]: Patch to fix R_ARM_THM_JUMP24 relocation truncated bug


On Tue, 2010-01-19 at 14:32 +1030, Alan Modra wrote:
> On Mon, Jan 18, 2010 at 02:36:36PM +0000, Matthew Gretton-Dann wrote:
> >         * ld-arm/jump-reloc-veneers-long.d: New test.
> >         * ld-arm/jump-reloc-veneers-short1.d: Likewise.
> >         * ld-arm/jump-reloc-veneers-short2.d: Likewise.
> >         * ld-arm/jump-reloc-veneers.s: Likewise.
> >         * ld-arm/arm-elf.exp (armelftests): Run them.
> 
> One of these tests fails on arm-linux with current mainline sources.
> Please retest and fix.

Apologies for the delay in responding.

The failing test is because targets supporting the old ABI do not
support Thumb-2.  Nor do I believe that there are any plans to add this
support.

The attached patch moves the new tests to only run under arm*-*-*eabi
targets.

There are other tests currently run for all ARM targets that make use of
Thumb-2 and therefore fail under the old ABI.  If the current patch is
approved I will submit a second one which moves these tests so that they
only run under the new ABI.

Suggested ld/testsuite/ChangeLog entry is:

2010-01-18  Matthew Gretton-Dann <matthew.gretton-dann@arm.com>

	* ld-arm/jump-reloc-veneers-long.d: New test.
	* ld-arm/jump-reloc-veneers-short1.d: Likewise.
	* ld-arm/jump-reloc-veneers-short2.d: Likewise.
	* ld-arm/jump-reloc-veneers.s: Likewise.
	* ld-arm/arm-elf.exp (armelftests): Run them.

Thanks,

Matt

-- 
Matthew Gretton-Dann
Principal Engineer - Tools, PD Software
ARM Limited
Index: ld/testsuite/ld-arm/arm-elf.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-arm/arm-elf.exp,v
retrieving revision 1.68
diff -u -p -r1.68 arm-elf.exp
--- ld/testsuite/ld-arm/arm-elf.exp	13 Jan 2010 19:01:10 -0000	1.68
+++ ld/testsuite/ld-arm/arm-elf.exp	25 Jan 2010 11:51:07 -0000
@@ -433,6 +433,25 @@ set armeabitests {
     {"Long branch with mixed text and data" "-T arm.ld" "" {farcall-data.s}
      {{objdump -dr farcall-data.d}}
      "farcall-data"}
+
+    {"R_ARM_THM_JUMP24 Relocation veneers: Short 1" 
+     "-defsym _start=0x8000 --section-start destsect=0x00009000" 
+     "-march=armv7-a -mthumb" 
+     {jump-reloc-veneers.s}
+     {{objdump -d jump-reloc-veneers-short1.d}}
+     "jump-reloc-veneers-short1"}
+    {"R_ARM_THM_JUMP24 Relocation veneers: Short 2" 
+     "-defsym _start=0x8000 --section-start destsect=0x00900000" 
+     "-march=armv7-a -mthumb" 
+     {jump-reloc-veneers.s}
+     {{objdump -d jump-reloc-veneers-short2.d}}
+     "jump-reloc-veneers-short2"}
+    {"R_ARM_THM_JUMP24 Relocation veneers: Long" 
+     "-defsym _start=0x8000 --section-start destsect=0x09000000" 
+     "-march=armv7-a -mthumb" 
+     {jump-reloc-veneers.s}
+     {{objdump -d jump-reloc-veneers-long.d}}
+     "jump-reloc-veneers-long"}
 }
 
 run_ld_link_tests $armeabitests
Index: ld/testsuite/ld-arm/jump-reloc-veneers.s
===================================================================
diff -u /dev/null jump-reloc-veneers.s
--- /dev/null	2009-05-17 13:34:33.498340648 +0100
+++ ld/testsuite/ld-arm/jump-reloc-veneers.s	2010-01-08 10:58:48.054129000 +0000
@@ -0,0 +1,12 @@
+	.text
+	.syntax unified
+	.thumb_func
+	.global _start
+	.type _start,%function
+_start:
+	b.w dest
+
+	.section destsect, "x"
+	.thumb_func
+dest:
+	b dest
Index: ld/testsuite/ld-arm/jump-reloc-short1.d
===================================================================
diff -u /dev/null jump-reloc-veneers-short1.d
--- /dev/null	2009-05-17 13:34:33.498340648 +0100
+++ ld/testsuite/ld-arm/jump-reloc-veneers-short1.d	2010-01-08 11:23:43.572369000 +0000
@@ -0,0 +1,13 @@
+
+.*:     file format.*
+
+
+Disassembly of section destsect:
+
+00009000 <[^>]*>:
+    9000:	e7fe      	b.n	9000 <dest>
+
+Disassembly of section .text:
+
+00008054 <[^>]*>:
+    8054:	f000 bfd4 	b.w	9000 <dest>
Index: ld/testsuite/ld-arm/jump-reloc-short2.d
===================================================================
diff -u /dev/null jump-reloc-veneers-short2.d
--- /dev/null	2009-05-17 13:34:33.498340648 +0100
+++ ld/testsuite/ld-arm/jump-reloc-veneers-short2.d	2010-01-08 11:32:56.653566000 +0000
@@ -0,0 +1,13 @@
+
+.*:     file format.*
+
+
+Disassembly of section destsect:
+
+00900000 <[^>]*>:
+  900000:	e7fe      	b.n	900000 <dest>
+
+Disassembly of section .text:
+
+00008054 <[^>]*>:
+    8054:	f0f7 9fd4 	b.w	900000 <dest>
Index: ld/testsuite/ld-arm/jump-reloc-long.d
===================================================================
diff -u /dev/null jump-reloc-veneers-long.d
--- /dev/null	2009-05-17 13:34:33.498340648 +0100
+++ ld/testsuite/ld-arm/jump-reloc-veneers-long.d	2010-01-08 11:23:06.012845000 +0000
@@ -0,0 +1,21 @@
+
+.*:     file format.*
+
+
+Disassembly of section destsect:
+
+09000000 <[^>]*>:
+ 9000000:	e7fe      	b.n	9000000 <dest>
+
+Disassembly of section .text:
+
+00008058 <[^>]*>:
+    8058:	b802f000 	.word	0xb802f000
+    805c:	00000000 	andeq	r0, r0, r0
+
+00008060 <[^>]*>:
+    8060:	4778      	bx	pc
+    8062:	46c0      	nop			; \(mov r8, r8\)
+    8064:	e59fc000 	ldr	ip, \[pc, #0\]	; 806c <__dest_veneer\+0xc>
+    8068:	e12fff1c 	bx	ip
+    806c:	09000001 	.word	0x09000001

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