/* tc-s390.c -- Assemble for the S390
- Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2004, 2005
+ Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of GAS, the GNU Assembler.
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. */
#include <stdio.h>
#include "as.h"
symbolS *GOT_symbol; /* Pre-defined "_GLOBAL_OFFSET_TABLE_" */
#ifndef WORKING_DOT_WORD
-const int md_short_jump_size = 4;
-const int md_long_jump_size = 4;
+int md_short_jump_size = 4;
+int md_long_jump_size = 4;
#endif
const char *md_shortopts = "A:m:kVQ:";
current_cpu = S390_OPCODE_Z900;
else if (strcmp (arg + 5, "z990") == 0)
current_cpu = S390_OPCODE_Z990;
+ else if (strcmp (arg + 5, "z9-109") == 0)
+ current_cpu = S390_OPCODE_Z9_109;
else
{
as_bad (_("invalid switch -m%s"), arg);
/* If there is a next operand it must be separated by a comma. */
if (opindex_ptr[1] != '\0')
{
- if (*str++ != ',')
- as_bad (_("syntax error; expected ,"));
+ if (*str != ',')
+ {
+ while (opindex_ptr[1] != '\0')
+ {
+ operand = s390_operands + *(++opindex_ptr);
+ if (operand->flags & S390_OPERAND_OPTIONAL)
+ continue;
+ as_bad (_("syntax error; expected ,"));
+ break;
+ }
+ }
+ else
+ str++;
}
}
else
/* If there is a next operand it must be separated by a comma. */
if (opindex_ptr[1] != '\0')
{
- if (*str++ != ',')
- as_bad (_("syntax error; expected ,"));
+ if (*str != ',')
+ {
+ while (opindex_ptr[1] != '\0')
+ {
+ operand = s390_operands + *(++opindex_ptr);
+ if (operand->flags & S390_OPERAND_OPTIONAL)
+ continue;
+ as_bad (_("syntax error; expected ,"));
+ break;
+ }
+ }
+ else
+ str++;
}
}
else
/* If there is a next operand it must be separated by a comma. */
if (opindex_ptr[1] != '\0')
{
- if (*str++ != ',')
- as_bad (_("syntax error; expected ,"));
+ if (*str != ',')
+ {
+ while (opindex_ptr[1] != '\0')
+ {
+ operand = s390_operands + *(++opindex_ptr);
+ if (operand->flags & S390_OPERAND_OPTIONAL)
+ continue;
+ as_bad (_("syntax error; expected ,"));
+ break;
+ }
+ }
+ else
+ str++;
}
}
}
BFD_RELOC_UNUSED plus the operand index. This lets us easily
handle fixups for any operand type, although that is admittedly
not a very exciting feature. We pick a BFD reloc type in
- md_apply_fix3. */
+ md_apply_fix. */
for (i = 0; i < fc; i++)
{
if (exp.X_op == O_constant)
{
if ( ( opformat->oplen == 6
- && (addressT) exp.X_add_number >= 0
&& (addressT) exp.X_add_number < (1ULL << 48))
|| ( opformat->oplen == 4
- && (addressT) exp.X_add_number >= 0
&& (addressT) exp.X_add_number < (1ULL << 32))
|| ( opformat->oplen == 2
- && (addressT) exp.X_add_number >= 0
&& (addressT) exp.X_add_number < (1ULL << 16)))
- md_number_to_chars (insn, exp.X_add_number, opformat->oplen);
+ md_number_to_chars ((char *) insn, exp.X_add_number, opformat->oplen);
else
as_bad (_("Invalid .insn format\n"));
}
&& opformat->oplen == 6
&& generic_bignum[3] == 0)
{
- md_number_to_chars (insn, generic_bignum[2], 2);
- md_number_to_chars (&insn[2], generic_bignum[1], 2);
- md_number_to_chars (&insn[4], generic_bignum[0], 2);
+ md_number_to_chars ((char *) insn, generic_bignum[2], 2);
+ md_number_to_chars ((char *) &insn[2], generic_bignum[1], 2);
+ md_number_to_chars ((char *) &insn[4], generic_bignum[0], 2);
}
else
as_bad (_("Invalid .insn format\n"));
fixup. */
void
-md_apply_fix3 (fixP, valP, seg)
+md_apply_fix (fixP, valP, seg)
fixS *fixP;
valueT *valP;
segT seg ATTRIBUTE_UNUSED;
if (fixP->fx_done)
{
/* Insert the fully resolved operand value. */
- s390_insert_operand (where, operand, (offsetT) value,
- fixP->fx_file, fixP->fx_line);
+ s390_insert_operand ((unsigned char *) where, operand,
+ (offsetT) value, fixP->fx_file, fixP->fx_line);
return;
}
case BFD_RELOC_390_TLS_DTPMOD:
case BFD_RELOC_390_TLS_DTPOFF:
case BFD_RELOC_390_TLS_TPOFF:
+ S_SET_THREAD_LOCAL (fixP->fx_addsy);
/* Fully resolved at link time. */
break;
case BFD_RELOC_390_TLS_IEENT:
/* Fully resolved at link time. */
+ S_SET_THREAD_LOCAL (fixP->fx_addsy);
value += 2;
break;