static int this_operand; /* Current operand we are working on. */
-static int flag_do_long_jump; /* FIXME what does this do? */
-
static int flag_16bit_code; /* 1 if we're writing 16-bit code,
0 if 32-bit. */
static int intel_syntax = 0; /* 1 for intel syntax, 0 if att syntax. */
-static const char *cpu_arch_name = NULL; /* cpu name */
-
-static unsigned int cpu_arch_flags = 0; /* cpu feature flags */
-
static int allow_naked_reg = 0; /* 1 if register prefix % not required */
static char stackop_size = '\0'; /* Used in 16 bit gcc mode to add an l
and pop instructions so that gcc has the
same stack frame as in 32 bit mode. */
+static int quiet_warnings = 0; /* Non-zero to quieten some warnings. */
+
+static const char *cpu_arch_name = NULL; /* cpu name */
+
+static unsigned int cpu_arch_flags = 0; /* cpu feature flags */
+
/* Interface to relax_segment.
There are 2 relax states for 386 jump insns: one for conditional &
one for unconditional jumps. This is because these two types of
return;
}
- if (!intel_syntax
- && (i.types[0] & JumpAbsolute) != (t->operand_types[0] & JumpAbsolute))
+ if (!quiet_warnings)
{
- as_warn (_("indirect %s without `*'"), t->name);
- }
+ if (!intel_syntax
+ && ((i.types[0] & JumpAbsolute)
+ != (t->operand_types[0] & JumpAbsolute)))
+ {
+ as_warn (_("indirect %s without `*'"), t->name);
+ }
- if ((t->opcode_modifier & (IsPrefix|IgnoreSize)) == (IsPrefix|IgnoreSize))
- {
- /* Warn them that a data or address size prefix doesn't affect
- assembly of the next line of code. */
- as_warn (_("stand-alone `%s' prefix"), t->name);
+ if ((t->opcode_modifier & (IsPrefix|IgnoreSize))
+ == (IsPrefix|IgnoreSize))
+ {
+ /* Warn them that a data or address size prefix doesn't
+ affect assembly of the next line of code. */
+ as_warn (_("stand-alone `%s' prefix"), t->name);
+ }
}
/* Copy the template we found. */
)
{
#if REGISTER_WARNINGS
- if ((i.tm.operand_types[op] & InOutPortReg) == 0)
+ if (!quiet_warnings
+ && (i.tm.operand_types[op] & InOutPortReg) == 0)
as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"),
(i.op[op].regs - (i.types[op] & Reg16 ? 8 : 16))->reg_name,
i.op[op].regs->reg_name,
}
#if REGISTER_WARNINGS
/* Warn if the e prefix on a general reg is missing. */
- else if ((i.types[op] & Reg16) != 0
+ else if (!quiet_warnings
+ && (i.types[op] & Reg16) != 0
&& (i.tm.operand_types[op] & (Reg32|Acc)) != 0)
{
as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"),
}
#if REGISTER_WARNINGS
/* Warn if the e prefix on a general reg is present. */
- else if ((i.types[op] & Reg32) != 0
+ else if (!quiet_warnings
+ && (i.types[op] & Reg32) != 0
&& (i.tm.operand_types[op] & (Reg16|Acc)) != 0)
{
as_warn (_("using `%%%s' instead of `%%%s' due to `%c' suffix"),
unsigned int op = (i.types[0] & (Reg | FloatReg)) ? 0 : 1;
/* Register goes in low 3 bits of opcode. */
i.tm.base_opcode |= i.op[op].regs->reg_num;
- if ((i.tm.opcode_modifier & Ugh) != 0)
+ if (!quiet_warnings && (i.tm.opcode_modifier & Ugh) != 0)
{
/* Warn about some common errors, but press on regardless.
The first case can be generated by gcc (<= 2.8.1). */
return;
}
}
- else if ((i.tm.opcode_modifier & Ugh) != 0)
+ else if (!quiet_warnings && (i.tm.opcode_modifier & Ugh) != 0)
{
/* UnixWare fsub no args is alias for fsubp, fadd -> faddp, etc. */
as_warn (_("translating to `%sp'"), i.tm.name);
md_create_long_jump (ptr, from_addr, to_addr, frag, to_symbol)
char *ptr;
addressT from_addr, to_addr;
- fragS *frag;
- symbolS *to_symbol;
+ fragS *frag ATTRIBUTE_UNUSED;
+ symbolS *to_symbol ATTRIBUTE_UNUSED;
{
offsetT offset;
- if (flag_do_long_jump)
- {
- offset = to_addr - S_GET_VALUE (to_symbol);
- md_number_to_chars (ptr, (valueT) 0xe9, 1);/* opcode for long jmp */
- md_number_to_chars (ptr + 1, (valueT) offset, 4);
- fix_new (frag, (ptr + 1) - frag->fr_literal, 4,
- to_symbol, (offsetT) 0, 0, BFD_RELOC_32);
- }
- else
- {
- offset = to_addr - (from_addr + 5);
- md_number_to_chars (ptr, (valueT) 0xe9, 1);
- md_number_to_chars (ptr + 1, (valueT) offset, 4);
- }
+ offset = to_addr - (from_addr + 5);
+ md_number_to_chars (ptr, (valueT) 0xe9, 1);
+ md_number_to_chars (ptr + 1, (valueT) offset, 4);
}
\f
/* Apply a fixup (fixS) to segment data, once it has been determined
{
switch (c)
{
- case 'm':
- flag_do_long_jump = 1;
+ case 'q':
+ quiet_warnings = 1;
break;
#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
- /* -k: Ignore for FreeBSD compatibility. */
- case 'k':
+ /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section
+ should be emitted or not. FIXME: Not implemented. */
+ case 'Q':
break;
/* -V: SVR4 argument to print version ID. */
print_version_id ();
break;
- /* -Qy, -Qn: SVR4 arguments controlling whether a .comment section
- should be emitted or not. FIXME: Not implemented. */
- case 'Q':
+ /* -k: Ignore for FreeBSD compatibility. */
+ case 'k':
break;
case 's':
/* -s: On i386 Solaris, this tells the native assembler to use
.stab instead of .stab.excl. We always use .stab anyhow. */
break;
-
- case 'q':
- /* -q: On i386 Solaris, this tells the native assembler to do
- fewer checks. */
- break;
#endif
default:
md_show_usage (stream)
FILE *stream;
{
- fprintf (stream, _("\
- -m do long jump\n"));
#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
fprintf (stream, _("\
- -V print assembler version number\n\
- -k ignored\n\
- -Qy, -Qn ignored\n\
- -q ignored\n\
- -s ignored\n"));
+ -Q ignored\n\
+ -V print assembler version number\n\
+ -k ignored\n\
+ -q quieten some warnings\n\
+ -s ignored\n"));
+#else
+ fprintf (stream, _("\
+ -q quieten some warnings\n"));
#endif
}