/* tc-alpha.c - Processor-specific code for the DEC Alpha AXP CPU.
Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
Contributed by Carnegie Mellon University, 1993.
Written by Alessandro Forin, based on earlier gas-1.38 target CPU files.
Modified by Ken Raeburn for gas-2.x and ECOFF support.
GAS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ the Free Software Foundation; either version 3, or (at your option)
any later version.
GAS is distributed in the hope that it will be useful,
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
/* Mach Operating System
Copyright (c) 1993 Carnegie Mellon University
#define O_cpregister O_md2 /* + a leading comma. */
/* The alpha_reloc_op table below depends on the ordering of these. */
-#define O_literal O_md3 /* !literal relocation. */
-#define O_lituse_addr O_md4 /* !lituse_addr relocation. */
-#define O_lituse_base O_md5 /* !lituse_base relocation. */
-#define O_lituse_bytoff O_md6 /* !lituse_bytoff relocation. */
-#define O_lituse_jsr O_md7 /* !lituse_jsr relocation. */
-#define O_lituse_tlsgd O_md8 /* !lituse_tlsgd relocation. */
-#define O_lituse_tlsldm O_md9 /* !lituse_tlsldm relocation. */
-#define O_gpdisp O_md10 /* !gpdisp relocation. */
-#define O_gprelhigh O_md11 /* !gprelhigh relocation. */
-#define O_gprellow O_md12 /* !gprellow relocation. */
-#define O_gprel O_md13 /* !gprel relocation. */
-#define O_samegp O_md14 /* !samegp relocation. */
-#define O_tlsgd O_md15 /* !tlsgd relocation. */
-#define O_tlsldm O_md16 /* !tlsldm relocation. */
-#define O_gotdtprel O_md17 /* !gotdtprel relocation. */
-#define O_dtprelhi O_md18 /* !dtprelhi relocation. */
-#define O_dtprello O_md19 /* !dtprello relocation. */
-#define O_dtprel O_md20 /* !dtprel relocation. */
-#define O_gottprel O_md21 /* !gottprel relocation. */
-#define O_tprelhi O_md22 /* !tprelhi relocation. */
-#define O_tprello O_md23 /* !tprello relocation. */
-#define O_tprel O_md24 /* !tprel relocation. */
+#define O_literal O_md3 /* !literal relocation. */
+#define O_lituse_addr O_md4 /* !lituse_addr relocation. */
+#define O_lituse_base O_md5 /* !lituse_base relocation. */
+#define O_lituse_bytoff O_md6 /* !lituse_bytoff relocation. */
+#define O_lituse_jsr O_md7 /* !lituse_jsr relocation. */
+#define O_lituse_tlsgd O_md8 /* !lituse_tlsgd relocation. */
+#define O_lituse_tlsldm O_md9 /* !lituse_tlsldm relocation. */
+#define O_lituse_jsrdirect O_md10 /* !lituse_jsrdirect relocation. */
+#define O_gpdisp O_md11 /* !gpdisp relocation. */
+#define O_gprelhigh O_md12 /* !gprelhigh relocation. */
+#define O_gprellow O_md13 /* !gprellow relocation. */
+#define O_gprel O_md14 /* !gprel relocation. */
+#define O_samegp O_md15 /* !samegp relocation. */
+#define O_tlsgd O_md16 /* !tlsgd relocation. */
+#define O_tlsldm O_md17 /* !tlsldm relocation. */
+#define O_gotdtprel O_md18 /* !gotdtprel relocation. */
+#define O_dtprelhi O_md19 /* !dtprelhi relocation. */
+#define O_dtprello O_md20 /* !dtprello relocation. */
+#define O_dtprel O_md21 /* !dtprel relocation. */
+#define O_gottprel O_md22 /* !gottprel relocation. */
+#define O_tprelhi O_md23 /* !tprelhi relocation. */
+#define O_tprello O_md24 /* !tprello relocation. */
+#define O_tprel O_md25 /* !tprel relocation. */
#define DUMMY_RELOC_LITUSE_ADDR (BFD_RELOC_UNUSED + 1)
#define DUMMY_RELOC_LITUSE_BASE (BFD_RELOC_UNUSED + 2)
#define DUMMY_RELOC_LITUSE_JSR (BFD_RELOC_UNUSED + 4)
#define DUMMY_RELOC_LITUSE_TLSGD (BFD_RELOC_UNUSED + 5)
#define DUMMY_RELOC_LITUSE_TLSLDM (BFD_RELOC_UNUSED + 6)
+#define DUMMY_RELOC_LITUSE_JSRDIRECT (BFD_RELOC_UNUSED + 7)
#define USER_RELOC_P(R) ((R) >= O_literal && (R) <= O_tprel)
DEF (lituse_jsr, DUMMY_RELOC_LITUSE_JSR, 1, 1),
DEF (lituse_tlsgd, DUMMY_RELOC_LITUSE_TLSGD, 1, 1),
DEF (lituse_tlsldm, DUMMY_RELOC_LITUSE_TLSLDM, 1, 1),
+ DEF (lituse_jsrdirect, DUMMY_RELOC_LITUSE_JSRDIRECT, 1, 1),
DEF (gpdisp, BFD_RELOC_ALPHA_GPDISP, 1, 1),
DEF (gprelhigh, BFD_RELOC_ALPHA_GPREL_HI16, 0, 0),
DEF (gprellow, BFD_RELOC_ALPHA_GPREL_LO16, 0, 0),
case O_lituse_jsr: name = "O_lituse_jsr"; break;
case O_lituse_tlsgd: name = "O_lituse_tlsgd"; break;
case O_lituse_tlsldm: name = "O_lituse_tlsldm"; break;
+ case O_lituse_jsrdirect: name = "O_lituse_jsrdirect"; break;
case O_gpdisp: name = "O_gpdisp"; break;
case O_gprelhigh: name = "O_gprelhigh"; break;
case O_gprellow: name = "O_gprellow"; break;
case DUMMY_RELOC_LITUSE_TLSLDM:
fixP->fx_offset = LITUSE_ALPHA_TLSLDM;
goto do_lituse;
+ case DUMMY_RELOC_LITUSE_JSRDIRECT:
+ fixP->fx_offset = LITUSE_ALPHA_JSRDIRECT;
+ goto do_lituse;
do_lituse:
fixP->fx_addsy = section_symbol (now_seg);
fixP->fx_r_type = BFD_RELOC_ALPHA_LITUSE;
{
reloc_howto_type *reloc_howto
= bfd_reloc_type_lookup (stdoutput, reloc);
- if (reloc_howto->bitsize != reloc_operand->bits)
+ if (reloc_operand == NULL
+ || reloc_howto->bitsize != reloc_operand->bits)
{
as_bad (_("invalid relocation for field"));
return;
newtok[2] = newtok[0];
assemble_tokens ("or", newtok, 3, 1);
- /* Emit "stq_u $t9, 0($at)". */
- set_tok_reg (newtok[0], AXP_REG_T9);
- set_tok_const (newtok[1], 0);
- set_tok_preg (newtok[2], AXP_REG_AT);
- assemble_tokens ("stq_u", newtok, 3, 1);
-
/* Emit "stq_u $t10, size-1($at)". */
set_tok_reg (newtok[0], AXP_REG_T10);
set_tok_const (newtok[1], (1 << lgsize) - 1);
+ set_tok_preg (newtok[2], AXP_REG_AT);
+ assemble_tokens ("stq_u", newtok, 3, 1);
+
+ /* Emit "stq_u $t9, 0($at)". */
+ set_tok_reg (newtok[0], AXP_REG_T9);
+ set_tok_const (newtok[1], 0);
assemble_tokens ("stq_u", newtok, 3, 1);
}
subseg_set (new_seg, 0);
p = frag_more (temp);
new_seg->flags |= SEC_IS_COMMON;
- if (! S_IS_DEFINED (symbolP))
- S_SET_SEGMENT (symbolP, new_seg);
+ S_SET_SEGMENT (symbolP, new_seg);
#else
S_SET_VALUE (symbolP, (valueT) temp);
+ S_SET_SEGMENT (symbolP, bfd_com_section_ptr);
#endif
S_SET_EXTERNAL (symbolP);
}
{
alpha_current_align = 0;
alpha_insn_label = NULL;
- stringer (terminate);
+ stringer (8 + terminate);
}
/* Hook the normal space processing to reset known alignment. */
of LITTLENUMS emitted is stored in *SIZEP. An error message is
returned, or NULL on OK. */
-/* Equal to MAX_PRECISION in atof-ieee.c. */
-#define MAX_LITTLENUMS 6
-
-extern char *vax_md_atof (int, char *, int *);
-
char *
md_atof (int type, char *litP, int *sizeP)
{
- int prec;
- LITTLENUM_TYPE words[MAX_LITTLENUMS];
- LITTLENUM_TYPE *wordP;
- char *t;
+ extern char *vax_md_atof (int, char *, int *);
switch (type)
{
/* VAX floats. */
case 'G':
- /* VAX md_atof doesn't like "G" for some reason. */
+ /* vax_md_atof() doesn't like "G" for some reason. */
type = 'g';
case 'F':
case 'D':
return vax_md_atof (type, litP, sizeP);
- /* IEEE floats. */
- case 'f':
- prec = 2;
- break;
-
- case 'd':
- prec = 4;
- break;
-
- case 'x':
- case 'X':
- prec = 6;
- break;
-
- case 'p':
- case 'P':
- prec = 6;
- break;
-
default:
- *sizeP = 0;
- return _("Bad call to MD_ATOF()");
- }
- t = atof_ieee (input_line_pointer, type, words);
- if (t)
- input_line_pointer = t;
- *sizeP = prec * sizeof (LITTLENUM_TYPE);
-
- for (wordP = words + prec - 1; prec--;)
- {
- md_number_to_chars (litP, (long) (*wordP--), sizeof (LITTLENUM_TYPE));
- litP += sizeof (LITTLENUM_TYPE);
+ return ieee_md_atof (type, litP, sizeP, FALSE);
}
-
- return 0;
}
/* Take care of the target-specific command-line options. */
GPDISP. */
void
-md_apply_fix3 (fixS *fixP, valueT * valP, segT seg)
+md_apply_fix (fixS *fixP, valueT * valP, segT seg)
{
char * const fixpos = fixP->fx_frag->fr_literal + fixP->fx_where;
valueT value = * valP;
alpha_define_label (symbolS *sym)
{
alpha_insn_label = sym;
+#ifdef OBJ_ELF
+ dwarf2_emit_label (sym);
+#endif
}
/* Return true if we must always emit a reloc for a type and false if
symbol, the relocation will entirely be performed at link time, not
at assembly time. bfd_perform_reloc doesn't know about this sort
of thing, and as a result we need to fake it out here. */
- if ((S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy)
+ if ((S_IS_EXTERNAL (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy)
|| (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_MERGE)
|| (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_THREAD_LOCAL))
&& !S_IS_COMMON (fixp->fx_addsy))
/* The Alpha has support for some VAX floating point types, as well as for
IEEE floating point. We consider IEEE to be the primary floating point
format, and sneak in the VAX floating point support here. */
-#define md_atof vax_md_atof
#include "config/atof-vax.c"