This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Committed, CRIS: Fix missing case for PIC-expanded conditional far branch
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: binutils at sourceware dot org
- Date: Wed, 12 Nov 2008 03:38:36 +0100
- Subject: Committed, CRIS: Fix missing case for PIC-expanded conditional far branch
I stumbled over this while investigating the CRIS-port-specific
valgrind complaints. Oops, a missing case statement... caught
by the as_fatal in the default statement with rd-bcnst2-pic.d.
Committed.
gas/testsuite:
* gas/cris/rd-bcnst2-pic.d, gas/cris/rd-bcnst2.d,
gas/cris/rd-bcnst2.s: New tests.
gas:
* config/tc-cris.c (cris_relax_frag): Add missing case for
ENCODE_RELAX (STATE_COND_BRANCH_PIC, STATE_DWORD).
Index: config/tc-cris.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-cris.c,v
retrieving revision 1.40
diff -p -u -r1.40 tc-cris.c
--- config/tc-cris.c 4 Oct 2008 17:20:38 -0000 1.40
+++ config/tc-cris.c 12 Nov 2008 02:27:23 -0000
@@ -534,6 +534,7 @@ cris_relax_frag (segT seg ATTRIBUTE_UNUS
because of the different reasons that they aren't relaxable. */
switch (fragP->fr_subtype)
{
+ case ENCODE_RELAX (STATE_COND_BRANCH_PIC, STATE_DWORD):
case ENCODE_RELAX (STATE_COND_BRANCH, STATE_DWORD):
case ENCODE_RELAX (STATE_COND_BRANCH_V32, STATE_DWORD):
case ENCODE_RELAX (STATE_COND_BRANCH_COMMON, STATE_DWORD):
Index: gas/cris/rd-bcnst2-pic.d
===================================================================
RCS file: gas/cris/rd-bcnst2-pic.d
diff -N gas/cris/rd-bcnst2-pic.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/cris/rd-bcnst2-pic.d 12 Nov 2008 02:21:52 -0000
@@ -0,0 +1,17 @@
+#objdump: -dr
+#as: --pic --underscore --em=criself
+#source: rd-bcnst2.s
+
+# Catches an error in the relaxation machinery.
+
+.*: file format elf32.*-cris
+
+Disassembly of section \.text:
+
+0+ <\.text>:
+[ ]+0:[ ]+0ae0[ ]+ba 0xc
+[ ]+2:[ ]+0f05[ ]+nop
+[ ]+4:[ ]+6ffd 0000 0000 3f0e[ ]+move \[pc=pc\+0x0\],p0
+[ ]+6:[ ]+R_CRIS_32_PCREL[ ]+x0x42
+[ ]+c:[ ]+f770[ ]+bmi 0x4
+[ ]+e:[ ]+0f05[ ]+nop
Index: gas/cris/rd-bcnst2.d
===================================================================
RCS file: gas/cris/rd-bcnst2.d
diff -N gas/cris/rd-bcnst2.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/cris/rd-bcnst2.d 12 Nov 2008 02:21:52 -0000
@@ -0,0 +1,17 @@
+#objdump: -dr
+#as: --underscore --em=criself
+
+# Consistency check, corresponding to rd-bcnst2-pic.d.
+
+.*: file format .*-cris
+
+Disassembly of section \.text:
+
+0+ <\.text>:
+[ ]+0:[ ]+08e0[ ]+ba 0xa
+[ ]+2:[ ]+0f05[ ]+nop
+[ ]+4:[ ]+3f0d 0000 0000[ ]+jump 0x0
+[ ]+6:[ ]+R_CRIS_32[ ]+x0x42
+[ ]+a:[ ]+f970[ ]+bmi 0x4
+[ ]+c:[ ]+0f05[ ]+nop
+[ ]+\.\.\.
Index: gas/cris/rd-bcnst2.s
===================================================================
RCS file: gas/cris/rd-bcnst2.s
diff -N gas/cris/rd-bcnst2.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/cris/rd-bcnst2.s 12 Nov 2008 02:21:52 -0000
@@ -0,0 +1,2 @@
+ bmi x0x42
+ nop
brgds, H-P