/* tc-frv.c -- Assembler for the Fujitsu FRV.
- Copyright (C) 2002 Free Software Foundation.
+ Copyright 2002, 2003 Free Software Foundation.
This file is part of GAS, the GNU Assembler.
#include <stdio.h>
#include "as.h"
-#include "dwarf2dbg.h"
#include "subsegs.h"
#include "symcat.h"
#include "opcodes/frv-desc.h"
#define NOP_KEEP 1 /* Keep these NOPS. */
#define NOP_DELETE 2 /* Delete these NOPS. */
-#define DO_COUNT true
-#define DONT_COUNT false
+#define DO_COUNT TRUE
+#define DONT_COUNT FALSE
/* A list of insns within a VLIW insn. */
struct vliw_insn_list
{ "eflags", frv_set_flags, 0 },
{ "word", cons, 4 },
{ "picptr", frv_pic_ptr, 4 },
- { "file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
- { "loc", dwarf2_directive_loc, 0 },
{ NULL, NULL, 0 }
};
int chain_num = 0;
+struct vliw_insn_list *frv_insert_vliw_insn PARAMS ((bfd_boolean));
+
struct vliw_insn_list *
frv_insert_vliw_insn (count)
- boolean count;
+ bfd_boolean count;
{
struct vliw_insn_list *vliw_insn_list_entry;
struct vliw_chain *vliw_chain_entry;
/* Check a vliw insn for an insn of type containing the sym passed in label_sym. */
+static struct vliw_insn_list *frv_find_in_vliw
+ PARAMS ((enum vliw_insn_type, struct vliw_chain *, symbolS *));
+
static struct vliw_insn_list *
frv_find_in_vliw (vliw_insn_type, this_chain, label_sym)
enum vliw_insn_type vliw_insn_type;
VLIW_DOUBLE_THEN_SINGLE_NOP
};
+static void frv_debug_tomcat PARAMS ((struct vliw_chain *));
+
static void
frv_debug_tomcat (start_chain)
struct vliw_chain *start_chain;
}
}
+static void frv_adjust_vliw_count PARAMS ((struct vliw_chain *));
static void
frv_adjust_vliw_count (this_chain)
/* Insert the desired nop combination in the vliw chain before insert_before_insn.
Rechain the vliw insn. */
+static struct vliw_chain *frv_tomcat_shuffle
+ PARAMS ((enum vliw_nop_type, struct vliw_chain *, struct vliw_insn_list *));
static struct vliw_chain *
frv_tomcat_shuffle (this_nop_type, vliw_to_split, insert_before_insn)
struct vliw_insn_list *insert_before_insn;
{
- boolean pack_prev = false;
+ bfd_boolean pack_prev = FALSE;
struct vliw_chain *return_me = NULL;
struct vliw_insn_list *prev_insn = NULL;
struct vliw_insn_list *curr_insn = vliw_to_split->insn_list;
Then don't set pack bit later. */
if (curr_insn->type != VLIW_LABEL_TYPE)
- pack_prev = true;
+ pack_prev = TRUE;
prev_insn = curr_insn;
curr_insn = curr_insn->next;
}
return return_me;
}
+static void frv_tomcat_analyze_vliw_chains PARAMS ((void));
+
static void
frv_tomcat_analyze_vliw_chains ()
{
{
if (this_insn->type == VLIW_LABEL_TYPE)
{
- if ((temp_insn = frv_find_in_vliw (VLIW_BRANCH_TYPE, vliw2, this_insn->sym, temp_insn)) != NULL)
+ if ((temp_insn = frv_find_in_vliw (VLIW_BRANCH_TYPE, vliw2, this_insn->sym)) != NULL)
{
temp_insn->snop_frag->fr_subtype = NOP_KEEP;
vliw1 = frv_tomcat_shuffle (VLIW_SINGLE_NOP, vliw2, this_insn);
if (frv_is_branch_insn (this_insn->insn))
{
- if ((temp_insn = frv_find_in_vliw (VLIW_LABEL_TYPE, vliw1, this_insn->sym, temp_insn)) != NULL)
+ if ((temp_insn = frv_find_in_vliw (VLIW_LABEL_TYPE, vliw1, this_insn->sym)) != NULL)
{
/* Insert [nop/nop] [nop] before branch. */
this_insn->snop_frag->fr_subtype = NOP_KEEP;
switch (operand->type)
{
case FRV_OPERAND_LABEL16:
- fixP->fx_pcrel = true;
+ fixP->fx_pcrel = TRUE;
return BFD_RELOC_FRV_LABEL16;
case FRV_OPERAND_LABEL24:
- fixP->fx_pcrel = true;
+ fixP->fx_pcrel = TRUE;
return BFD_RELOC_FRV_LABEL24;
case FRV_OPERAND_UHI16:
frv_force_relocation (fix)
fixS * fix;
{
- if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
- || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY
- || fix->fx_r_type == BFD_RELOC_FRV_GPREL12
+ if (fix->fx_r_type == BFD_RELOC_FRV_GPREL12
|| fix->fx_r_type == BFD_RELOC_FRV_GPRELU12)
return 1;
- return 0;
+ return generic_force_reloc (fix);
}
\f
/* Write a value out to the object file, using the appropriate endianness. */
int prec;
LITTLENUM_TYPE words [MAX_LITTLENUMS];
char * t;
- char * atof_ieee ();
switch (type)
{
return 0;
}
-boolean
+bfd_boolean
frv_fix_adjustable (fixP)
fixS * fixP;
{
else
reloc_type = fixP->fx_r_type;
- if (fixP->fx_addsy == NULL)
- return 1;
-
- /* Prevent all adjustments to global symbols. */
- if (S_IS_EXTERN (fixP->fx_addsy))
- return 0;
-
- if (S_IS_WEAK (fixP->fx_addsy))
- return 0;
-
/* We need the symbol name for the VTABLE entries */
if ( reloc_type == BFD_RELOC_VTABLE_INHERIT
|| reloc_type == BFD_RELOC_VTABLE_ENTRY