diff options
author | Ken Raeburn <raeburn@cygnus> | 1995-05-02 19:30:17 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@cygnus> | 1995-05-02 19:30:17 +0000 |
commit | 2209b19c4edfad132bd94a4097485d2f199f1f79 (patch) | |
tree | 9d9cc8f64a5424608f06b3ff6f9ec1d4b8002267 /gas/read.c | |
parent | 833c46e1fb582eab40e4bb67cc7ab1b6753bd370 (diff) | |
download | gdb-2209b19c4edfad132bd94a4097485d2f199f1f79.zip gdb-2209b19c4edfad132bd94a4097485d2f199f1f79.tar.gz gdb-2209b19c4edfad132bd94a4097485d2f199f1f79.tar.bz2 |
(pop_insert): New function.
(pop_override_ok, pop_table_name): New variables.
(md_pop_insert, obj_pop_insert): New macros.
(pobegin): Use them.
(target_big_endian): If TARGET_BYTES_BIG_ENDIAN is defined, initialize to 1.
Diffstat (limited to 'gas/read.c')
-rw-r--r-- | gas/read.c | 102 |
1 files changed, 46 insertions, 56 deletions
@@ -141,7 +141,17 @@ char is_end_of_line[256] = static char *buffer; /* 1st char of each buffer of lines is here. */ static char *buffer_limit; /*->1 + last char in buffer. */ -int target_big_endian; +#ifdef TARGET_BYTES_BIG_ENDIAN +/* Hack to deal with tc-*.h defining TARGET_BYTES_BIG_ENDIAN to empty + instead of to 0 or 1. */ +#if 5 - TARGET_BYTES_BIG_ENDIAN - 5 == 10 +#undef TARGET_BYTES_BIG_ENDIAN +#define TARGET_BYTES_BIG_ENDIAN 1 +#endif +int target_big_endian = TARGET_BYTES_BIG_ENDIAN; +#else +int target_big_endian /* = 0 */; +#endif static char *old_buffer; /* JF a hack */ static char *old_input; @@ -278,66 +288,49 @@ static const pseudo_typeS potable[] = {NULL} /* end sentinel */ }; -static void -pobegin () +static int pop_override_ok = 0; +static const char *pop_table_name; + +void +pop_insert (table) + const pseudo_typeS *table; { - const char *errtxt; /* error text */ + const char *errtxt; const pseudo_typeS *pop; + for (pop = table; pop->poc_name; pop++) + { + errtxt = hash_insert (po_hash, pop->poc_name, (char *) pop); + if (errtxt && (!pop_override_ok || strcmp (errtxt, "exists"))) + as_fatal ("error constructing %s pseudo-op table", pop_table_name); + } +} + +#ifndef md_pop_insert +#define md_pop_insert() pop_insert(md_pseudo_table) +#endif + +#ifndef obj_pop_insert +#define obj_pop_insert() pop_insert(obj_pseudo_table) +#endif +static void +pobegin () +{ po_hash = hash_new (); /* Do the target-specific pseudo ops. */ - for (pop = md_pseudo_table; pop->poc_name; pop++) - { - errtxt = hash_insert (po_hash, pop->poc_name, (char *) pop); - if (errtxt) - { - as_fatal ("error constructing md pseudo-op table"); - } /* on error */ - } /* for each op */ + pop_table_name = "md"; + md_pop_insert (); /* Now object specific. Skip any that were in the target table. */ - for (pop = obj_pseudo_table; pop->poc_name; pop++) - { - errtxt = hash_insert (po_hash, pop->poc_name, (char *) pop); - if (errtxt) - { - if (!strcmp (errtxt, "exists")) - { -#ifdef DIE_ON_OVERRIDES - as_fatal ("pseudo op \".%s\" overridden.\n", pop->poc_name); -#endif /* DIE_ON_OVERRIDES */ - continue; /* OK if target table overrides. */ - } - else - { - as_fatal ("error constructing obj pseudo-op table"); - } /* if overridden */ - } /* on error */ - } /* for each op */ + pop_table_name = "obj"; + pop_override_ok = 1; + obj_pop_insert (); /* Now portable ones. Skip any that we've seen already. */ - for (pop = potable; pop->poc_name; pop++) - { - errtxt = hash_insert (po_hash, pop->poc_name, (char *) pop); - if (errtxt) - { - if (!strcmp (errtxt, "exists")) - { -#ifdef DIE_ON_OVERRIDES - as_fatal ("pseudo op \".%s\" overridden.\n", pop->poc_name); -#endif /* DIE_ON_OVERRIDES */ - continue; /* OK if target table overrides. */ - } - else - { - as_fatal ("error constructing obj pseudo-op table"); - } /* if overridden */ - } /* on error */ - } /* for each op */ - - return; -} /* pobegin() */ + pop_table_name = "standard"; + pop_insert (potable); +} #define HANDLE_CONDITIONAL_ASSEMBLY() \ if (ignore_input ()) \ @@ -969,11 +962,8 @@ s_app_file (appfile) listing_source_file (s); #endif } -#ifdef OBJ_COFF - c_dot_file_symbol (s); -#endif /* OBJ_COFF */ -#ifdef OBJ_ELF - elf_file_symbol (s); +#ifdef obj_app_file + obj_app_file (s); #endif } |