aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-xc16x.c
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/config/tc-xc16x.c
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/config/tc-xc16x.c')
-rw-r--r--gas/config/tc-xc16x.c11
1 files changed, 9 insertions, 2 deletions
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. */