aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2009-10-19 15:27:39 +0000
committerDoug Evans <dje@google.com>2009-10-19 15:27:39 +0000
commit23f5dfcb86e294fd12926351d89f8918b5981b72 (patch)
tree731a30c8d6568270196efaa38f628ec153295287 /gas
parent764ed107e9c05328d6f02d9c0406bd1ad39a502e (diff)
downloadgdb-23f5dfcb86e294fd12926351d89f8918b5981b72.zip
gdb-23f5dfcb86e294fd12926351d89f8918b5981b72.tar.gz
gdb-23f5dfcb86e294fd12926351d89f8918b5981b72.tar.bz2
* config/tc-xc16x.c (md_cgen_lookup_reloc): Ensure fix_size is set
correctly for all 16 bit relocs. Return BFD_RELOC_NONE if reloc isn't recognized, not BFD_RELOC_XC16X_SOF. testsuite: * gas/xc16x/shlrol.s: Specify constant shift amount. * gas/xc16x/xc16x.exp (do_xc16x_shlrol): Update expected output.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-xc16x.c11
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/xc16x/shlrol.s10
-rw-r--r--gas/testsuite/gas/xc16x/xc16x.exp10
5 files changed, 30 insertions, 12 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 31c5d13..5d86ca1 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-19 Doug Evans <dje@sebabeach.org>
+
+ * config/tc-xc16x.c (md_cgen_lookup_reloc): Ensure fix_size is set
+ correctly for all 16 bit relocs. Return BFD_RELOC_NONE if reloc
+ isn't recognized, not BFD_RELOC_XC16X_SOF.
+
2009-10-18 Alan Modra <amodra@bigpond.net.au>
* as.h (know): Don't define as empty.
diff --git a/gas/config/tc-xc16x.c b/gas/config/tc-xc16x.c
index 85b7c0f..c628d86 100644
--- a/gas/config/tc-xc16x.c
+++ b/gas/config/tc-xc16x.c
@@ -154,38 +154,46 @@ md_cgen_lookup_reloc (const CGEN_INSN *insn ATTRIBUTE_UNUSED,
switch (operand->type)
{
case XC16X_OPERAND_REL:
+ /* ??? Adjust size? */
fixP->fx_where += 1;
fixP->fx_pcrel = 1;
return BFD_RELOC_8_PCREL;
case XC16X_OPERAND_CADDR:
+ fixP->fx_size = 2;
fixP->fx_where += 2;
return BFD_RELOC_16;
case XC16X_OPERAND_UIMM7:
+ /* ??? Adjust size? */
fixP->fx_where += 1;
fixP->fx_pcrel = 1;
return BFD_RELOC_8_PCREL;
case XC16X_OPERAND_UIMM16:
case XC16X_OPERAND_MEMORY:
+ fixP->fx_size = 2;
fixP->fx_where += 2;
return BFD_RELOC_16;
case XC16X_OPERAND_UPOF16:
+ fixP->fx_size = 2;
fixP->fx_where += 2;
return BFD_RELOC_XC16X_POF;
case XC16X_OPERAND_UPAG16:
+ fixP->fx_size = 2;
fixP->fx_where += 2;
return BFD_RELOC_XC16X_PAG;
case XC16X_OPERAND_USEG8:
+ /* ??? This is an 8 bit field, why the 16 bit reloc? */
fixP->fx_where += 1;
return BFD_RELOC_XC16X_SEG;
case XC16X_OPERAND_USEG16:
case XC16X_OPERAND_USOF16:
+ fixP->fx_size = 2;
fixP->fx_where += 2;
return BFD_RELOC_XC16X_SOF;
@@ -193,8 +201,7 @@ md_cgen_lookup_reloc (const CGEN_INSN *insn ATTRIBUTE_UNUSED,
break;
}
- fixP->fx_where += 2;
- return BFD_RELOC_XC16X_SOF;
+ return BFD_RELOC_NONE;
}
/* Write a value out to the object file, using the appropriate endianness. */
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 1e7b878..2c8da32 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-19 Doug Evans <dje@sebabeach.org>
+
+ * gas/xc16x/shlrol.s: Specify constant shift amount.
+ * gas/xc16x/xc16x.exp (do_xc16x_shlrol): Update expected output.
+
2009-10-18 Vincent Rivière <vincent.riviere@freesbee.fr>
* gas/all/weakref1u.d: Exclude more aout targets.
diff --git a/gas/testsuite/gas/xc16x/shlrol.s b/gas/testsuite/gas/xc16x/shlrol.s
index 04e6591..801bab6 100644
--- a/gas/testsuite/gas/xc16x/shlrol.s
+++ b/gas/testsuite/gas/xc16x/shlrol.s
@@ -3,12 +3,12 @@
xc16x_shlrol:
shl r0,r1
- shl r0,#a
+ shl r0,#4
shr r0,r1
- shr r0,#a
+ shr r0,#4
rol r0,r1
- rol r0,#a
+ rol r0,#4
ror r0,r1
- ror r0,#a
+ ror r0,#4
ashr r0,r1
- ashr r0,#a
+ ashr r0,#4
diff --git a/gas/testsuite/gas/xc16x/xc16x.exp b/gas/testsuite/gas/xc16x/xc16x.exp
index c53e657..8f42efc 100644
--- a/gas/testsuite/gas/xc16x/xc16x.exp
+++ b/gas/testsuite/gas/xc16x/xc16x.exp
@@ -557,15 +557,15 @@ proc do_xc16x_shlrol {} {
while 1 {
expect {
-re " +\[0-9\]+ 0000 4C01\[^\n\]*\n" { set x [expr $x+1] }
- -re " +\[0-9\]+ 0002 5C00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0002 5C40\[^\n\]*\n" { set x [expr $x+1] }
-re " +\[0-9\]+ 0004 6C01\[^\n\]*\n" { set x [expr $x+1] }
- -re " +\[0-9\]+ 0006 7C00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0006 7C40\[^\n\]*\n" { set x [expr $x+1] }
-re " +\[0-9\]+ 0008 0C01\[^\n\]*\n" { set x [expr $x+1] }
- -re " +\[0-9\]+ 000a 1C00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000a 1C40\[^\n\]*\n" { set x [expr $x+1] }
-re " +\[0-9\]+ 000c 2C01\[^\n\]*\n" { set x [expr $x+1] }
- -re " +\[0-9\]+ 000e 3C00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 000e 3C40\[^\n\]*\n" { set x [expr $x+1] }
-re " +\[0-9\]+ 0010 AC01\[^\n\]*\n" { set x [expr $x+1] }
- -re " +\[0-9\]+ 0012 BC00\[^\n\]*\n" { set x [expr $x+1] }
+ -re " +\[0-9\]+ 0012 BC40\[^\n\]*\n" { set x [expr $x+1] }
timeout { perror "timeout\n; break }
eof { break }
}