ARM long branch stubs: be8

Daniel Jacobowitz drow@false.org
Mon Feb 23 21:50:00 GMT 2009


On Mon, Feb 23, 2009 at 01:27:14PM -0500, Daniel Jacobowitz wrote:
> On Mon, Feb 23, 2009 at 06:55:51PM +0100, Christophe LYON wrote:
> > Hi!
> >>
> >> You could be even cleverer by having ADDR_ABS/ADDR_PIC relocation-like  
> >> entries, and remove all the stub specific knowledge from the code.
> >>
> >
> > I was about to submit a new version when I saw your suggestion.
> > So I took a bit more time, and here is my new proposal.
> 
> This is OK, thank you!  I've looked through it, I did not see any
> problems, and it's much nicer to work with.

Since I'm working on the stubs right now, I hope you don't mind that I
checked this in for you.  The new tests pass both before and after;
I added this additional patch with a big-endian test that fails after.

BE8 and little endian code have equivalent layout, even in Thumb; it's
big-endian that is the odd duck out.

-- 
Daniel Jacobowitz
CodeSourcery

2009-02-23  Daniel Jacobowitz  <dan@codesourcery.com>

	ld/testsuite/
	* ld-arm/arm-elf.exp (armeabitests): Run new tests.  Correct BE8 output
	filename.
	* ld-arm/farcall-arm-arm-be.d, ld-arm/farcall-thumb-arm-be.d: New.

Index: ld/testsuite/ld-arm/arm-elf.exp
===================================================================
--- ld/testsuite/ld-arm/arm-elf.exp.orig	2009-02-23 13:44:02.000000000 -0800
+++ ld/testsuite/ld-arm/arm-elf.exp	2009-02-23 13:40:02.000000000 -0800
@@ -267,6 +267,9 @@ set armeabitests {
     {"ARM-ARM farcall (BE8)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB --be8" "-EB" {farcall-arm-arm.s}
      {{objdump -d farcall-arm-arm-be8.d}}
      "farcall-arm-arm-be8"}
+    {"ARM-ARM farcall (BE)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB" "-EB" {farcall-arm-arm.s}
+     {{objdump -d farcall-arm-arm-be.d}}
+     "farcall-arm-arm-be"}
 
     {"ARM-Thumb farcall" "-Ttext 0x1000 --section-start .foo=0x2001014" "" {farcall-arm-thumb.s}
      {{objdump -d farcall-arm-thumb.d}}
@@ -299,7 +302,10 @@ set armeabitests {
      "farcall-thumb-arm"}
     {"Thumb-ARM farcall (BE8)" "-Ttext 0x1000 --section-start .foo=0x2001014 -EB --be8" "-W -EB" {farcall-thumb-arm.s}
      {{objdump -d farcall-thumb-arm-be8.d}}
-     "farcall-thumb-arm"}
+     "farcall-thumb-arm-be8"}
+    {"Thumb-ARM farcall (BE)" "-Ttext 0x1000 --section-start .foo=0x2001014 -EB" "-W -EB" {farcall-thumb-arm.s}
+     {{objdump -d farcall-thumb-arm-be.d}}
+     "farcall-thumb-arm-be"}
     {"Thumb-ARM (short) call" "-Ttext 0x1000 --section-start .foo=0x0002014" "-W" {farcall-thumb-arm-short.s}
      {{objdump -d farcall-thumb-arm-short.d}}
      "farcall-thumb-arm-short"}
Index: ld/testsuite/ld-arm/farcall-arm-arm-be.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ ld/testsuite/ld-arm/farcall-arm-arm-be.d	2009-02-23 13:41:57.000000000 -0800
@@ -0,0 +1,14 @@
+.*:     file format .*
+
+Disassembly of section .text:
+
+00001000 <__bar_veneer>:
+    1000:	e51ff004 	ldr	pc, \[pc, #-4\]	; 1004 <__bar_veneer\+0x4>
+    1004:	02001020 	.word	0x02001020
+
+00001008 <_start>:
+    1008:	ebfffffc 	bl	1000 <__bar_veneer>
+Disassembly of section .foo:
+
+02001020 <bar>:
+ 2001020:	e12fff1e 	bx	lr
Index: ld/testsuite/ld-arm/farcall-thumb-arm-be.d
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ ld/testsuite/ld-arm/farcall-thumb-arm-be.d	2009-02-23 13:42:39.000000000 -0800
@@ -0,0 +1,17 @@
+.*:     file format .*
+
+Disassembly of section .text:
+
+00001000 <__bar_from_thumb>:
+    1000:	4778      	bx	pc
+    1002:	46c0      	nop.*
+    1004:	e51ff004 	ldr	pc, \[pc, #-4\]	; 1008 <__bar_from_thumb\+0x8>
+    1008:	02001014 	.word	0x02001014
+    100c:	00000000 	.word	0x00000000
+
+00001010 <_start>:
+    1010:	f7ff fff6 	bl	1000 <__bar_from_thumb>
+Disassembly of section .foo:
+
+02001014 <bar>:
+ 2001014:	e12fff1e 	bx	lr



More information about the Binutils mailing list