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: ARM long branch stubs: be8


On 24.02.2009 15:48, Paul Brook wrote:
What confused me is that objdump -d dumps opcodes in a different order in
the BE8 case. Maybe it could be enhanced to make use of the BE8 EABI
flag?
That would make sense to me, and the *-be8.d files could go away then.
Paul, Richard, what do you think?

I agree. IMHO the current be8 objdump behavior is a bug.


Paul

Hi,

I propose the attached patch.
I did not remove the arm-be8.d test because there is no non-be8 variant.

Christophe.


2009-03-13  Christophe Lyon  <christophe.lyon@st.com>

	opcodes/
	* arm-dis.c (print_insn): Print BE8 opcodes in little endianness.

	ld/testsuite/
	* ld-arm/arm-elf.exp: BE8 tests expect the same output as the
	default ones.
	* ld-arm/arm-be8.d: Print opcodes in little endian.
	* ld-arm/farcall-thumb-arm-be8.d: Removed useless expected result.
	* ld-arm/farcall-arm-arm-be8.d: Likewise.

Index: ld/testsuite/ld-arm/arm-be8.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-arm/arm-be8.d,v
retrieving revision 1.2
diff -u -p -r1.2 arm-be8.d
--- ld/testsuite/ld-arm/arm-be8.d	7 Jul 2008 19:00:21 -0000	1.2
+++ ld/testsuite/ld-arm/arm-be8.d	13 Mar 2009 13:55:38 -0000
@@ -4,13 +4,13 @@
 Disassembly of section .text:
 
 00008000 <arm>:
-    8000:	0000a0e3 	mov	r0, #0	; 0x0
-    8004:	1eff2fe1 	bx	lr
+    8000:	e3a00000 	mov	r0, #0	; 0x0
+    8004:	e12fff1e 	bx	lr
 
 00008008 <thumb>:
-    8008:	c046      	nop			\(mov r8, r8\)
-    800a:	7047      	bx	lr
-    800c:	fff7 fcff 	bl	8008 <thumb>
+    8008:	46c0      	nop			\(mov r8, r8\)
+    800a:	4770      	bx	lr
+    800c:	f7ff fffc 	bl	8008 <thumb>
 
 00008010 <data>:
     8010:	12345678 	.word	0x12345678
Index: ld/testsuite/ld-arm/arm-elf.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-arm/arm-elf.exp,v
retrieving revision 1.51
diff -u -p -r1.51 arm-elf.exp
--- ld/testsuite/ld-arm/arm-elf.exp	6 Mar 2009 08:57:58 -0000	1.51
+++ ld/testsuite/ld-arm/arm-elf.exp	13 Mar 2009 13:55:38 -0000
@@ -265,7 +265,7 @@ set armeabitests {
      {{objdump -d farcall-arm-arm-pic-veneer.d}}
      "farcall-arm-arm-pic-veneer"}
     {"ARM-ARM farcall (BE8)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB --be8" "-EB" {farcall-arm-arm.s}
-     {{objdump -d farcall-arm-arm-be8.d}}
+     {{objdump -d farcall-arm-arm.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.d}}
@@ -307,7 +307,7 @@ set armeabitests {
      {{objdump -d farcall-thumb-arm.d}}
      "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}}
+     {{objdump -d farcall-thumb-arm.d}}
      "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.d}}
Index: ld/testsuite/ld-arm/farcall-arm-arm-be8.d
===================================================================
RCS file: ld/testsuite/ld-arm/farcall-arm-arm-be8.d
diff -N ld/testsuite/ld-arm/farcall-arm-arm-be8.d
--- ld/testsuite/ld-arm/farcall-arm-arm-be8.d	24 Feb 2009 22:43:10 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-.*:     file format .*
-
-Disassembly of section .text:
-
-00001000 <_start>:
-    1000:	000000eb 	bl	1008 <__bar_veneer>
-    1004:	00000000 	andeq	r0, r0, r0
-
-00001008 <__bar_veneer>:
-    1008:	04f01fe5 	ldr	pc, \[pc, #-4\]	; 100c <__bar_veneer\+0x4>
-    100c:	02001020 	.word	0x02001020
-Disassembly of section .foo:
-
-02001020 <bar>:
- 2001020:	1eff2fe1 	bx	lr
Index: ld/testsuite/ld-arm/farcall-thumb-arm-be8.d
===================================================================
RCS file: ld/testsuite/ld-arm/farcall-thumb-arm-be8.d
diff -N ld/testsuite/ld-arm/farcall-thumb-arm-be8.d
--- ld/testsuite/ld-arm/farcall-thumb-arm-be8.d	24 Feb 2009 22:43:10 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-.*:     file format .*
-
-Disassembly of section .text:
-
-00001000 <_start>:
-    1000:	00f0 02f8 	bl	1008 <__bar_from_thumb>
-    1004:	0000      	lsls	r0, r0, #0
-	\.\.\.
-
-00001008 <__bar_from_thumb>:
-    1008:	7847      	bx	pc
-    100a:	c046      	nop.*
-    100c:	04f01fe5 	ldr	pc, \[pc, #-4\]	; 1010 <__bar_from_thumb\+0x8>
-    1010:	02001014 	.word	0x02001014
-    1014:	00000000 	.word	0x00000000
-Disassembly of section .foo:
-
-02001014 <bar>:
- 2001014:	1eff2fe1 	bx	lr
Index: opcodes/arm-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/arm-dis.c,v
retrieving revision 1.93
diff -u -p -r1.93 arm-dis.c
--- opcodes/arm-dis.c	23 Feb 2009 14:58:34 -0000	1.93
+++ opcodes/arm-dis.c	13 Mar 2009 13:55:41 -0000
@@ -4111,7 +4111,11 @@ print_insn (bfd_vma pc, struct disassemb
   if (force_thumb)
     is_thumb = TRUE;
 
-  info->display_endian = little ? BFD_ENDIAN_LITTLE : BFD_ENDIAN_BIG;
+  if (is_data)
+    info->display_endian = little ? BFD_ENDIAN_LITTLE : BFD_ENDIAN_BIG;
+  else
+    info->display_endian = little_code ? BFD_ENDIAN_LITTLE : BFD_ENDIAN_BIG;
+
   info->bytes_per_line = 4;
 
   if (is_data)

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