/* tc-s390.c -- Assemble for the S390
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of GAS, the GNU Assembler.
/* Called after all assembly has been done. */
void
-s390_md_end (void)
+s390_md_finish (void)
{
if (s390_arch_size == 64)
bfd_set_arch_mach (stdoutput, bfd_arch_s390, bfd_mach_s390_64);
if (val < min || val > max)
{
const char *err =
- _("operand out of range (%s not between %ld and %ld)");
- char buf[100];
+ _("operand out of range (%" PRId64 " not between %" PRId64
+ " and %" PRId64 ")");
if (operand->flags & S390_OPERAND_PCREL)
{
- val <<= 1;
- min <<= 1;
- max <<= 1;
+ val = (offsetT) ((addressT) val << 1);
+ min = (offsetT) ((addressT) min << 1);
+ max = (offsetT) ((addressT) max << 1);
}
- bfd_sprintf_vma (stdoutput, buf, val);
if (file == (char *) NULL)
- as_bad (err, buf, (int) min, (int) max);
+ as_bad (err, (int64_t) val, (int64_t) min, (int64_t) max);
else
- as_bad_where (file, line, err, buf, (int) min, (int) max);
+ as_bad_where (file, line,
+ err, (int64_t) val, (int64_t) min, (int64_t) max);
return;
}
/* val is ok, now restrict it to operand->bits bits. */
/* Parse the operand. */
if (! register_name (&ex))
- expression (&ex);
+ {
+ expression (&ex);
+ resolve_register (&ex);
+ }
str = input_line_pointer;
input_line_pointer = hold;
md_apply_fix. */
for (i = 0; i < fc; i++)
{
+ fixS *fixP;
if (fixups[i].opindex < 0)
{
if (fixups[i].reloc != BFD_RELOC_UNUSED)
{
reloc_howto_type *reloc_howto;
- fixS *fixP;
int size;
reloc_howto = bfd_reloc_type_lookup (stdoutput, fixups[i].reloc);
fixP->fx_pcrel_adjust = operand->shift / 8;
}
else
- fix_new_exp (frag_now, f - frag_now->fr_literal, 4, &fixups[i].exp,
- (operand->flags & S390_OPERAND_PCREL) != 0,
- ((bfd_reloc_code_real_type)
- (fixups[i].opindex + (int) BFD_RELOC_UNUSED)));
+ fixP = fix_new_exp (frag_now, f - frag_now->fr_literal, 4,
+ &fixups[i].exp,
+ (operand->flags & S390_OPERAND_PCREL) != 0,
+ ((bfd_reloc_code_real_type)
+ (fixups[i].opindex + (int) BFD_RELOC_UNUSED)));
+ /* s390_insert_operand () does the range checking. */
+ if (operand->flags & S390_OPERAND_PCREL)
+ fixP->fx_no_overflow = 1;
}
return str;
}