aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-d30v.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-11-15 21:29:00 +0000
committerNick Clifton <nickc@redhat.com>2001-11-15 21:29:00 +0000
commit94f592af1baedbbe3957436c713fd58c02d55ef9 (patch)
treee0e9b543686a52f86aa0ab7d287cf60541e69b49 /gas/config/tc-d30v.c
parentad10f812bfdac2cc9e42875246c8fe0ae5224440 (diff)
downloadgdb-94f592af1baedbbe3957436c713fd58c02d55ef9.zip
gdb-94f592af1baedbbe3957436c713fd58c02d55ef9.tar.gz
gdb-94f592af1baedbbe3957436c713fd58c02d55ef9.tar.bz2
Update all uses of md_apply_fix to use md_apply_fix3. Make it a void function.
Diffstat (limited to 'gas/config/tc-d30v.c')
-rw-r--r--gas/config/tc-d30v.c93
1 files changed, 44 insertions, 49 deletions
diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c
index 5316b09..c92bcdd 100644
--- a/gas/config/tc-d30v.c
+++ b/gas/config/tc-d30v.c
@@ -1833,73 +1833,70 @@ md_pcrel_from_section (fixp, sec)
return fixp->fx_frag->fr_address + fixp->fx_where;
}
-int
-md_apply_fix3 (fixp, valuep, seg)
- fixS *fixp;
- valueT *valuep;
+void
+md_apply_fix3 (fixP, valP, seg)
+ fixS *fixP;
+ valueT * valP;
segT seg;
{
char *where;
unsigned long insn, insn2;
- long value;
+ long value = * (long *) valP;
+
+ if (fixP->fx_addsy == (symbolS *) NULL)
+ fixP->fx_done = 1;
+
+ else if (fixP->fx_pcrel)
+ ;
- if (fixp->fx_addsy == (symbolS *) NULL)
- {
- value = *valuep;
- fixp->fx_done = 1;
- }
- else if (fixp->fx_pcrel)
- value = *valuep;
else
{
- value = fixp->fx_offset;
+ value = fixP->fx_offset;
- if (fixp->fx_subsy != (symbolS *) NULL)
+ if (fixP->fx_subsy != (symbolS *) NULL)
{
- if (S_GET_SEGMENT (fixp->fx_subsy) == absolute_section)
- value -= S_GET_VALUE (fixp->fx_subsy);
+ if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section)
+ value -= S_GET_VALUE (fixP->fx_subsy);
else
- {
- /* We don't actually support subtracting a symbol. */
- as_bad_where (fixp->fx_file, fixp->fx_line,
- _("expression too complex"));
- }
+ /* We don't actually support subtracting a symbol. */
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ _("expression too complex"));
}
}
/* Fetch the instruction, insert the fully resolved operand
value, and stuff the instruction back again. */
- where = fixp->fx_frag->fr_literal + fixp->fx_where;
+ where = fixP->fx_frag->fr_literal + fixP->fx_where;
insn = bfd_getb32 ((unsigned char *) where);
- switch (fixp->fx_r_type)
+ switch (fixP->fx_r_type)
{
case BFD_RELOC_8: /* Check for a bad .byte directive. */
- if (fixp->fx_addsy != NULL)
+ if (fixP->fx_addsy != NULL)
as_bad (_("line %d: unable to place address of symbol '%s' into a byte"),
- fixp->fx_line, S_GET_NAME (fixp->fx_addsy));
+ fixP->fx_line, S_GET_NAME (fixP->fx_addsy));
else if (((unsigned)value) > 0xff)
as_bad (_("line %d: unable to place value %x into a byte"),
- fixp->fx_line, value);
+ fixP->fx_line, value);
else
*(unsigned char *) where = value;
break;
case BFD_RELOC_16: /* Check for a bad .short directive. */
- if (fixp->fx_addsy != NULL)
+ if (fixP->fx_addsy != NULL)
as_bad (_("line %d: unable to place address of symbol '%s' into a short"),
- fixp->fx_line, S_GET_NAME (fixp->fx_addsy));
+ fixP->fx_line, S_GET_NAME (fixP->fx_addsy));
else if (((unsigned)value) > 0xffff)
as_bad (_("line %d: unable to place value %x into a short"),
- fixp->fx_line, value);
+ fixP->fx_line, value);
else
bfd_putb16 ((bfd_vma) value, (unsigned char *) where);
break;
case BFD_RELOC_64: /* Check for a bad .quad directive. */
- if (fixp->fx_addsy != NULL)
+ if (fixP->fx_addsy != NULL)
as_bad (_("line %d: unable to place address of symbol '%s' into a quad"),
- fixp->fx_line, S_GET_NAME (fixp->fx_addsy));
+ fixP->fx_line, S_GET_NAME (fixP->fx_addsy));
else
{
bfd_putb32 ((bfd_vma) value, (unsigned char *) where);
@@ -1908,58 +1905,58 @@ md_apply_fix3 (fixp, valuep, seg)
break;
case BFD_RELOC_D30V_6:
- check_size (value, 6, fixp->fx_file, fixp->fx_line);
+ check_size (value, 6, fixP->fx_file, fixP->fx_line);
insn |= value & 0x3F;
bfd_putb32 ((bfd_vma) insn, (unsigned char *) where);
break;
case BFD_RELOC_D30V_9_PCREL:
- if (fixp->fx_where & 0x7)
+ if (fixP->fx_where & 0x7)
{
- if (fixp->fx_done)
+ if (fixP->fx_done)
value += 4;
else
- fixp->fx_r_type = BFD_RELOC_D30V_9_PCREL_R;
+ fixP->fx_r_type = BFD_RELOC_D30V_9_PCREL_R;
}
- check_size (value, 9, fixp->fx_file, fixp->fx_line);
+ check_size (value, 9, fixP->fx_file, fixP->fx_line);
insn |= ((value >> 3) & 0x3F) << 12;
bfd_putb32 ((bfd_vma) insn, (unsigned char *) where);
break;
case BFD_RELOC_D30V_15:
- check_size (value, 15, fixp->fx_file, fixp->fx_line);
+ check_size (value, 15, fixP->fx_file, fixP->fx_line);
insn |= (value >> 3) & 0xFFF;
bfd_putb32 ((bfd_vma) insn, (unsigned char *) where);
break;
case BFD_RELOC_D30V_15_PCREL:
- if (fixp->fx_where & 0x7)
+ if (fixP->fx_where & 0x7)
{
- if (fixp->fx_done)
+ if (fixP->fx_done)
value += 4;
else
- fixp->fx_r_type = BFD_RELOC_D30V_15_PCREL_R;
+ fixP->fx_r_type = BFD_RELOC_D30V_15_PCREL_R;
}
- check_size (value, 15, fixp->fx_file, fixp->fx_line);
+ check_size (value, 15, fixP->fx_file, fixP->fx_line);
insn |= (value >> 3) & 0xFFF;
bfd_putb32 ((bfd_vma) insn, (unsigned char *) where);
break;
case BFD_RELOC_D30V_21:
- check_size (value, 21, fixp->fx_file, fixp->fx_line);
+ check_size (value, 21, fixP->fx_file, fixP->fx_line);
insn |= (value >> 3) & 0x3FFFF;
bfd_putb32 ((bfd_vma) insn, (unsigned char *) where);
break;
case BFD_RELOC_D30V_21_PCREL:
- if (fixp->fx_where & 0x7)
+ if (fixP->fx_where & 0x7)
{
- if (fixp->fx_done)
+ if (fixP->fx_done)
value += 4;
else
- fixp->fx_r_type = BFD_RELOC_D30V_21_PCREL_R;
+ fixP->fx_r_type = BFD_RELOC_D30V_21_PCREL_R;
}
- check_size (value, 21, fixp->fx_file, fixp->fx_line);
+ check_size (value, 21, fixP->fx_file, fixP->fx_line);
insn |= (value >> 3) & 0x3FFFF;
bfd_putb32 ((bfd_vma) insn, (unsigned char *) where);
break;
@@ -1988,10 +1985,8 @@ md_apply_fix3 (fixp, valuep, seg)
default:
as_bad (_("line %d: unknown relocation type: 0x%x"),
- fixp->fx_line, fixp->fx_r_type);
+ fixP->fx_line, fixP->fx_r_type);
}
-
- return 0;
}
/* Called after the assembler has finished parsing the input file or