/* read.c - read a source file -
- Copyright (C) 1986-2014 Free Software Foundation, Inc.
+ Copyright (C) 1986-2015 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
cfi_pop_insert ();
}
\f
-#define HANDLE_CONDITIONAL_ASSEMBLY() \
+#define HANDLE_CONDITIONAL_ASSEMBLY(num_read) \
if (ignore_input ()) \
{ \
- char *eol = find_end_of_line (input_line_pointer, flag_m68k_mri); \
+ char *eol = find_end_of_line (input_line_pointer - (num_read), \
+ flag_m68k_mri); \
input_line_pointer = (input_line_pointer <= buffer_limit \
&& eol >= buffer_limit) \
? buffer_limit \
char *line_start = input_line_pointer;
int mri_line_macro;
- HANDLE_CONDITIONAL_ASSEMBLY ();
+ HANDLE_CONDITIONAL_ASSEMBLY (0);
c = get_symbol_end ();
if (is_name_beginner (c))
{
/* Want user-defined label or pseudo/opcode. */
- HANDLE_CONDITIONAL_ASSEMBLY ();
+ HANDLE_CONDITIONAL_ASSEMBLY (1);
s = --input_line_pointer;
c = get_symbol_end (); /* name's delimiter. */
/* local label ("4:") */
char *backup = input_line_pointer;
- HANDLE_CONDITIONAL_ASSEMBLY ();
+ HANDLE_CONDITIONAL_ASSEMBLY (1);
temp = c - '0';
continue;
}
- HANDLE_CONDITIONAL_ASSEMBLY ();
+ HANDLE_CONDITIONAL_ASSEMBLY (1);
#ifdef tc_unrecognized_line
if (tc_unrecognized_line (c))
/* Switch in and out of alternate macro mode. */
-void
+static void
s_altmacro (int on)
{
demand_empty_rest_of_line ();
If a symbol name could not be read, the routine issues an error
messages, skips to the end of the line and returns NULL. */
-static char *
+char *
read_symbol_name (void)
{
char * name;
temp = get_absolute_expr (&exp);
size = temp;
- size &= ((offsetT) 2 << (stdoutput->arch_info->bits_per_address - 1)) - 1;
+ size &= ((addressT) 2 << (stdoutput->arch_info->bits_per_address - 1)) - 1;
if (exp.X_op == O_absent)
{
as_bad (_("missing size expression"));
symbol_set_frag (symbolP, dummy_frag);
}
#endif
-#ifdef OBJ_COFF
+#if defined (OBJ_COFF) && !defined (TE_PE)
/* "set" symbols are local unless otherwise specified. */
SF_SET_LOCAL (symbolP);
#endif
/* .reloc offset, reloc_name, symbol+addend. */
-void
+static void
s_reloc (int ignore ATTRIBUTE_UNUSED)
{
char *stop = NULL;
char *r_name;
int c;
struct reloc_list *reloc;
+ struct _bfd_rel { char *name; bfd_reloc_code_real_type code; };
+ static struct _bfd_rel bfd_relocs[] = {
+ { "NONE", BFD_RELOC_NONE },
+ { "8", BFD_RELOC_8 },
+ { "16", BFD_RELOC_16 },
+ { "32", BFD_RELOC_32 },
+ { "64", BFD_RELOC_64 }
+ };
reloc = (struct reloc_list *) xmalloc (sizeof (*reloc));
SKIP_WHITESPACE ();
r_name = input_line_pointer;
c = get_symbol_end ();
- reloc->u.a.howto = bfd_reloc_name_lookup (stdoutput, r_name);
+ if (strncasecmp (r_name, "BFD_RELOC_", 10) == 0)
+ {
+ unsigned int i;
+
+ for (reloc->u.a.howto = NULL, i = 0; i < ARRAY_SIZE (bfd_relocs); i++)
+ if (strcasecmp (r_name + 10, bfd_relocs[i].name) == 0)
+ {
+ reloc->u.a.howto = bfd_reloc_type_lookup (stdoutput,
+ bfd_relocs[i].code);
+ break;
+ }
+ }
+ else
+ reloc->u.a.howto = bfd_reloc_name_lookup (stdoutput, r_name);
*input_line_pointer = c;
if (reloc->u.a.howto == NULL)
{
void
emit_expr_fix (expressionS *exp, unsigned int nbytes, fragS *frag, char *p,
- TC_PARSE_CONS_RETURN_TYPE r)
+ TC_PARSE_CONS_RETURN_TYPE r ATTRIBUTE_UNUSED)
{
int offset = 0;
unsigned int size = nbytes;
&& (input_line_pointer[1] != '\''
|| (*input_line_pointer != 'A'
&& *input_line_pointer != 'E')))
- TC_PARSE_CONS_EXPRESSION (exp, nbytes);
+ (void) TC_PARSE_CONS_EXPRESSION (exp, nbytes);
else
{
unsigned int scan;
}
if (inquote)
as_warn (_("missing closing `%c'"), inquote);
- if (inescape)
+ if (inescape && !ignore_input ())
as_warn (_("stray `\\'"));
return s;
}