* ecoff.c: Convert to ISO-C.

* ecoff.h: Likewise.
This commit is contained in:
Kazu Hirata 2003-11-22 00:20:48 +00:00
parent b05aa31a76
commit 834ddcc491
3 changed files with 208 additions and 259 deletions

View file

@ -1,3 +1,8 @@
2003-11-21 Kazu Hirata <kazu@cs.umass.edu>
* ecoff.c: Convert to ISO-C.
* ecoff.h: Likewise.
2003-11-22 Alan Modra <amodra@bigpond.net.au> 2003-11-22 Alan Modra <amodra@bigpond.net.au>
* config/tc-ppc.c (parse_cpu): New function, broken out from.. * config/tc-ppc.c (parse_cpu): New function, broken out from..

View file

@ -1408,76 +1408,74 @@ static char stabs_symbol[] = STABS_SYMBOL;
/* Prototypes for functions defined in this file. */ /* Prototypes for functions defined in this file. */
static void add_varray_page PARAMS ((varray_t *vp)); static void add_varray_page (varray_t *vp);
static symint_t add_string PARAMS ((varray_t *vp, static symint_t add_string (varray_t *vp,
struct hash_control *hash_tbl, struct hash_control *hash_tbl,
const char *str, const char *str,
shash_t **ret_hash)); shash_t **ret_hash);
static localsym_t *add_ecoff_symbol PARAMS ((const char *str, st_t type, static localsym_t *add_ecoff_symbol (const char *str, st_t type,
sc_t storage, symbolS *sym, sc_t storage, symbolS *sym,
bfd_vma addend, symint_t value, bfd_vma addend, symint_t value,
symint_t indx)); symint_t indx);
static symint_t add_aux_sym_symint PARAMS ((symint_t aux_word)); static symint_t add_aux_sym_symint (symint_t aux_word);
static symint_t add_aux_sym_rndx PARAMS ((int file_index, static symint_t add_aux_sym_rndx (int file_index, symint_t sym_index);
symint_t sym_index)); static symint_t add_aux_sym_tir (type_info_t *t,
static symint_t add_aux_sym_tir PARAMS ((type_info_t *t,
hash_state_t state, hash_state_t state,
thash_t **hash_tbl)); thash_t **hash_tbl);
static tag_t *get_tag PARAMS ((const char *tag, localsym_t *sym, static tag_t *get_tag (const char *tag, localsym_t *sym, bt_t basic_type);
bt_t basic_type)); static void add_unknown_tag (tag_t *ptag);
static void add_unknown_tag PARAMS ((tag_t *ptag)); static void add_procedure (char *func);
static void add_procedure PARAMS ((char *func)); static void add_file (const char *file_name, int indx, int fake);
static void add_file PARAMS ((const char *file_name, int indx, int fake));
#ifdef ECOFF_DEBUG #ifdef ECOFF_DEBUG
static char *sc_to_string PARAMS ((sc_t storage_class)); static char *sc_to_string (sc_t storage_class);
static char *st_to_string PARAMS ((st_t symbol_type)); static char *st_to_string (st_t symbol_type);
#endif #endif
static void mark_stabs PARAMS ((int)); static void mark_stabs (int);
static char *ecoff_add_bytes PARAMS ((char **buf, char **bufend, static char *ecoff_add_bytes (char **buf, char **bufend,
char *bufptr, unsigned long need)); char *bufptr, unsigned long need);
static unsigned long ecoff_padding_adjust static unsigned long ecoff_padding_adjust
PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
unsigned long offset, char **bufptrptr)); unsigned long offset, char **bufptrptr);
static unsigned long ecoff_build_lineno static unsigned long ecoff_build_lineno
PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
unsigned long offset, long *linecntptr)); unsigned long offset, long *linecntptr);
static unsigned long ecoff_build_symbols static unsigned long ecoff_build_symbols
PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
unsigned long offset)); unsigned long offset);
static unsigned long ecoff_build_procs static unsigned long ecoff_build_procs
PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
unsigned long offset)); unsigned long offset);
static unsigned long ecoff_build_aux static unsigned long ecoff_build_aux
PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
unsigned long offset)); unsigned long offset);
static unsigned long ecoff_build_strings PARAMS ((char **buf, char **bufend, static unsigned long ecoff_build_strings (char **buf, char **bufend,
unsigned long offset, unsigned long offset,
varray_t *vp)); varray_t *vp);
static unsigned long ecoff_build_ss static unsigned long ecoff_build_ss
PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
unsigned long offset)); unsigned long offset);
static unsigned long ecoff_build_fdr static unsigned long ecoff_build_fdr
PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, (const struct ecoff_debug_swap *backend, char **buf, char **bufend,
unsigned long offset)); unsigned long offset);
static void ecoff_setup_ext PARAMS ((void)); static void ecoff_setup_ext (void);
static page_type *allocate_cluster PARAMS ((unsigned long npages)); static page_type *allocate_cluster (unsigned long npages);
static page_type *allocate_page PARAMS ((void)); static page_type *allocate_page (void);
static scope_t *allocate_scope PARAMS ((void)); static scope_t *allocate_scope (void);
static void free_scope PARAMS ((scope_t *ptr)); static void free_scope (scope_t *ptr);
static vlinks_t *allocate_vlinks PARAMS ((void)); static vlinks_t *allocate_vlinks (void);
static shash_t *allocate_shash PARAMS ((void)); static shash_t *allocate_shash (void);
static thash_t *allocate_thash PARAMS ((void)); static thash_t *allocate_thash (void);
static tag_t *allocate_tag PARAMS ((void)); static tag_t *allocate_tag (void);
static void free_tag PARAMS ((tag_t *ptr)); static void free_tag (tag_t *ptr);
static forward_t *allocate_forward PARAMS ((void)); static forward_t *allocate_forward (void);
static thead_t *allocate_thead PARAMS ((void)); static thead_t *allocate_thead (void);
static void free_thead PARAMS ((thead_t *ptr)); static void free_thead (thead_t *ptr);
static lineno_list_t *allocate_lineno_list PARAMS ((void)); static lineno_list_t *allocate_lineno_list (void);
/* This function should be called when the assembler starts up. */ /* This function should be called when the assembler starts up. */
void void
ecoff_read_begin_hook () ecoff_read_begin_hook (void)
{ {
tag_hash = hash_new (); tag_hash = hash_new ();
top_tag_head = allocate_thead (); top_tag_head = allocate_thead ();
@ -1490,8 +1488,7 @@ ecoff_read_begin_hook ()
/* This function should be called when a symbol is created. */ /* This function should be called when a symbol is created. */
void void
ecoff_symbol_new_hook (symbolP) ecoff_symbol_new_hook (symbolS *symbolP)
symbolS *symbolP;
{ {
OBJ_SYMFIELD_TYPE *obj; OBJ_SYMFIELD_TYPE *obj;
@ -1512,8 +1509,7 @@ ecoff_symbol_new_hook (symbolP)
/* Add a page to a varray object. */ /* Add a page to a varray object. */
static void static void
add_varray_page (vp) add_varray_page (varray_t *vp /* varray to add page to */)
varray_t *vp; /* varray to add page to */
{ {
vlinks_t *new_links = allocate_vlinks (); vlinks_t *new_links = allocate_vlinks ();
@ -1543,11 +1539,10 @@ add_varray_page (vp)
/* Add a string (and null pad) to one of the string tables. */ /* Add a string (and null pad) to one of the string tables. */
static symint_t static symint_t
add_string (vp, hash_tbl, str, ret_hash) add_string (varray_t *vp, /* string obstack */
varray_t *vp; /* string obstack */ struct hash_control *hash_tbl, /* ptr to hash table */
struct hash_control *hash_tbl; /* ptr to hash table */ const char *str, /* string */
const char *str; /* string */ shash_t **ret_hash /* return hash pointer */)
shash_t **ret_hash; /* return hash pointer */
{ {
register unsigned long len = strlen (str); register unsigned long len = strlen (str);
register shash_t *hash_ptr; register shash_t *hash_ptr;
@ -1592,14 +1587,13 @@ add_string (vp, hash_tbl, str, ret_hash)
/* Add debugging information for a symbol. */ /* Add debugging information for a symbol. */
static localsym_t * static localsym_t *
add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx) add_ecoff_symbol (const char *str, /* symbol name */
const char *str; /* symbol name */ st_t type, /* symbol type */
st_t type; /* symbol type */ sc_t storage, /* storage class */
sc_t storage; /* storage class */ symbolS *sym_value, /* associated symbol. */
symbolS *sym_value; /* associated symbol. */ bfd_vma addend, /* addend to sym_value. */
bfd_vma addend; /* addend to sym_value. */ symint_t value, /* value of symbol */
symint_t value; /* value of symbol */ symint_t indx /* index to local/aux. syms */)
symint_t indx; /* index to local/aux. syms */
{ {
localsym_t *psym; localsym_t *psym;
register scope_t *pscope; register scope_t *pscope;
@ -1798,8 +1792,7 @@ add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx)
for integral aux types, not just symints. */ for integral aux types, not just symints. */
static symint_t static symint_t
add_aux_sym_symint (aux_word) add_aux_sym_symint (symint_t aux_word /* auxiliary information word */)
symint_t aux_word; /* auxiliary information word */
{ {
register varray_t *vp; register varray_t *vp;
register aux_t *aux_ptr; register aux_t *aux_ptr;
@ -1822,9 +1815,7 @@ add_aux_sym_symint (aux_word)
/* Add an auxiliary symbol (passing a file/symbol index combo). */ /* Add an auxiliary symbol (passing a file/symbol index combo). */
static symint_t static symint_t
add_aux_sym_rndx (file_index, sym_index) add_aux_sym_rndx (int file_index, symint_t sym_index)
int file_index;
symint_t sym_index;
{ {
register varray_t *vp; register varray_t *vp;
register aux_t *aux_ptr; register aux_t *aux_ptr;
@ -1849,10 +1840,9 @@ add_aux_sym_rndx (file_index, sym_index)
type qualifiers). */ type qualifiers). */
static symint_t static symint_t
add_aux_sym_tir (t, state, hash_tbl) add_aux_sym_tir (type_info_t *t, /* current type information */
type_info_t *t; /* current type information */ hash_state_t state, /* whether to hash type or not */
hash_state_t state; /* whether to hash type or not */ thash_t **hash_tbl /* pointer to hash table to use */)
thash_t **hash_tbl; /* pointer to hash table to use */
{ {
register varray_t *vp; register varray_t *vp;
register aux_t *aux_ptr; register aux_t *aux_ptr;
@ -2006,10 +1996,9 @@ add_aux_sym_tir (t, state, hash_tbl)
/* Add a tag to the tag table (unless it already exists). */ /* Add a tag to the tag table (unless it already exists). */
static tag_t * static tag_t *
get_tag (tag, sym, basic_type) get_tag (const char *tag, /* tag name */
const char *tag; /* tag name */ localsym_t *sym, /* tag start block */
localsym_t *sym; /* tag start block */ bt_t basic_type /* bt_Struct, bt_Union, or bt_Enum */)
bt_t basic_type; /* bt_Struct, bt_Union, or bt_Enum */
{ {
shash_t *hash_ptr; shash_t *hash_ptr;
const char *err; const char *err;
@ -2066,8 +2055,7 @@ get_tag (tag, sym, basic_type)
/* Add an unknown {struct, union, enum} tag. */ /* Add an unknown {struct, union, enum} tag. */
static void static void
add_unknown_tag (ptag) add_unknown_tag (tag_t *ptag /* pointer to tag information */)
tag_t *ptag; /* pointer to tag information */
{ {
shash_t *hash_ptr = ptag->hash_ptr; shash_t *hash_ptr = ptag->hash_ptr;
char *name = hash_ptr->string; char *name = hash_ptr->string;
@ -2116,8 +2104,7 @@ add_unknown_tag (ptag)
this is the current procedure. */ this is the current procedure. */
static void static void
add_procedure (func) add_procedure (char *func /* func name */)
char *func; /* func name */
{ {
register varray_t *vp; register varray_t *vp;
register proc_t *new_proc_ptr; register proc_t *new_proc_ptr;
@ -2177,7 +2164,7 @@ add_procedure (func)
} }
symbolS * symbolS *
ecoff_get_cur_proc_sym () ecoff_get_cur_proc_sym (void)
{ {
return (cur_proc_ptr ? cur_proc_ptr->sym->as_sym : NULL); return (cur_proc_ptr ? cur_proc_ptr->sym->as_sym : NULL);
} }
@ -2187,10 +2174,7 @@ ecoff_get_cur_proc_sym ()
where the current file structure lives. */ where the current file structure lives. */
static void static void
add_file (file_name, indx, fake) add_file (const char *file_name, int indx ATTRIBUTE_UNUSED, int fake)
const char *file_name; /* file name */
int indx ATTRIBUTE_UNUSED;
int fake;
{ {
register int first_ch; register int first_ch;
register efdr_t *fil_ptr; register efdr_t *fil_ptr;
@ -2328,8 +2312,7 @@ add_file (file_name, indx, fake)
compiler output, only in hand coded assembler. */ compiler output, only in hand coded assembler. */
void void
ecoff_new_file (name) ecoff_new_file (const char *name)
const char *name;
{ {
if (cur_file_ptr != NULL && strcmp (cur_file_ptr->name, name) == 0) if (cur_file_ptr != NULL && strcmp (cur_file_ptr->name, name) == 0)
return; return;
@ -2424,8 +2407,7 @@ st_to_string (symbol_type)
which gives the location of the start of the block. */ which gives the location of the start of the block. */
void void
ecoff_directive_begin (ignore) ecoff_directive_begin (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
char name_end; char name_end;
@ -2462,8 +2444,7 @@ ecoff_directive_begin (ignore)
which gives the location of the end of the block. */ which gives the location of the end of the block. */
void void
ecoff_directive_bend (ignore) ecoff_directive_bend (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
char name_end; char name_end;
@ -2521,8 +2502,7 @@ static int coff_inside_enumeration;
/* Handle a .def directive: start defining a symbol. */ /* Handle a .def directive: start defining a symbol. */
void void
ecoff_directive_def (ignore) ecoff_directive_def (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
char name_end; char name_end;
@ -2567,8 +2547,7 @@ ecoff_directive_def (ignore)
more than that anyhow, so I will also make that assumption. */ more than that anyhow, so I will also make that assumption. */
void void
ecoff_directive_dim (ignore) ecoff_directive_dim (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
int dimens[N_TQ]; int dimens[N_TQ];
int i; int i;
@ -2617,8 +2596,7 @@ ecoff_directive_dim (ignore)
symbol. */ symbol. */
void void
ecoff_directive_scl (ignore) ecoff_directive_scl (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
long val; long val;
@ -2642,8 +2620,7 @@ ecoff_directive_scl (ignore)
never generate more than one argument. */ never generate more than one argument. */
void void
ecoff_directive_size (ignore) ecoff_directive_size (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
int sizes[N_TQ]; int sizes[N_TQ];
int i; int i;
@ -2692,8 +2669,7 @@ ecoff_directive_size (ignore)
symbol. */ symbol. */
void void
ecoff_directive_type (ignore) ecoff_directive_type (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
long val; long val;
tq_t *tq_ptr; tq_t *tq_ptr;
@ -2761,8 +2737,7 @@ ecoff_directive_type (ignore)
union or enum. */ union or enum. */
void void
ecoff_directive_tag (ignore) ecoff_directive_tag (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
char name_end; char name_end;
@ -2788,8 +2763,7 @@ ecoff_directive_tag (ignore)
may be the name of a static or global symbol. */ may be the name of a static or global symbol. */
void void
ecoff_directive_val (ignore) ecoff_directive_val (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
expressionS exp; expressionS exp;
@ -2823,8 +2797,7 @@ ecoff_directive_val (ignore)
debugging information for a symbol. */ debugging information for a symbol. */
void void
ecoff_directive_endef (ignore) ecoff_directive_endef (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
symint_t indx; symint_t indx;
@ -3003,8 +2976,7 @@ ecoff_directive_endef (ignore)
/* Parse .end directives. */ /* Parse .end directives. */
void void
ecoff_directive_end (ignore) ecoff_directive_end (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
char name_end; char name_end;
@ -3058,8 +3030,7 @@ ecoff_directive_end (ignore)
/* Parse .ent directives. */ /* Parse .ent directives. */
void void
ecoff_directive_ent (ignore) ecoff_directive_ent (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
char name_end; char name_end;
@ -3109,8 +3080,7 @@ ecoff_directive_ent (ignore)
/* Parse .extern directives. */ /* Parse .extern directives. */
void void
ecoff_directive_extern (ignore) ecoff_directive_extern (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
int c; int c;
@ -3134,8 +3104,7 @@ ecoff_directive_extern (ignore)
/* Parse .file directives. */ /* Parse .file directives. */
void void
ecoff_directive_file (ignore) ecoff_directive_file (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
int indx; int indx;
char *name; char *name;
@ -3161,8 +3130,7 @@ ecoff_directive_file (ignore)
/* Parse .fmask directives. */ /* Parse .fmask directives. */
void void
ecoff_directive_fmask (ignore) ecoff_directive_fmask (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
long val; long val;
@ -3190,8 +3158,7 @@ ecoff_directive_fmask (ignore)
/* Parse .frame directives. */ /* Parse .frame directives. */
void void
ecoff_directive_frame (ignore) ecoff_directive_frame (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
long val; long val;
@ -3231,8 +3198,7 @@ ecoff_directive_frame (ignore)
/* Parse .mask directives. */ /* Parse .mask directives. */
void void
ecoff_directive_mask (ignore) ecoff_directive_mask (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
long val; long val;
@ -3260,8 +3226,7 @@ ecoff_directive_mask (ignore)
/* Parse .loc directives. */ /* Parse .loc directives. */
void void
ecoff_directive_loc (ignore) ecoff_directive_loc (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
lineno_list_t *list; lineno_list_t *list;
symint_t lineno; symint_t lineno;
@ -3341,9 +3306,7 @@ ecoff_directive_loc (ignore)
information so that it points to the instruction after the nop. */ information so that it points to the instruction after the nop. */
void void
ecoff_fix_loc (old_frag, old_frag_offset) ecoff_fix_loc (fragS *old_frag, unsigned long old_frag_offset)
fragS *old_frag;
unsigned long old_frag_offset;
{ {
if (last_lineno != NULL if (last_lineno != NULL
&& last_lineno->frag == old_frag && last_lineno->frag == old_frag
@ -3357,8 +3320,7 @@ ecoff_fix_loc (old_frag, old_frag_offset)
/* Make sure the @stabs symbol is emitted. */ /* Make sure the @stabs symbol is emitted. */
static void static void
mark_stabs (ignore) mark_stabs (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
if (! stabs_seen) if (! stabs_seen)
{ {
@ -3375,8 +3337,7 @@ mark_stabs (ignore)
#ifndef TC_MIPS #ifndef TC_MIPS
/* For TC_MIPS use the version in tc-mips.c. */ /* For TC_MIPS use the version in tc-mips.c. */
void void
ecoff_directive_weakext (ignore) ecoff_directive_weakext (int ignore ATTRIBUTE_UNUSED)
int ignore ATTRIBUTE_UNUSED;
{ {
char *name; char *name;
int c; int c;
@ -3454,13 +3415,12 @@ ecoff_directive_weakext (ignore)
value a numeric value or an address. */ value a numeric value or an address. */
void void
ecoff_stab (sec, what, string, type, other, desc) ecoff_stab (segT sec ATTRIBUTE_UNUSED,
segT sec ATTRIBUTE_UNUSED; int what,
int what; const char *string,
const char *string; int type,
int type; int other,
int other; int desc)
int desc;
{ {
efdr_t *save_file_ptr = cur_file_ptr; efdr_t *save_file_ptr = cur_file_ptr;
symbolS *sym; symbolS *sym;
@ -3609,8 +3569,7 @@ ecoff_stab (sec, what, string, type, other, desc)
.scommon section rather than bfd_com_section. */ .scommon section rather than bfd_com_section. */
void void
ecoff_frob_symbol (sym) ecoff_frob_symbol (symbolS *sym)
symbolS *sym;
{ {
if (S_IS_COMMON (sym) if (S_IS_COMMON (sym)
&& S_GET_VALUE (sym) > 0 && S_GET_VALUE (sym) > 0
@ -3647,11 +3606,10 @@ ecoff_frob_symbol (sym)
/* Add bytes to the symbolic information buffer. */ /* Add bytes to the symbolic information buffer. */
static char * static char *
ecoff_add_bytes (buf, bufend, bufptr, need) ecoff_add_bytes (char **buf,
char **buf; char **bufend,
char **bufend; char *bufptr,
char *bufptr; unsigned long need)
unsigned long need;
{ {
unsigned long at; unsigned long at;
unsigned long want; unsigned long want;
@ -3670,12 +3628,11 @@ ecoff_add_bytes (buf, bufend, bufptr, need)
for the ECOFF target debugging information. */ for the ECOFF target debugging information. */
static unsigned long static unsigned long
ecoff_padding_adjust (backend, buf, bufend, offset, bufptrptr) ecoff_padding_adjust (const struct ecoff_debug_swap *backend,
const struct ecoff_debug_swap *backend; char **buf,
char **buf; char **bufend,
char **bufend; unsigned long offset,
unsigned long offset; char **bufptrptr)
char **bufptrptr;
{ {
bfd_size_type align; bfd_size_type align;
@ -3699,12 +3656,11 @@ ecoff_padding_adjust (backend, buf, bufend, offset, bufptrptr)
/* Build the line number information. */ /* Build the line number information. */
static unsigned long static unsigned long
ecoff_build_lineno (backend, buf, bufend, offset, linecntptr) ecoff_build_lineno (const struct ecoff_debug_swap *backend,
const struct ecoff_debug_swap *backend; char **buf,
char **buf; char **bufend,
char **bufend; unsigned long offset,
unsigned long offset; long *linecntptr)
long *linecntptr;
{ {
char *bufptr; char *bufptr;
register lineno_list_t *l; register lineno_list_t *l;
@ -3929,14 +3885,13 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr)
/* Build and swap out the symbols. */ /* Build and swap out the symbols. */
static unsigned long static unsigned long
ecoff_build_symbols (backend, buf, bufend, offset) ecoff_build_symbols (const struct ecoff_debug_swap *backend,
const struct ecoff_debug_swap *backend; char **buf,
char **buf; char **bufend,
char **bufend; unsigned long offset)
unsigned long offset;
{ {
const bfd_size_type external_sym_size = backend->external_sym_size; const bfd_size_type external_sym_size = backend->external_sym_size;
void (* const swap_sym_out) PARAMS ((bfd *, const SYMR *, PTR)) void (* const swap_sym_out) (bfd *, const SYMR *, PTR)
= backend->swap_sym_out; = backend->swap_sym_out;
char *sym_out; char *sym_out;
long isym; long isym;
@ -4295,14 +4250,13 @@ ecoff_build_symbols (backend, buf, bufend, offset)
/* Swap out the procedure information. */ /* Swap out the procedure information. */
static unsigned long static unsigned long
ecoff_build_procs (backend, buf, bufend, offset) ecoff_build_procs (const struct ecoff_debug_swap *backend,
const struct ecoff_debug_swap *backend; char **buf,
char **buf; char **bufend,
char **bufend; unsigned long offset)
unsigned long offset;
{ {
const bfd_size_type external_pdr_size = backend->external_pdr_size; const bfd_size_type external_pdr_size = backend->external_pdr_size;
void (* const swap_pdr_out) PARAMS ((bfd *, const PDR *, PTR)) void (* const swap_pdr_out) (bfd *, const PDR *, PTR)
= backend->swap_pdr_out; = backend->swap_pdr_out;
char *pdr_out; char *pdr_out;
long iproc; long iproc;
@ -4386,11 +4340,10 @@ ecoff_build_procs (backend, buf, bufend, offset)
/* Swap out the aux information. */ /* Swap out the aux information. */
static unsigned long static unsigned long
ecoff_build_aux (backend, buf, bufend, offset) ecoff_build_aux (const struct ecoff_debug_swap *backend,
const struct ecoff_debug_swap *backend; char **buf,
char **buf; char **bufend,
char **bufend; unsigned long offset)
unsigned long offset;
{ {
int bigendian; int bigendian;
union aux_ext *aux_out; union aux_ext *aux_out;
@ -4501,11 +4454,10 @@ ecoff_build_aux (backend, buf, bufend, offset)
bytes copied, rather than the new offset. */ bytes copied, rather than the new offset. */
static unsigned long static unsigned long
ecoff_build_strings (buf, bufend, offset, vp) ecoff_build_strings (char **buf,
char **buf; char **bufend,
char **bufend; unsigned long offset,
unsigned long offset; varray_t *vp)
varray_t *vp;
{ {
unsigned long istr; unsigned long istr;
char *str_out; char *str_out;
@ -4540,11 +4492,10 @@ ecoff_build_strings (buf, bufend, offset, vp)
/* Dump out the local strings. */ /* Dump out the local strings. */
static unsigned long static unsigned long
ecoff_build_ss (backend, buf, bufend, offset) ecoff_build_ss (const struct ecoff_debug_swap *backend,
const struct ecoff_debug_swap *backend; char **buf,
char **buf; char **bufend,
char **bufend; unsigned long offset)
unsigned long offset;
{ {
long iss; long iss;
vlinks_t *file_link; vlinks_t *file_link;
@ -4584,14 +4535,13 @@ ecoff_build_ss (backend, buf, bufend, offset)
/* Swap out the file descriptors. */ /* Swap out the file descriptors. */
static unsigned long static unsigned long
ecoff_build_fdr (backend, buf, bufend, offset) ecoff_build_fdr (const struct ecoff_debug_swap *backend,
const struct ecoff_debug_swap *backend; char **buf,
char **buf; char **bufend,
char **bufend; unsigned long offset)
unsigned long offset;
{ {
const bfd_size_type external_fdr_size = backend->external_fdr_size; const bfd_size_type external_fdr_size = backend->external_fdr_size;
void (* const swap_fdr_out) PARAMS ((bfd *, const FDR *, PTR)) void (* const swap_fdr_out) (bfd *, const FDR *, PTR)
= backend->swap_fdr_out; = backend->swap_fdr_out;
long ifile; long ifile;
char *fdr_out; char *fdr_out;
@ -4634,7 +4584,7 @@ ecoff_build_fdr (backend, buf, bufend, offset)
calls a backend function to deal with it. */ calls a backend function to deal with it. */
static void static void
ecoff_setup_ext () ecoff_setup_ext (void)
{ {
register symbolS *sym; register symbolS *sym;
@ -4664,10 +4614,9 @@ ecoff_setup_ext ()
/* Build the ECOFF debugging information. */ /* Build the ECOFF debugging information. */
unsigned long unsigned long
ecoff_build_debug (hdr, bufp, backend) ecoff_build_debug (HDRR *hdr,
HDRR *hdr; char **bufp,
char **bufp; const struct ecoff_debug_swap *backend)
const struct ecoff_debug_swap *backend;
{ {
const bfd_size_type external_pdr_size = backend->external_pdr_size; const bfd_size_type external_pdr_size = backend->external_pdr_size;
tag_t *ptag; tag_t *ptag;
@ -4831,8 +4780,7 @@ ecoff_build_debug (hdr, bufp, backend)
#ifndef MALLOC_CHECK #ifndef MALLOC_CHECK
static page_type * static page_type *
allocate_cluster (npages) allocate_cluster (unsigned long npages)
unsigned long npages;
{ {
register page_type *value = (page_type *) xmalloc (npages * PAGE_USIZE); register page_type *value = (page_type *) xmalloc (npages * PAGE_USIZE);
@ -4854,7 +4802,7 @@ static unsigned long pages_left = 0;
/* Allocate one page (which is initialized to 0). */ /* Allocate one page (which is initialized to 0). */
static page_type * static page_type *
allocate_page () allocate_page (void)
{ {
#ifndef MALLOC_CHECK #ifndef MALLOC_CHECK
@ -4881,7 +4829,7 @@ allocate_page ()
/* Allocate scoping information. */ /* Allocate scoping information. */
static scope_t * static scope_t *
allocate_scope () allocate_scope (void)
{ {
register scope_t *ptr; register scope_t *ptr;
static scope_t initial_scope; static scope_t initial_scope;
@ -4921,8 +4869,7 @@ allocate_scope ()
/* Free scoping information. */ /* Free scoping information. */
static void static void
free_scope (ptr) free_scope (scope_t *ptr)
scope_t *ptr;
{ {
alloc_counts[(int) alloc_type_scope].total_free++; alloc_counts[(int) alloc_type_scope].total_free++;
@ -4937,7 +4884,7 @@ free_scope (ptr)
/* Allocate links for pages in a virtual array. */ /* Allocate links for pages in a virtual array. */
static vlinks_t * static vlinks_t *
allocate_vlinks () allocate_vlinks (void)
{ {
register vlinks_t *ptr; register vlinks_t *ptr;
static vlinks_t initial_vlinks; static vlinks_t initial_vlinks;
@ -4971,7 +4918,7 @@ allocate_vlinks ()
/* Allocate string hash buckets. */ /* Allocate string hash buckets. */
static shash_t * static shash_t *
allocate_shash () allocate_shash (void)
{ {
register shash_t *ptr; register shash_t *ptr;
static shash_t initial_shash; static shash_t initial_shash;
@ -5005,7 +4952,7 @@ allocate_shash ()
/* Allocate type hash buckets. */ /* Allocate type hash buckets. */
static thash_t * static thash_t *
allocate_thash () allocate_thash (void)
{ {
register thash_t *ptr; register thash_t *ptr;
static thash_t initial_thash; static thash_t initial_thash;
@ -5039,7 +4986,7 @@ allocate_thash ()
/* Allocate structure, union, or enum tag information. */ /* Allocate structure, union, or enum tag information. */
static tag_t * static tag_t *
allocate_tag () allocate_tag (void)
{ {
register tag_t *ptr; register tag_t *ptr;
static tag_t initial_tag; static tag_t initial_tag;
@ -5079,8 +5026,7 @@ allocate_tag ()
/* Free scoping information. */ /* Free scoping information. */
static void static void
free_tag (ptr) free_tag (tag_t *ptr)
tag_t *ptr;
{ {
alloc_counts[(int) alloc_type_tag].total_free++; alloc_counts[(int) alloc_type_tag].total_free++;
@ -5095,7 +5041,7 @@ free_tag (ptr)
/* Allocate forward reference to a yet unknown tag. */ /* Allocate forward reference to a yet unknown tag. */
static forward_t * static forward_t *
allocate_forward () allocate_forward (void)
{ {
register forward_t *ptr; register forward_t *ptr;
static forward_t initial_forward; static forward_t initial_forward;
@ -5129,7 +5075,7 @@ allocate_forward ()
/* Allocate head of type hash list. */ /* Allocate head of type hash list. */
static thead_t * static thead_t *
allocate_thead () allocate_thead (void)
{ {
register thead_t *ptr; register thead_t *ptr;
static thead_t initial_thead; static thead_t initial_thead;
@ -5169,8 +5115,7 @@ allocate_thead ()
/* Free scoping information. */ /* Free scoping information. */
static void static void
free_thead (ptr) free_thead (thead_t *ptr)
thead_t *ptr;
{ {
alloc_counts[(int) alloc_type_thead].total_free++; alloc_counts[(int) alloc_type_thead].total_free++;
@ -5183,7 +5128,7 @@ free_thead (ptr)
} }
static lineno_list_t * static lineno_list_t *
allocate_lineno_list () allocate_lineno_list (void)
{ {
register lineno_list_t *ptr; register lineno_list_t *ptr;
static lineno_list_t initial_lineno_list; static lineno_list_t initial_lineno_list;
@ -5215,8 +5160,7 @@ allocate_lineno_list ()
} }
void void
ecoff_set_gp_prolog_size (sz) ecoff_set_gp_prolog_size (int sz)
int sz;
{ {
if (cur_proc_ptr == 0) if (cur_proc_ptr == 0)
return; return;
@ -5232,13 +5176,13 @@ ecoff_set_gp_prolog_size (sz)
} }
int int
ecoff_no_current_file () ecoff_no_current_file (void)
{ {
return cur_file_ptr == (efdr_t *) NULL; return cur_file_ptr == (efdr_t *) NULL;
} }
void void
ecoff_generate_asm_lineno () ecoff_generate_asm_lineno (void)
{ {
unsigned int lineno; unsigned int lineno;
char *filename; char *filename;
@ -5285,7 +5229,7 @@ ecoff_generate_asm_lineno ()
#else #else
void void
ecoff_generate_asm_lineno () ecoff_generate_asm_lineno (void)
{ {
} }

View file

@ -34,18 +34,18 @@ extern int ecoff_debugging_seen;
/* This function should be called at the start of assembly, by /* This function should be called at the start of assembly, by
obj_read_begin_hook. */ obj_read_begin_hook. */
extern void ecoff_read_begin_hook PARAMS ((void)); extern void ecoff_read_begin_hook (void);
/* This function should be called when the assembler switches to a new /* This function should be called when the assembler switches to a new
file. */ file. */
extern void ecoff_new_file PARAMS ((const char *)); extern void ecoff_new_file (const char *);
/* This function should be called when a new symbol is created, by /* This function should be called when a new symbol is created, by
obj_symbol_new_hook. */ obj_symbol_new_hook. */
extern void ecoff_symbol_new_hook PARAMS ((symbolS *)); extern void ecoff_symbol_new_hook (symbolS *);
/* This function should be called by the obj_frob_symbol hook. */ /* This function should be called by the obj_frob_symbol hook. */
extern void ecoff_frob_symbol PARAMS ((symbolS *)); extern void ecoff_frob_symbol (symbolS *);
/* Build the ECOFF debugging information. This should be called by /* Build the ECOFF debugging information. This should be called by
obj_frob_file. This fills in the counts in *HDR; the offsets are obj_frob_file. This fills in the counts in *HDR; the offsets are
@ -53,59 +53,59 @@ extern void ecoff_frob_symbol PARAMS ((symbolS *));
block of memory holding the debugging information. It returns the block of memory holding the debugging information. It returns the
length of *BUFP. */ length of *BUFP. */
extern unsigned long ecoff_build_debug extern unsigned long ecoff_build_debug
PARAMS ((HDRR *hdr, char **bufp, const struct ecoff_debug_swap *)); (HDRR *hdr, char **bufp, const struct ecoff_debug_swap *);
/* Functions to handle the ECOFF debugging directives. */ /* Functions to handle the ECOFF debugging directives. */
extern void ecoff_directive_begin PARAMS ((int)); extern void ecoff_directive_begin (int);
extern void ecoff_directive_bend PARAMS ((int)); extern void ecoff_directive_bend (int);
extern void ecoff_directive_end PARAMS ((int)); extern void ecoff_directive_end (int);
extern void ecoff_directive_ent PARAMS ((int)); extern void ecoff_directive_ent (int);
extern void ecoff_directive_fmask PARAMS ((int)); extern void ecoff_directive_fmask (int);
extern void ecoff_directive_frame PARAMS ((int)); extern void ecoff_directive_frame (int);
extern void ecoff_directive_loc PARAMS ((int)); extern void ecoff_directive_loc (int);
extern void ecoff_directive_mask PARAMS ((int)); extern void ecoff_directive_mask (int);
/* Other ECOFF directives. */ /* Other ECOFF directives. */
extern void ecoff_directive_extern PARAMS ((int)); extern void ecoff_directive_extern (int);
extern void ecoff_directive_weakext PARAMS ((int)); extern void ecoff_directive_weakext (int);
/* Functions to handle the COFF debugging directives. */ /* Functions to handle the COFF debugging directives. */
extern void ecoff_directive_def PARAMS ((int)); extern void ecoff_directive_def (int);
extern void ecoff_directive_dim PARAMS ((int)); extern void ecoff_directive_dim (int);
extern void ecoff_directive_endef PARAMS ((int)); extern void ecoff_directive_endef (int);
extern void ecoff_directive_file PARAMS ((int)); extern void ecoff_directive_file (int);
extern void ecoff_directive_scl PARAMS ((int)); extern void ecoff_directive_scl (int);
extern void ecoff_directive_size PARAMS ((int)); extern void ecoff_directive_size (int);
extern void ecoff_directive_tag PARAMS ((int)); extern void ecoff_directive_tag (int);
extern void ecoff_directive_type PARAMS ((int)); extern void ecoff_directive_type (int);
extern void ecoff_directive_val PARAMS ((int)); extern void ecoff_directive_val (int);
/* Handle stabs. */ /* Handle stabs. */
extern void ecoff_stab PARAMS ((segT sec, int what, const char *string, extern void ecoff_stab (segT sec, int what, const char *string,
int type, int other, int desc)); int type, int other, int desc);
/* Set the GP prologue size. */ /* Set the GP prologue size. */
extern void ecoff_set_gp_prolog_size PARAMS ((int sz)); extern void ecoff_set_gp_prolog_size (int sz);
/* This routine is called from the ECOFF code to set the external /* This routine is called from the ECOFF code to set the external
information for a symbol. */ information for a symbol. */
#ifndef obj_ecoff_set_ext #ifndef obj_ecoff_set_ext
extern void obj_ecoff_set_ext PARAMS ((symbolS *, EXTR *)); extern void obj_ecoff_set_ext (symbolS *, EXTR *);
#endif #endif
/* This routine is used to patch up a line number directive when /* This routine is used to patch up a line number directive when
instructions are moved around. */ instructions are moved around. */
extern void ecoff_fix_loc PARAMS ((fragS *, unsigned long)); extern void ecoff_fix_loc (fragS *, unsigned long);
/* This function is called from read.c to peek at cur_file_ptr. */ /* This function is called from read.c to peek at cur_file_ptr. */
extern int ecoff_no_current_file PARAMS ((void)); extern int ecoff_no_current_file (void);
/* This function returns the symbol associated with the current proc. */ /* This function returns the symbol associated with the current proc. */
extern symbolS *ecoff_get_cur_proc_sym PARAMS ((void)); extern symbolS *ecoff_get_cur_proc_sym (void);
#endif /* ECOFF_DEBUGGING */ #endif /* ECOFF_DEBUGGING */
/* This routine is called from read.c to generate line number for .s file. */ /* This routine is called from read.c to generate line number for .s file. */
extern void ecoff_generate_asm_lineno PARAMS ((void)); extern void ecoff_generate_asm_lineno (void);
#endif /* ! GAS_ECOFF_H */ #endif /* ! GAS_ECOFF_H */