/* tc-hppa.c -- Assemble for the PA
Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
/* ??? It might be better to hide this +8 stuff in tc_cfi_emit_pcrel_expr,
undefine DIFF_EXPR_OK, and let these sorts of complex expressions fail
when R_HPPA_COMPLEX == R_PARISC_UNIMPLEMENTED. */
- if (fixp->fx_r_type == R_HPPA_COMPLEX && fixp->fx_pcrel)
+ if (fixp->fx_r_type == (bfd_reloc_code_real_type) R_HPPA_COMPLEX
+ && fixp->fx_pcrel)
{
fixp->fx_r_type = R_HPPA_PCREL_CALL;
fixp->fx_offset += 8;
if (insn->exp.X_op == O_modulus)
{
char *s, c;
- int retval;
input_line_pointer = *strp;
s = *strp;
c = *s;
*s = 0;
- retval = pa_get_absolute_expression (insn, strp);
+ pa_get_absolute_expression (insn, strp);
input_line_pointer = save_in;
*s = c;
const char *args;
int match = FALSE;
int comma = 0;
- int cmpltr, nullif, flag, cond, num;
+ int cmpltr, nullif, flag, cond, need_cond, num;
int immediate_check = 0, pos = -1, len = -1;
unsigned long opcode;
struct pa_opcode *insn;
opcode = insn->match;
strict = (insn->flags & FLAG_STRICT);
memset (&the_insn, 0, sizeof (the_insn));
+ need_cond = 1;
the_insn.reloc = R_HPPA_NONE;
else
break;
+ /* Condition is not required with "dc". */
+ need_cond = 0;
INSERT_FIELD_AND_CONTINUE (opcode, flag, 11);
/* Handle 32 bit carry for ADD. */
else
break;
+ /* Condition is not required with "db". */
+ need_cond = 0;
INSERT_FIELD_AND_CONTINUE (opcode, flag, 11);
/* Handle 32 bit borrow for SUB. */
as_bad (_("Invalid Add Condition: %s"), name);
*s = c;
}
+ /* Except with "dc", we have a match failure with
+ 'A' if we don't have a doubleword condition. */
+ else if (*args == 'A' && need_cond)
+ break;
+
opcode |= cmpltr << 13;
INSERT_FIELD_AND_CONTINUE (opcode, flag, 12);
s += 2;
}
else
- as_bad (_("Invalid Bit Branch Condition: %c"), *s);
+ as_bad (_("Invalid Branch On Bit Condition: %c"), *s);
}
+ else
+ as_bad (_("Missing Branch On Bit Condition"));
+
INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 15);
/* Handle a compare/subtract condition. */
name);
*s = c;
}
+ /* Except with "db", we have a match failure with
+ 'S' if we don't have a doubleword condition. */
+ else if (*args == 'S' && need_cond)
+ break;
+
opcode |= cmpltr << 13;
INSERT_FIELD_AND_CONTINUE (opcode, flag, 12);
INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13);
- /* Handle a logical instruction condition. */
+ /* Handle a logical instruction condition. */
case 'L':
case 'l':
cmpltr = 0;
as_bad (_("Invalid Logical Instruction Condition."));
*s = c;
}
+ /* 32-bit is default for no condition. */
+ else if (*args == 'L')
+ break;
+
opcode |= cmpltr << 13;
INSERT_FIELD_AND_CONTINUE (opcode, flag, 12);
as_bad (_("Invalid Shift/Extract/Deposit Condition."));
*s = c;
}
+
INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13);
/* Handle a unit instruction condition. */
else if (*args != 'U' || (*s != ' ' && *s != '\t'))
as_bad (_("Invalid Unit Instruction Condition."));
}
+ /* 32-bit is default for no condition. */
+ else if (*args == 'U')
+ break;
+
opcode |= cmpltr << 13;
INSERT_FIELD_AND_CONTINUE (opcode, flag, 12);
!= (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
return;
+ if (call_info->start_symbol == NULL)
+ /* This can happen if there were errors earlier on in the assembly. */
+ return;
+
/* Replace the start symbol with a local symbol that will be reduced
to a section offset. This avoids problems with weak functions with
multiple definitions, etc. */
/* Mark the end of the function, stuff away the location of the frag
for the end of the function, and finally call pa_build_unwind_subspace
to add an entry in the unwind table. */
+ (void) where;
hppa_elf_mark_end_of_function ();
pa_build_unwind_subspace (last_call_info);
#else
to the SOM BFD backend. */
#ifdef obj_set_symbol_type
obj_set_symbol_type (bfdsym, (int) type);
+#else
+ (void) type;
#endif
/* Now that the type of the exported symbol has been handled,
arg_reloc = pa_align_arg_reloc (temp, pa_build_arg_reloc (name));
#if defined (OBJ_SOM) || defined (ELF_ARG_RELOC)
symbol_arg_reloc_info (symbolP) |= arg_reloc;
+#else
+ (void) arg_reloc;
#endif
*input_line_pointer = c;
}
arg_reloc = pa_build_arg_reloc (name);
#if defined (OBJ_SOM) || defined (ELF_ARG_RELOC)
symbol_arg_reloc_info (symbolP) |= arg_reloc;
+#else
+ (void) arg_reloc;
#endif
*input_line_pointer = c;
}
{
char *name, *ss_name, c;
char loadable, code_only, comdat, common, dup_common, zero, sort;
- int i, access, space_index, alignment, quadrant, applicable, flags;
+ int i, access_ctr, space_index, alignment, quadrant, applicable, flags;
sd_chain_struct *space;
ssd_chain_struct *ssd;
asection *section;
/* Load default values. */
sort = 0;
- access = 0x7f;
+ access_ctr = 0x7f;
loadable = 1;
comdat = 0;
common = 0;
space_index = pa_def_subspaces[i].space_index;
alignment = pa_def_subspaces[i].alignment;
quadrant = pa_def_subspaces[i].quadrant;
- access = pa_def_subspaces[i].access;
+ access_ctr = pa_def_subspaces[i].access;
sort = pa_def_subspaces[i].sort;
break;
}
{
*input_line_pointer = c;
input_line_pointer++;
- access = get_absolute_expression ();
+ access_ctr = get_absolute_expression ();
}
else if ((strncasecmp (name, "sort", 4) == 0))
{
current_subspace = update_subspace (space, ss_name, loadable,
code_only, comdat, common,
- dup_common, sort, zero, access,
+ dup_common, sort, zero, access_ctr,
space_index, alignment, quadrant,
section);
else
current_subspace = create_new_subspace (space, ss_name, loadable,
code_only, comdat, common,
dup_common, zero, sort,
- access, space_index,
+ access_ctr, space_index,
alignment, quadrant, section);
demand_empty_rest_of_line ();
int dup_common,
int is_zero ATTRIBUTE_UNUSED,
int sort,
- int access,
+ int access_ctr,
int space_index ATTRIBUTE_UNUSED,
int alignment ATTRIBUTE_UNUSED,
int quadrant,
}
#ifdef obj_set_subsection_attributes
- obj_set_subsection_attributes (seg, space->sd_seg, access, sort,
+ obj_set_subsection_attributes (seg, space->sd_seg, access_ctr, sort,
quadrant, comdat, common, dup_common);
#endif
int dup_common,
int sort,
int zero ATTRIBUTE_UNUSED,
- int access,
+ int access_ctr,
int space_index ATTRIBUTE_UNUSED,
int alignment ATTRIBUTE_UNUSED,
int quadrant,
chain_entry = is_defined_subspace (name);
#ifdef obj_set_subsection_attributes
- obj_set_subsection_attributes (section, space->sd_seg, access, sort,
+ obj_set_subsection_attributes (section, space->sd_seg, access_ctr, sort,
quadrant, comdat, common, dup_common);
#endif