* [patch] Unbreak Arm blx relocations
@ 2006-03-14 20:07 Paul Brook
2006-04-07 15:00 ` Nick Clifton
0 siblings, 1 reply; 2+ messages in thread
From: Paul Brook @ 2006-03-14 20:07 UTC (permalink / raw)
To: binutils
[-- Attachment #1: Type: text/plain, Size: 608 bytes --]
My previous patch to implement Arm bl->blx conversion accidentally removed the
gas code for resolving relocations on blx instructions.
http://sourceware.org/ml/binutils/2005-10/msg00430.html
The symptoms are that a BLX instruction to a label in the same section gets
resolved by the assembler, but the H offset bit is not set correctly.
The patch below fixes this.
Testes on arm-none-eabi.
Ok?
Paul
2006-03-14 Paul Brook <paul@codesourcery.com>
gas/
* config/tc-arm.c (md_apply_fix): Set H bit on blx instruction.
gas/testsuite/
* gas/arm/blx-local.d: New test.
* gas/arm/blx-local.d: New test.
[-- Attachment #2: patch.gas_blx --]
[-- Type: text/x-diff, Size: 1956 bytes --]
Index: gas/config/tc-arm.c
===================================================================
RCS file: /var/cvsroot/src-cvs/src/gas/config/tc-arm.c,v
retrieving revision 1.246
diff -u -p -r1.246 tc-arm.c
--- gas/config/tc-arm.c 10 Mar 2006 17:20:30 -0000 1.246
+++ gas/config/tc-arm.c 14 Mar 2006 19:27:33 -0000
@@ -11864,6 +11864,14 @@ md_apply_fix (fixS * fixP,
{
newval = md_chars_to_number (buf, INSN_SIZE);
newval |= (value >> 2) & 0x00ffffff;
+ /* Set the H bit on BLX instructions. */
+ if (temp == 1)
+ {
+ if (value & 2)
+ newval |= 0x01000000;
+ else
+ newval &= ~0x01000000;
+ }
md_number_to_chars (buf, newval, INSN_SIZE);
}
break;
Index: gas/testsuite/gas/arm/blx-local.d
===================================================================
RCS file: gas/testsuite/gas/arm/blx-local.d
diff -N gas/testsuite/gas/arm/blx-local.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/arm/blx-local.d 14 Mar 2006 19:37:05 -0000
@@ -0,0 +1,14 @@
+#name: Local BLX instructions
+#objdump: -dr --prefix-addresses --show-raw-insn
+#as:
+
+# Test assembler resolution of blx instructions.
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+
+0+00 <[^>]*> fa000000 blx 00+8 <foo>
+0+04 <[^>]*> fbffffff blx 00+a <foo2>
+0+08 <[^>]*> 46c0 nop \(mov r8, r8\)
+0+0a <[^>]*> 46c0 nop \(mov r8, r8\)
Index: gas/testsuite/gas/arm/blx-local.s
===================================================================
RCS file: gas/testsuite/gas/arm/blx-local.s
diff -N gas/testsuite/gas/arm/blx-local.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/testsuite/gas/arm/blx-local.s 14 Mar 2006 19:30:59 -0000
@@ -0,0 +1,16 @@
+ .text
+ .arch armv5t
+ .arm
+one:
+ blx foo
+ blx foo2
+
+ .thumb
+ .type foo, %function
+ .thumb_func
+foo:
+ nop
+ .type foo2, %function
+ .thumb_func
+foo2:
+ nop
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] Unbreak Arm blx relocations
2006-03-14 20:07 [patch] Unbreak Arm blx relocations Paul Brook
@ 2006-04-07 15:00 ` Nick Clifton
0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2006-04-07 15:00 UTC (permalink / raw)
To: Paul Brook; +Cc: binutils
Hi Paul,
> 2006-03-14 Paul Brook <paul@codesourcery.com>
>
> gas/
> * config/tc-arm.c (md_apply_fix): Set H bit on blx instruction.
> gas/testsuite/
> * gas/arm/blx-local.d: New test.
> * gas/arm/blx-local.d: New test.
>
Approved - please apply.
Cheers
Nick
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-04-07 14:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-14 20:07 [patch] Unbreak Arm blx relocations Paul Brook
2006-04-07 15:00 ` Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).