}
void
-c_dot_file_symbol (const char *filename, int appfile ATTRIBUTE_UNUSED)
+c_dot_file_symbol (const char *filename)
{
symbolS *symbolP;
}
static void
-obj_coff_ln (int appline)
+obj_coff_ln (int ignore ATTRIBUTE_UNUSED)
{
int l;
- if (! appline && def_symbol_in_progress != NULL)
+ if (def_symbol_in_progress != NULL)
{
as_warn (_(".ln pseudo-op inside .def/.endef: ignored."));
demand_empty_rest_of_line ();
l = get_absolute_expression ();
- /* If there is no lineno symbol, treat a .ln
- directive as if it were a .appline directive. */
- if (appline || current_lineno_sym == NULL)
+ /* If there is no lineno symbol, treat a .ln directive
+ as if it were a (no longer existing) .appline one. */
+ if (current_lineno_sym == NULL)
new_logical_line ((char *) NULL, l - 1);
else
add_lineno (frag_now, frag_now_fix (), l);
if (listing)
{
- if (! appline)
- l += coff_line_base - 1;
+ l += coff_line_base - 1;
listing_source_line (l);
}
}
{
if (symbol_rootP == NULL
|| S_GET_STORAGE_CLASS (symbol_rootP) != C_FILE)
- c_dot_file_symbol ("fake", 0);
+ c_dot_file_symbol ("fake");
}
void
const pseudo_typeS coff_pseudo_table[] =
{
{"ABORT", s_abort, 0},
- {"appline", obj_coff_ln, 1},
/* We accept the .bss directive for backward compatibility with
earlier versions of gas. */
{"bss", obj_coff_bss, 0},
extern symbolS *coff_last_function;
#define obj_emit_lineno(WHERE, LINE, FILE_START) abort ()
-#define obj_app_file(name, app) c_dot_file_symbol (name, app)
+#define obj_app_file(name) c_dot_file_symbol (name)
#define obj_frob_symbol(S,P) coff_frob_symbol (S, & P)
#define obj_frob_section(S) coff_frob_section (S)
#define obj_frob_file_after_relocs() coff_frob_file_after_relocs ()
SA_SET_SCN_NRELOC (section_symbol (sec), n)
#endif
-#define obj_app_file(name, app) c_dot_file_symbol (name, app)
-
extern int S_SET_DATA_TYPE (symbolS *, int);
extern int S_SET_STORAGE_CLASS (symbolS *, int);
extern int S_GET_STORAGE_CLASS (symbolS *);
extern void SA_SET_SYM_ENDNDX (symbolS *, symbolS *);
extern void coff_add_linesym (symbolS *);
-extern void c_dot_file_symbol (const char *, int);
+extern void c_dot_file_symbol (const char *);
extern void coff_frob_symbol (symbolS *, int *);
extern void coff_adjust_symtab (void);
extern void coff_frob_section (segT);
extern void obj_coff_section (int);
extern segT obj_coff_add_segment (const char *);
extern void obj_coff_section (int);
-extern void c_dot_file_symbol (const char *, int);
extern segT s_get_segment (symbolS *);
#ifndef tc_coff_symbol_emit_hook
extern void tc_coff_symbol_emit_hook (symbolS *);
#define obj_symbol_clone_hook ecoff_symbol_clone_hook
/* Record file switches in the ECOFF symbol table. */
-#define obj_app_file(name, app) ecoff_new_file (name, app)
+#define obj_app_file(name) ecoff_new_file (name)
/* At the moment we don't want to do any stabs processing in read.c. */
#define OBJ_PROCESS_STAB(seg, what, string, type, other, desc) \
}
void
-elf_file_symbol (const char *s, int appfile)
+elf_file_symbol (const char *s)
{
asymbol *bsym;
+ symbolS *sym = symbol_new (s, absolute_section, &zero_address_frag, 0);
+ size_t name_length = strlen (s);
- if (!appfile
- || symbol_rootP == NULL
- || (bsym = symbol_get_bfdsym (symbol_rootP)) == NULL
- || (bsym->flags & BSF_FILE) == 0)
+ if (name_length > strlen (S_GET_NAME (sym)))
{
- symbolS *sym;
- size_t name_length;
-
- sym = symbol_new (s, absolute_section, &zero_address_frag, 0);
-
- name_length = strlen (s);
- if (name_length > strlen (S_GET_NAME (sym)))
- {
- obstack_grow (¬es, s, name_length + 1);
- S_SET_NAME (sym, (const char *) obstack_finish (¬es));
- }
- else
- strcpy ((char *) S_GET_NAME (sym), s);
+ obstack_grow (¬es, s, name_length + 1);
+ S_SET_NAME (sym, (const char *) obstack_finish (¬es));
+ }
+ else
+ strcpy ((char *) S_GET_NAME (sym), s);
- symbol_get_bfdsym (sym)->flags |= BSF_FILE;
+ symbol_get_bfdsym (sym)->flags |= BSF_FILE;
- if (symbol_rootP != sym
- && ((bsym = symbol_get_bfdsym (symbol_rootP)) == NULL
- || (bsym->flags & BSF_FILE) == 0))
- {
- symbol_remove (sym, &symbol_rootP, &symbol_lastP);
- symbol_insert (sym, symbol_rootP, &symbol_rootP, &symbol_lastP);
- }
+ if (symbol_rootP != sym
+ && ((bsym = symbol_get_bfdsym (symbol_rootP)) == NULL
+ || (bsym->flags & BSF_FILE) == 0))
+ {
+ symbol_remove (sym, &symbol_rootP, &symbol_lastP);
+ symbol_insert (sym, symbol_rootP, &symbol_rootP, &symbol_lastP);
+ }
#ifdef DEBUG
- verify_symbol_chain (symbol_rootP, symbol_lastP);
+ verify_symbol_chain (symbol_rootP, symbol_lastP);
#endif
- }
#ifdef NEED_ECOFF_DEBUG
- ecoff_new_file (s, appfile);
+ ecoff_new_file (s);
#endif
}
#ifndef obj_app_file
#define obj_app_file elf_file_symbol
#endif
-extern void elf_file_symbol (const char *, int);
+extern void elf_file_symbol (const char *);
extern void obj_elf_section_change_hook (void);
? (*this_format->begin) () \
: (void) 0)
-#define obj_app_file(NAME, APPFILE) \
+#define obj_app_file(NAME) \
(this_format->app_file \
- ? (*this_format->app_file) (NAME, APPFILE) \
+ ? (*this_format->app_file) (NAME) \
: (void) 0)
#define obj_frob_symbol(S,P) \
if (ECOFF_DEBUGGING)
{
get_number ();
- s_app_file (0);
+ s_file (0);
}
else
{
if (filename != NULL && ! first_file_directive)
{
(void) new_logical_line (filename, -1);
- s_app_file_string (filename, 0);
+ s_file_string (filename);
}
first_file_directive = 1;
}
}
/* Use coff dot_file creation and adjust auxiliary entries. */
- c_dot_file_symbol (sfname, 0);
+ c_dot_file_symbol (sfname);
S_SET_NUMBER_AUXILIARY (symbol_rootP, auxnb);
coffsym = coffsymbol (symbol_get_bfdsym (symbol_rootP));
coffsym->native[1].u.auxent.x_file.x_ftype = XFT_FN;
{
unsigned lineno;
const char * filename = as_where (&lineno);
- c_dot_file_symbol (filename, 0);
+ c_dot_file_symbol (filename);
}
}
{"segm" , s_segm , 1},
{"unsegm" , s_segm , 0},
{"unseg" , s_segm , 0},
- {"name" , s_app_file , 0},
+ {"name" , s_file , 0},
{"global" , s_globl , 0},
{"wval" , cons , 2},
{"lval" , cons , 4},
}
/* Handle two forms of .file directive:
- - Pass .file "source.c" to s_app_file
+ - Pass .file "source.c" to s_file
- Handle .file 1 "source.c" by adding an entry to the DWARF-2 file table
If an entry is added to the file table, return a pointer to the filename. */
SKIP_WHITESPACE ();
if (*input_line_pointer == '"')
{
- s_app_file (0);
+ s_file (0);
return NULL;
}
compiler output, only in hand coded assembler. */
void
-ecoff_new_file (const char *name, int appfile ATTRIBUTE_UNUSED)
+ecoff_new_file (const char *name)
{
if (cur_file_ptr != NULL && filename_cmp (cur_file_ptr->name, name) == 0)
return;
/* This function should be called when the assembler switches to a new
file. */
-extern void ecoff_new_file (const char *, int);
+extern void ecoff_new_file (const char *);
/* This function should be called when a new symbol is created, by
obj_symbol_new_hook. */
\f
/* Tells us what the new logical line number and file are.
If the line_number is -1, we don't change the current logical line
- number. If it is -2, we decrement the logical line number (this is
- to support the .appfile pseudo-op inserted into the stream by
- do_scrub_chars).
+ number.
If fname is NULL, we don't change the current logical file name, unless
bit 3 of flags is set.
Returns nonzero if the filename actually changes. */
ptr->ptr[ptr->len] = '\0';
temp_ilp (ptr->ptr + i + 8);
- s_app_line (0);
+ s_linefile (0);
restore_ilp ();
ptr->ptr[ptr->len] = saved_eol_char;
ptr->len = line_start;
unsigned dfl_leading_underscore : 1;
unsigned emit_section_symbols : 1;
void (*begin) (void);
- void (*app_file) (const char *, int);
+ void (*app_file) (const char *);
void (*frob_symbol) (symbolS *, int *);
void (*frob_file) (void);
void (*frob_file_before_adjust) (void);
{"exitm", s_mexit, 0},
/* extend */
{"extern", s_ignore, 0}, /* We treat all undef as ext. */
- {"appfile", s_app_file, 1},
- {"appline", s_app_line, 1},
{"fail", s_fail, 0},
- {"file", s_app_file, 0},
+ {"file", s_file, 0},
{"fill", s_fill, 0},
{"float", float_cons, 'f'},
{"format", s_ignore, 0},
{"irepc", s_irp, 1},
{"lcomm", s_lcomm, 0},
{"lflags", s_ignore, 0}, /* Listing flags. */
- {"linefile", s_app_line, 0},
+ {"linefile", s_linefile, 0},
{"linkonce", s_linkonce, 0},
{"list", listing_list, 1}, /* Turn listing on. */
{"llen", listing_psize, 1},
demand_empty_rest_of_line ();
}
-/* Handle the .appfile pseudo-op. This is automatically generated by
- do_scrub_chars when a preprocessor # line comment is seen with a
- file name. This default definition may be overridden by the object
- or CPU specific pseudo-ops. This function is also the default
- definition for .file; the APPFILE argument is 1 for .appfile, 0 for
- .file. */
+/* Handle the .file pseudo-op. This default definition may be overridden by
+ the object or CPU specific pseudo-ops. */
void
-s_app_file_string (char *file, int appfile ATTRIBUTE_UNUSED)
+s_file_string (char *file)
{
#ifdef LISTING
if (listing)
#endif
register_dependency (file);
#ifdef obj_app_file
- obj_app_file (file, appfile);
+ obj_app_file (file);
#endif
}
void
-s_app_file (int appfile)
+s_file (int ignore ATTRIBUTE_UNUSED)
{
char *s;
int length;
/* Some assemblers tolerate immediately following '"'. */
if ((s = demand_copy_string (&length)) != 0)
{
- int may_omit
- = (!new_logical_line_flags (s, -1, 1) && appfile);
+ new_logical_line_flags (s, -1, 1);
/* In MRI mode, the preprocessor may have inserted an extraneous
backquote. */
++input_line_pointer;
demand_empty_rest_of_line ();
- if (!may_omit)
- s_app_file_string (s, appfile);
+ s_file_string (s);
}
}
return 1;
}
-/* Handle the .appline pseudo-op. This is automatically generated by
+/* Handle the .linefile pseudo-op. This is automatically generated by
do_scrub_chars when a preprocessor # line comment is seen. This
default definition may be overridden by the object or CPU specific
pseudo-ops. */
void
-s_app_line (int appline)
+s_linefile (int ignore ATTRIBUTE_UNUSED)
{
char *file = NULL;
int linenum, flags = 0;
/* The given number is that of the next line. */
- if (appline)
- linenum = get_absolute_expression ();
- else if (!get_linefile_number (&linenum))
+ if (!get_linefile_number (&linenum))
{
ignore_rest_of_line ();
return;
{
int length = 0;
- if (!appline)
+ SKIP_WHITESPACE ();
+
+ if (*input_line_pointer == '"')
+ file = demand_copy_string (&length);
+ else if (*input_line_pointer == '.')
{
- SKIP_WHITESPACE ();
+ /* buffer_and_nest() may insert this form. */
+ ++input_line_pointer;
+ flags = 1 << 3;
+ }
- if (*input_line_pointer == '"')
- file = demand_copy_string (&length);
- else if (*input_line_pointer == '.')
- {
- /* buffer_and_nest() may insert this form. */
- ++input_line_pointer;
- flags = 1 << 3;
- }
+ if (file)
+ {
+ int this_flag;
- if (file)
- {
- int this_flag;
+ while (get_linefile_number (&this_flag))
+ switch (this_flag)
+ {
+ /* From GCC's cpp documentation:
+ 1: start of a new file.
+ 2: returning to a file after having included another file.
+ 3: following text comes from a system header file.
+ 4: following text should be treated as extern "C".
+
+ 4 is nonsensical for the assembler; 3, we don't care about,
+ so we ignore it just in case a system header file is
+ included while preprocessing assembly. So 1 and 2 are all
+ we care about, and they are mutually incompatible.
+ new_logical_line_flags() demands this. */
+ case 1:
+ case 2:
+ if (flags && flags != (1 << this_flag))
+ as_warn (_("incompatible flag %i in line directive"),
+ this_flag);
+ else
+ flags |= 1 << this_flag;
+ break;
- while (get_linefile_number (&this_flag))
- switch (this_flag)
- {
- /* From GCC's cpp documentation:
- 1: start of a new file.
- 2: returning to a file after having included
- another file.
- 3: following text comes from a system header file.
- 4: following text should be treated as extern "C".
-
- 4 is nonsensical for the assembler; 3, we don't
- care about, so we ignore it just in case a
- system header file is included while
- preprocessing assembly. So 1 and 2 are all we
- care about, and they are mutually incompatible.
- new_logical_line_flags() demands this. */
- case 1:
- case 2:
- if (flags && flags != (1 << this_flag))
- as_warn (_("incompatible flag %i in line directive"),
- this_flag);
- else
- flags |= 1 << this_flag;
- break;
-
- case 3:
- case 4:
- /* We ignore these. */
- break;
-
- default:
- as_warn (_("unsupported flag %i in line directive"),
- this_flag);
- break;
- }
+ case 3:
+ case 4:
+ /* We ignore these. */
+ break;
- if (!is_end_of_line[(unsigned char)*input_line_pointer])
- file = 0;
- }
- }
+ default:
+ as_warn (_("unsupported flag %i in line directive"),
+ this_flag);
+ break;
+ }
+
+ if (!is_end_of_line[(unsigned char)*input_line_pointer])
+ file = NULL;
+ }
- if (appline || file || flags)
+ if (file || flags)
{
linenum--;
new_logical_line_flags (file, linenum, flags);
#endif
}
}
- if (appline || file || flags)
+ if (file || flags)
demand_empty_rest_of_line ();
else
ignore_rest_of_line ();
extern offsetT parse_align (int);
extern symbolS *s_comm_internal (int, symbolS *(*) (int, symbolS *, addressT));
extern symbolS *s_lcomm_internal (int, symbolS *, addressT);
-extern void s_app_file_string (char *, int);
-extern void s_app_file (int);
-extern void s_app_line (int);
+extern void s_file_string (char *);
+extern void s_file (int);
+extern void s_linefile (int);
extern void s_bundle_align_mode (int);
extern void s_bundle_lock (int);
extern void s_bundle_unlock (int);