Commit 502bc3df by Rainer Orth Committed by Rainer Orth

* config/alpha/alpha.h (CODE_MASK, MIPS_IS_STAB, MIPS_MARK_STAB)

	(MIPS_UNMARK_STAB, SHASH_SIZE, THASH_SIZE, ALIGN_SYMTABLE_OFFSET):
	Move ...
	* mips-tfile.c: ... here.
	Don't include coretypes.h, tm.h, filenames.h.
	(saber_stop): Remove definition and all calls.
	[__SABER__]: Remove.
	(__LINE__): Remove default.
	(Size_t, Ptrdiff_t): Remove definitions.
	Replace by size_t, ptrdiff_t.
	[!MIPS_DEBUGGING_INFO]: Remove.
	(SHASH_SIZE, THASH_SIZE): Remove defaults.
	(progname): Add const.
	(STATIC): Remove.
	Replace all uses by static.
	(ALIGN_SYMTABLE_OFFSET): Remove default.
	* mips-tdump.c: Don't include coretypes.h, tm.h.
	Remove !MIPS_IS_STAB guard.
	* Makefile.in (mips-tfile.o): Remove $(RTL_H), coretypes.h,
	$(TM_H), filenames.h dependencies.
	(mips-tdump.o): Remove $(RTL_H), coretypes.h, $(TM_H) dependencies.

From-SVN: r173367
parent 991eb6ef
2011-05-04 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/alpha/alpha.h (CODE_MASK, MIPS_IS_STAB, MIPS_MARK_STAB)
(MIPS_UNMARK_STAB, SHASH_SIZE, THASH_SIZE, ALIGN_SYMTABLE_OFFSET):
Move ...
* mips-tfile.c: ... here.
Don't include coretypes.h, tm.h, filenames.h.
(saber_stop): Remove definition and all calls.
[__SABER__]: Remove.
(__LINE__): Remove default.
(Size_t, Ptrdiff_t): Remove definitions.
Replace by size_t, ptrdiff_t.
[!MIPS_DEBUGGING_INFO]: Remove.
(SHASH_SIZE, THASH_SIZE): Remove defaults.
(progname): Add const.
(STATIC): Remove.
Replace all uses by static.
(ALIGN_SYMTABLE_OFFSET): Remove default.
* mips-tdump.c: Don't include coretypes.h, tm.h.
Remove !MIPS_IS_STAB guard.
* Makefile.in (mips-tfile.o): Remove $(RTL_H), coretypes.h,
$(TM_H), filenames.h dependencies.
(mips-tdump.o): Remove $(RTL_H), coretypes.h, $(TM_H) dependencies.
2011-05-04 Stuart Henderson <shenders@gcc.gnu.org> 2011-05-04 Stuart Henderson <shenders@gcc.gnu.org>
From Jie Zhang From Jie Zhang
......
...@@ -3520,15 +3520,15 @@ mips-tfile: mips-tfile.o version.o $(LIBDEPS) ...@@ -3520,15 +3520,15 @@ mips-tfile: mips-tfile.o version.o $(LIBDEPS)
$(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \ $(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \
mips-tfile.o version.o $(LIBS) mips-tfile.o version.o $(LIBS)
mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h \ mips-tfile.o : mips-tfile.c $(CONFIG_H) $(SYSTEM_H) \
$(TM_H) version.h $(srcdir)/../include/getopt.h $(GSTAB_H) intl.h version.h $(srcdir)/../include/getopt.h $(GSTAB_H) intl.h
mips-tdump: mips-tdump.o version.o $(LIBDEPS) mips-tdump: mips-tdump.o version.o $(LIBDEPS)
$(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \ $(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \
mips-tdump.o version.o $(LIBS) mips-tdump.o version.o $(LIBS)
mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h \ mips-tdump.o : mips-tdump.c $(CONFIG_H) $(SYSTEM_H) \
$(TM_H) version.h $(srcdir)/../include/getopt.h stab.def version.h $(srcdir)/../include/getopt.h stab.def
# #
# Generate header and source files from the machine description, # Generate header and source files from the machine description,
......
...@@ -1294,25 +1294,5 @@ do { \ ...@@ -1294,25 +1294,5 @@ do { \
#define PUT_SDB_EPILOGUE_END(NAME) ((void)(NAME)) #define PUT_SDB_EPILOGUE_END(NAME) ((void)(NAME))
/* Macros for mips-tfile.c to encapsulate stabs in ECOFF, and for
mips-tdump.c to print them out.
These must match the corresponding definitions in gdb/mipsread.c.
Unfortunately, gcc and gdb do not currently share any directories. */
#define CODE_MASK 0x8F300
#define MIPS_IS_STAB(sym) (((sym)->index & 0xFFF00) == CODE_MASK)
#define MIPS_MARK_STAB(code) ((code)+CODE_MASK)
#define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK)
/* Override some mips-tfile definitions. */
#define SHASH_SIZE 511
#define THASH_SIZE 55
/* Align ecoff symbol tables to avoid OSF1/1.3 nm complaints. */
#define ALIGN_SYMTABLE_OFFSET(OFFSET) (((OFFSET) + 7) & ~7)
/* The system headers under Alpha systems are generally C++-aware. */ /* The system headers under Alpha systems are generally C++-aware. */
#define NO_IMPLICIT_EXTERN_C #define NO_IMPLICIT_EXTERN_C
...@@ -22,8 +22,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -22,8 +22,6 @@ along with GCC; see the file COPYING3. If not see
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "version.h" #include "version.h"
#ifdef index #ifdef index
#undef index #undef index
...@@ -37,10 +35,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -37,10 +35,8 @@ along with GCC; see the file COPYING3. If not see
/* Include getopt.h for the sake of getopt_long. */ /* Include getopt.h for the sake of getopt_long. */
#include "getopt.h" #include "getopt.h"
#ifndef MIPS_IS_STAB
/* Macros for mips-tfile.c to encapsulate stabs in ECOFF, and for /* Macros for mips-tfile.c to encapsulate stabs in ECOFF, and for
and mips-tdump.c to print them out. This is used on the Alpha, mips-tdump.c to print them out.
which does not include mips.h.
These must match the corresponding definitions in gdb/mipsread.c. These must match the corresponding definitions in gdb/mipsread.c.
Unfortunately, gcc and gdb do not currently share any directories. */ Unfortunately, gcc and gdb do not currently share any directories. */
...@@ -49,7 +45,6 @@ along with GCC; see the file COPYING3. If not see ...@@ -49,7 +45,6 @@ along with GCC; see the file COPYING3. If not see
#define MIPS_IS_STAB(sym) (((sym)->index & 0xFFF00) == CODE_MASK) #define MIPS_IS_STAB(sym) (((sym)->index & 0xFFF00) == CODE_MASK)
#define MIPS_MARK_STAB(code) ((code)+CODE_MASK) #define MIPS_MARK_STAB(code) ((code)+CODE_MASK)
#define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK) #define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK)
#endif
#define uchar unsigned char #define uchar unsigned char
#define ushort unsigned short #define ushort unsigned short
......
...@@ -602,37 +602,22 @@ along with GCC; see the file COPYING3. If not see ...@@ -602,37 +602,22 @@ along with GCC; see the file COPYING3. If not see
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "version.h" #include "version.h"
#include "intl.h" #include "intl.h"
#include "filenames.h"
#ifndef __SABER__
#define saber_stop()
#endif
/* Include getopt.h for the sake of getopt_long. */ /* Include getopt.h for the sake of getopt_long. */
#include "getopt.h" #include "getopt.h"
#ifndef __LINE__ /* Macros for mips-tfile.c to encapsulate stabs in ECOFF, and for
#define __LINE__ 0 mips-tdump.c to print them out.
#endif
/* Due to size_t being defined in sys/types.h and different These must match the corresponding definitions in gdb/mipsread.c.
in stddef.h, we have to do this by hand..... Note, these Unfortunately, gcc and gdb do not currently share any directories. */
types are correct for MIPS based systems, and may not be
correct for other systems. Ultrix 4.0 and Silicon Graphics
have this fixed, but since the following is correct, and
the fact that including stddef.h gets you GCC's version
instead of the standard one it's not worth it to fix it. */
#if defined(__OSF1__) || defined(__OSF__) || defined(__osf__) #define CODE_MASK 0x8F300
#define Size_t long unsigned int #define MIPS_IS_STAB(sym) (((sym)->index & 0xFFF00) == CODE_MASK)
#else #define MIPS_MARK_STAB(code) ((code)+CODE_MASK)
#define Size_t unsigned int #define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK)
#endif
#define Ptrdiff_t long
/* The following might be called from obstack or malloc, /* The following might be called from obstack or malloc,
so they can't be static. */ so they can't be static. */
...@@ -643,24 +628,6 @@ extern void botch (const char *) ATTRIBUTE_NORETURN; ...@@ -643,24 +628,6 @@ extern void botch (const char *) ATTRIBUTE_NORETURN;
extern void fatal (const char *format, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; extern void fatal (const char *format, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
extern void error (const char *format, ...) ATTRIBUTE_PRINTF_1; extern void error (const char *format, ...) ATTRIBUTE_PRINTF_1;
#ifndef MIPS_DEBUGGING_INFO
static int line_number;
static int cur_line_start;
static int debug;
static int had_errors;
static const char *progname;
static const char *input_name;
int
main (void)
{
fprintf (stderr, "Mips-tfile should only be run on a MIPS computer!\n");
exit (1);
}
#else /* MIPS_DEBUGGING defined */
/* The local and global symbols have a field index, so undo any defines /* The local and global symbols have a field index, so undo any defines
of index -> strchr. */ of index -> strchr. */
...@@ -674,12 +641,6 @@ main (void) ...@@ -674,12 +641,6 @@ main (void)
#include "gstab.h" #include "gstab.h"
#ifndef MALLOC_CHECK
#ifdef __SABER__
#define MALLOC_CHECK
#endif
#endif
#define IS_ASM_IDENT(ch) \ #define IS_ASM_IDENT(ch) \
(ISIDNUM (ch) || (ch) == '.' || (ch) == '$') (ISIDNUM (ch) || (ch) == '.' || (ch) == '$')
...@@ -899,7 +860,7 @@ enum alloc_type { ...@@ -899,7 +860,7 @@ enum alloc_type {
#define PAGE_SIZE 32768 /* size of varray pages */ #define PAGE_SIZE 32768 /* size of varray pages */
#endif #endif
#define PAGE_USIZE ((Size_t) PAGE_SIZE) #define PAGE_USIZE ((size_t) PAGE_SIZE)
#ifndef MAX_CLUSTER_PAGES /* # pages to get from system */ #ifndef MAX_CLUSTER_PAGES /* # pages to get from system */
...@@ -1010,9 +971,7 @@ typedef union small_free { ...@@ -1010,9 +971,7 @@ typedef union small_free {
/* String hash table support. The size of the hash table must fit /* String hash table support. The size of the hash table must fit
within a page. */ within a page. */
#ifndef SHASH_SIZE #define SHASH_SIZE 511
#define SHASH_SIZE 1009
#endif
#define HASH_LEN_MAX ((1 << 12) - 1) /* Max length we can store */ #define HASH_LEN_MAX ((1 << 12) - 1) /* Max length we can store */
...@@ -1034,9 +993,7 @@ typedef struct shash { ...@@ -1034,9 +993,7 @@ typedef struct shash {
Because unique types which are hashed are fewer in number than Because unique types which are hashed are fewer in number than
strings, we use a smaller hash value. */ strings, we use a smaller hash value. */
#ifndef THASH_SIZE #define THASH_SIZE 55
#define THASH_SIZE 113
#endif
typedef struct thash { typedef struct thash {
struct thash *next; /* next hash value */ struct thash *next; /* next hash value */
...@@ -1494,7 +1451,7 @@ static unsigned long file_offset = 0; /* current file offset */ ...@@ -1494,7 +1451,7 @@ static unsigned long file_offset = 0; /* current file offset */
static unsigned long max_file_offset = 0; /* maximum file offset */ static unsigned long max_file_offset = 0; /* maximum file offset */
static FILE *object_stream = (FILE *) 0; /* file desc. to output .o */ static FILE *object_stream = (FILE *) 0; /* file desc. to output .o */
static FILE *obj_in_stream = (FILE *) 0; /* file desc. to input .o */ static FILE *obj_in_stream = (FILE *) 0; /* file desc. to input .o */
static char *progname = (char *) 0; /* program name for errors */ static const char *progname = (const char *) 0;/* program name for errors */
static const char *input_name = "stdin"; /* name of input file */ static const char *input_name = "stdin"; /* name of input file */
static char *object_name = (char *) 0; /* tmp. name of object file */ static char *object_name = (char *) 0; /* tmp. name of object file */
static char *obj_in_name = (char *) 0; /* name of input object file */ static char *obj_in_name = (char *) 0; /* name of input object file */
...@@ -1522,68 +1479,64 @@ static const char stabs_symbol[] = STABS_SYMBOL; ...@@ -1522,68 +1479,64 @@ static const char stabs_symbol[] = STABS_SYMBOL;
/* Forward reference for functions. See the definition for more details. */ /* Forward reference for functions. See the definition for more details. */
#ifndef STATIC static int out_of_bounds (symint_t, symint_t, const char *, int);
#define STATIC static static shash_t *hash_string (const char *, ptrdiff_t, shash_t **, symint_t *);
#endif static symint_t add_string (varray_t *, shash_t **, const char *, const char *,
STATIC int out_of_bounds (symint_t, symint_t, const char *, int);
STATIC shash_t *hash_string (const char *, Ptrdiff_t, shash_t **, symint_t *);
STATIC symint_t add_string (varray_t *, shash_t **, const char *, const char *,
shash_t **); shash_t **);
STATIC symint_t add_local_symbol (const char *, const char *, st_t, sc_t, static symint_t add_local_symbol (const char *, const char *, st_t, sc_t,
symint_t, symint_t); symint_t, symint_t);
STATIC symint_t add_ext_symbol (EXTR *, int); static symint_t add_ext_symbol (EXTR *, int);
STATIC symint_t add_aux_sym_symint (symint_t); static symint_t add_aux_sym_symint (symint_t);
STATIC symint_t add_aux_sym_rndx (int, symint_t); static symint_t add_aux_sym_rndx (int, symint_t);
STATIC symint_t add_aux_sym_tir (type_info_t *, hash_state_t, thash_t **); static symint_t add_aux_sym_tir (type_info_t *, hash_state_t, thash_t **);
STATIC tag_t * get_tag (const char *, const char *, symint_t, bt_t); static tag_t * get_tag (const char *, const char *, symint_t, bt_t);
STATIC void add_unknown_tag (tag_t *); static void add_unknown_tag (tag_t *);
STATIC void add_procedure (const char *, const char *); static void add_procedure (const char *, const char *);
STATIC void initialize_init_file (void); static void initialize_init_file (void);
STATIC void add_file (const char *, const char *); static void add_file (const char *, const char *);
STATIC void add_bytes (varray_t *, char *, Size_t); static void add_bytes (varray_t *, char *, size_t);
STATIC void add_varray_page (varray_t *); static void add_varray_page (varray_t *);
STATIC void update_headers (void); static void update_headers (void);
STATIC void write_varray (varray_t *, off_t, const char *); static void write_varray (varray_t *, off_t, const char *);
STATIC void write_object (void); static void write_object (void);
STATIC const char *st_to_string (st_t); static const char *st_to_string (st_t);
STATIC const char *sc_to_string (sc_t); static const char *sc_to_string (sc_t);
STATIC char *read_line (void); static char *read_line (void);
STATIC void parse_input (void); static void parse_input (void);
STATIC void mark_stabs (const char *); static void mark_stabs (const char *);
STATIC void parse_begin (const char *); static void parse_begin (const char *);
STATIC void parse_bend (const char *); static void parse_bend (const char *);
STATIC void parse_def (const char *); static void parse_def (const char *);
STATIC void parse_end (const char *); static void parse_end (const char *);
STATIC void parse_ent (const char *); static void parse_ent (const char *);
STATIC void parse_file (const char *); static void parse_file (const char *);
STATIC void parse_stabs_common (const char *, const char *, const char *); static void parse_stabs_common (const char *, const char *, const char *);
STATIC void parse_stabs (const char *); static void parse_stabs (const char *);
STATIC void parse_stabn (const char *); static void parse_stabn (const char *);
STATIC page_t *read_seek (Size_t, off_t, const char *); static page_t *read_seek (size_t, off_t, const char *);
STATIC void copy_object (void); static void copy_object (void);
STATIC void catch_signal (int) ATTRIBUTE_NORETURN; static void catch_signal (int) ATTRIBUTE_NORETURN;
STATIC page_t *allocate_page (void); static page_t *allocate_page (void);
STATIC page_t *allocate_multiple_pages (Size_t); static page_t *allocate_multiple_pages (size_t);
STATIC void free_multiple_pages (page_t *, Size_t); static void free_multiple_pages (page_t *, size_t);
#ifndef MALLOC_CHECK #ifndef MALLOC_CHECK
STATIC page_t *allocate_cluster (Size_t); static page_t *allocate_cluster (size_t);
#endif #endif
STATIC forward_t *allocate_forward (void); static forward_t *allocate_forward (void);
STATIC scope_t *allocate_scope (void); static scope_t *allocate_scope (void);
STATIC shash_t *allocate_shash (void); static shash_t *allocate_shash (void);
STATIC tag_t *allocate_tag (void); static tag_t *allocate_tag (void);
STATIC thash_t *allocate_thash (void); static thash_t *allocate_thash (void);
STATIC thead_t *allocate_thead (void); static thead_t *allocate_thead (void);
STATIC vlinks_t *allocate_vlinks (void); static vlinks_t *allocate_vlinks (void);
STATIC void free_forward (forward_t *); static void free_forward (forward_t *);
STATIC void free_scope (scope_t *); static void free_scope (scope_t *);
STATIC void free_tag (tag_t *); static void free_tag (tag_t *);
STATIC void free_thead (thead_t *); static void free_thead (thead_t *);
extern char *optarg; extern char *optarg;
extern int optind; extern int optind;
...@@ -1626,7 +1579,7 @@ static const struct option options[] = ...@@ -1626,7 +1579,7 @@ static const struct option options[] =
/* Add a page to a varray object. */ /* Add a page to a varray object. */
STATIC void static void
add_varray_page (varray_t *vp) add_varray_page (varray_t *vp)
{ {
vlinks_t *new_links = allocate_vlinks (); vlinks_t *new_links = allocate_vlinks ();
...@@ -1659,12 +1612,12 @@ add_varray_page (varray_t *vp) ...@@ -1659,12 +1612,12 @@ add_varray_page (varray_t *vp)
#define HASHBITS 30 #define HASHBITS 30
STATIC shash_t * static shash_t *
hash_string (const char *text, Ptrdiff_t hash_len, shash_t **hash_tbl, hash_string (const char *text, ptrdiff_t hash_len, shash_t **hash_tbl,
symint_t *ret_hash_index) symint_t *ret_hash_index)
{ {
unsigned long hi; unsigned long hi;
Ptrdiff_t i; ptrdiff_t i;
shash_t *ptr; shash_t *ptr;
int first_ch = *text; int first_ch = *text;
...@@ -1695,15 +1648,15 @@ hash_string (const char *text, Ptrdiff_t hash_len, shash_t **hash_tbl, ...@@ -1695,15 +1648,15 @@ hash_string (const char *text, Ptrdiff_t hash_len, shash_t **hash_tbl,
starts at START and the position one byte after the string is given starts at START and the position one byte after the string is given
with END_P1, the resulting hash pointer is returned in RET_HASH. */ with END_P1, the resulting hash pointer is returned in RET_HASH. */
STATIC symint_t static symint_t
add_string (varray_t *vp, shash_t **hash_tbl, const char *start, add_string (varray_t *vp, shash_t **hash_tbl, const char *start,
const char *end_p1, shash_t **ret_hash) const char *end_p1, shash_t **ret_hash)
{ {
Ptrdiff_t len = end_p1 - start; ptrdiff_t len = end_p1 - start;
shash_t *hash_ptr; shash_t *hash_ptr;
symint_t hi; symint_t hi;
if (len >= (Ptrdiff_t) PAGE_USIZE) if (len >= (ptrdiff_t) PAGE_USIZE)
fatal ("string too big (%ld bytes)", (long) len); fatal ("string too big (%ld bytes)", (long) len);
hash_ptr = hash_string (start, len, hash_tbl, &hi); hash_ptr = hash_string (start, len, hash_tbl, &hi);
...@@ -1747,7 +1700,7 @@ add_string (varray_t *vp, shash_t **hash_tbl, const char *start, ...@@ -1747,7 +1700,7 @@ add_string (varray_t *vp, shash_t **hash_tbl, const char *start,
TYPE and storage class STORAGE and value VALUE. INDX is an index TYPE and storage class STORAGE and value VALUE. INDX is an index
to local/aux. symbols. */ to local/aux. symbols. */
STATIC symint_t static symint_t
add_local_symbol (const char *str_start, const char *str_end_p1, st_t type, add_local_symbol (const char *str_start, const char *str_end_p1, st_t type,
sc_t storage, symint_t value, symint_t indx) sc_t storage, symint_t value, symint_t indx)
{ {
...@@ -1909,7 +1862,7 @@ add_local_symbol (const char *str_start, const char *str_end_p1, st_t type, ...@@ -1909,7 +1862,7 @@ add_local_symbol (const char *str_start, const char *str_end_p1, st_t type,
st_str, (int) (str_end_p1 - str_start), str_start); st_str, (int) (str_end_p1 - str_start), str_start);
else else
{ {
Size_t len = strlen (st_str); size_t len = strlen (st_str);
fprintf (stderr, " st= %.*s\n", (int) (len-1), st_str); fprintf (stderr, " st= %.*s\n", (int) (len-1), st_str);
} }
} }
...@@ -1921,7 +1874,7 @@ add_local_symbol (const char *str_start, const char *str_end_p1, st_t type, ...@@ -1921,7 +1874,7 @@ add_local_symbol (const char *str_start, const char *str_end_p1, st_t type,
/* Add an external symbol with symbol pointer ESYM and file index /* Add an external symbol with symbol pointer ESYM and file index
IFD. */ IFD. */
STATIC symint_t static symint_t
add_ext_symbol (EXTR *esym, int ifd) add_ext_symbol (EXTR *esym, int ifd)
{ {
const char *str_start; /* first byte in string */ const char *str_start; /* first byte in string */
...@@ -1973,7 +1926,7 @@ add_ext_symbol (EXTR *esym, int ifd) ...@@ -1973,7 +1926,7 @@ add_ext_symbol (EXTR *esym, int ifd)
/* Add an auxiliary symbol (passing a symint). */ /* Add an auxiliary symbol (passing a symint). */
STATIC symint_t static symint_t
add_aux_sym_symint (symint_t aux_word) add_aux_sym_symint (symint_t aux_word)
{ {
AUXU *aux_ptr; AUXU *aux_ptr;
...@@ -1992,7 +1945,7 @@ add_aux_sym_symint (symint_t aux_word) ...@@ -1992,7 +1945,7 @@ add_aux_sym_symint (symint_t 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 (int file_index, symint_t sym_index) add_aux_sym_rndx (int file_index, symint_t sym_index)
{ {
AUXU *aux_ptr; AUXU *aux_ptr;
...@@ -2013,7 +1966,7 @@ add_aux_sym_rndx (int file_index, symint_t sym_index) ...@@ -2013,7 +1966,7 @@ add_aux_sym_rndx (int file_index, symint_t sym_index)
/* Add an auxiliary symbol (passing the basic type and possibly /* Add an auxiliary symbol (passing the basic type and possibly
type qualifiers). */ type qualifiers). */
STATIC symint_t static symint_t
add_aux_sym_tir (type_info_t *t, hash_state_t state, thash_t **hash_tbl) add_aux_sym_tir (type_info_t *t, hash_state_t state, thash_t **hash_tbl)
{ {
AUXU *aux_ptr; AUXU *aux_ptr;
...@@ -2172,7 +2125,7 @@ add_aux_sym_tir (type_info_t *t, hash_state_t state, thash_t **hash_tbl) ...@@ -2172,7 +2125,7 @@ add_aux_sym_tir (type_info_t *t, hash_state_t state, thash_t **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 (const char *tag_start, /* 1st byte of tag name */ get_tag (const char *tag_start, /* 1st byte of tag name */
const char *tag_end_p1, /* 1st byte after tag name */ const char *tag_end_p1, /* 1st byte after tag name */
symint_t indx, /* index of tag start block */ symint_t indx, /* index of tag start block */
...@@ -2224,7 +2177,7 @@ get_tag (const char *tag_start, /* 1st byte of tag name */ ...@@ -2224,7 +2177,7 @@ get_tag (const char *tag_start, /* 1st byte of tag name */
/* Add an unknown {struct, union, enum} tag. */ /* Add an unknown {struct, union, enum} tag. */
STATIC void static void
add_unknown_tag (tag_t *ptag) add_unknown_tag (tag_t *ptag)
{ {
shash_t *hash_ptr = ptag->hash_ptr; shash_t *hash_ptr = ptag->hash_ptr;
...@@ -2283,7 +2236,7 @@ add_unknown_tag (tag_t *ptag) ...@@ -2283,7 +2236,7 @@ add_unknown_tag (tag_t *ptag)
this is the current procedure. If the assembler created a PDR for this is the current procedure. If the assembler created a PDR for
this procedure, use that to initialize the current PDR. */ this procedure, use that to initialize the current PDR. */
STATIC void static void
add_procedure (const char *func_start, /* 1st byte of func name */ add_procedure (const char *func_start, /* 1st byte of func name */
const char *func_end_p1) /* 1st byte after func name */ const char *func_end_p1) /* 1st byte after func name */
{ {
...@@ -2346,7 +2299,7 @@ add_procedure (const char *func_start, /* 1st byte of func name */ ...@@ -2346,7 +2299,7 @@ add_procedure (const char *func_start, /* 1st byte of func name */
/* Initialize the init_file structure. */ /* Initialize the init_file structure. */
STATIC void static void
initialize_init_file (void) initialize_init_file (void)
{ {
union { union {
...@@ -2384,13 +2337,13 @@ initialize_init_file (void) ...@@ -2384,13 +2337,13 @@ initialize_init_file (void)
virtual arrays (strings, symbols, aux syms, etc.). Record virtual arrays (strings, symbols, aux syms, etc.). Record
where the current file structure lives. */ where the current file structure lives. */
STATIC void static void
add_file (const char *file_start, /* first byte in string */ add_file (const char *file_start, /* first byte in string */
const char *file_end_p1) /* first byte after string */ const char *file_end_p1) /* first byte after string */
{ {
static char zero_bytes[2] = { '\0', '\0' }; static char zero_bytes[2] = { '\0', '\0' };
Ptrdiff_t len = file_end_p1 - file_start; ptrdiff_t len = file_end_p1 - file_start;
int first_ch = *file_start; int first_ch = *file_start;
efdr_t *file_ptr; efdr_t *file_ptr;
...@@ -2466,13 +2419,13 @@ add_file (const char *file_start, /* first byte in string */ ...@@ -2466,13 +2419,13 @@ add_file (const char *file_start, /* first byte in string */
/* Add a stream of random bytes to a varray. */ /* Add a stream of random bytes to a varray. */
STATIC void static void
add_bytes (varray_t *vp, /* virtual array to add too */ add_bytes (varray_t *vp, /* virtual array to add too */
char *input_ptr, /* start of the bytes */ char *input_ptr, /* start of the bytes */
Size_t nitems) /* # items to move */ size_t nitems) /* # items to move */
{ {
Size_t move_items; size_t move_items;
Size_t move_bytes; size_t move_bytes;
char *ptr; char *ptr;
while (nitems > 0) while (nitems > 0)
...@@ -2504,7 +2457,7 @@ add_bytes (varray_t *vp, /* virtual array to add too */ ...@@ -2504,7 +2457,7 @@ add_bytes (varray_t *vp, /* virtual array to add too */
/* Convert storage class to string. */ /* Convert storage class to string. */
STATIC const char * static const char *
sc_to_string (sc_t storage_class) sc_to_string (sc_t storage_class)
{ {
switch (storage_class) switch (storage_class)
...@@ -2541,7 +2494,7 @@ sc_to_string (sc_t storage_class) ...@@ -2541,7 +2494,7 @@ sc_to_string (sc_t storage_class)
/* Convert symbol type to string. */ /* Convert symbol type to string. */
STATIC const char * static const char *
st_to_string (st_t symbol_type) st_to_string (st_t symbol_type)
{ {
switch (symbol_type) switch (symbol_type)
...@@ -2577,7 +2530,7 @@ st_to_string (st_t symbol_type) ...@@ -2577,7 +2530,7 @@ st_to_string (st_t symbol_type)
(which is grows if the line is too big). We split lines at the (which is grows if the line is too big). We split lines at the
semi-colon, and return each logical line independently. */ semi-colon, and return each logical line independently. */
STATIC char * static char *
read_line (void) read_line (void)
{ {
static int line_split_p = 0; static int line_split_p = 0;
...@@ -2653,7 +2606,7 @@ read_line (void) ...@@ -2653,7 +2606,7 @@ read_line (void)
/* Parse #.begin directives which have a label as the first argument /* Parse #.begin directives which have a label as the first argument
which gives the location of the start of the block. */ which gives the location of the start of the block. */
STATIC void static void
parse_begin (const char *start) parse_begin (const char *start)
{ {
const char *end_p1; /* end of label */ const char *end_p1; /* end of label */
...@@ -2704,7 +2657,7 @@ parse_begin (const char *start) ...@@ -2704,7 +2657,7 @@ parse_begin (const char *start)
/* Parse #.bend directives which have a label as the first argument /* Parse #.bend directives which have a label as the first argument
which gives the location of the end of the block. */ which gives the location of the end of the block. */
STATIC void static void
parse_bend (const char *start) parse_bend (const char *start)
{ {
const char *end_p1; /* end of label */ const char *end_p1; /* end of label */
...@@ -2762,7 +2715,7 @@ parse_bend (const char *start) ...@@ -2762,7 +2715,7 @@ parse_bend (const char *start)
.dim specify an array dimension .dim specify an array dimension
.tag specify a tag for a struct, union, or enum. */ .tag specify a tag for a struct, union, or enum. */
STATIC void static void
parse_def (const char *name_start) parse_def (const char *name_start)
{ {
const char *dir_start; /* start of current directive*/ const char *dir_start; /* start of current directive*/
...@@ -2784,7 +2737,7 @@ parse_def (const char *name_start) ...@@ -2784,7 +2737,7 @@ parse_def (const char *name_start)
symint_t temp_array[ N_TQ ]; symint_t temp_array[ N_TQ ];
int arg_was_number; int arg_was_number;
int ch, i; int ch, i;
Ptrdiff_t len; ptrdiff_t len;
static int inside_enumeration = 0; /* is this an enumeration? */ static int inside_enumeration = 0; /* is this an enumeration? */
...@@ -2805,7 +2758,6 @@ parse_def (const char *name_start) ...@@ -2805,7 +2758,6 @@ parse_def (const char *name_start)
if (ch == '\0') if (ch == '\0')
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -2819,7 +2771,6 @@ parse_def (const char *name_start) ...@@ -2819,7 +2771,6 @@ parse_def (const char *name_start)
if (ch != '.') if (ch != '.')
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -2836,7 +2787,6 @@ parse_def (const char *name_start) ...@@ -2836,7 +2787,6 @@ parse_def (const char *name_start)
if (ch == '\0' || ISSPACE (ch)) if (ch == '\0' || ISSPACE (ch))
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
} }
...@@ -2861,7 +2811,6 @@ parse_def (const char *name_start) ...@@ -2861,7 +2811,6 @@ parse_def (const char *name_start)
else if (ch == '\0' || ISSPACE (ch)) else if (ch == '\0' || ISSPACE (ch))
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -2876,7 +2825,6 @@ parse_def (const char *name_start) ...@@ -2876,7 +2825,6 @@ parse_def (const char *name_start)
if (ch == '\0') if (ch == '\0')
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
} }
...@@ -2887,7 +2835,6 @@ parse_def (const char *name_start) ...@@ -2887,7 +2835,6 @@ parse_def (const char *name_start)
{ {
default: default:
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
case 'd': case 'd':
...@@ -2916,7 +2863,6 @@ parse_def (const char *name_start) ...@@ -2916,7 +2863,6 @@ parse_def (const char *name_start)
if (t_ptr == &temp_array[0]) if (t_ptr == &temp_array[0])
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -2930,7 +2876,6 @@ parse_def (const char *name_start) ...@@ -2930,7 +2876,6 @@ parse_def (const char *name_start)
if (t.num_dims >= N_TQ-1) if (t.num_dims >= N_TQ-1)
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -2941,7 +2886,6 @@ parse_def (const char *name_start) ...@@ -2941,7 +2886,6 @@ parse_def (const char *name_start)
else else
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -2990,7 +2934,6 @@ parse_def (const char *name_start) ...@@ -2990,7 +2934,6 @@ parse_def (const char *name_start)
if (t_ptr == &temp_array[0]) if (t_ptr == &temp_array[0])
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -3004,7 +2947,6 @@ parse_def (const char *name_start) ...@@ -3004,7 +2947,6 @@ parse_def (const char *name_start)
if (t.num_sizes >= N_TQ-1) if (t.num_sizes >= N_TQ-1)
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -3016,7 +2958,6 @@ parse_def (const char *name_start) ...@@ -3016,7 +2958,6 @@ parse_def (const char *name_start)
else else
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -3065,7 +3006,6 @@ parse_def (const char *name_start) ...@@ -3065,7 +3006,6 @@ parse_def (const char *name_start)
else else
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -3126,7 +3066,6 @@ parse_def (const char *name_start) ...@@ -3126,7 +3066,6 @@ parse_def (const char *name_start)
else else
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
} }
...@@ -3154,7 +3093,6 @@ parse_def (const char *name_start) ...@@ -3154,7 +3093,6 @@ parse_def (const char *name_start)
if (num_real_sizes != 1 || diff < 0) if (num_real_sizes != 1 || diff < 0)
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -3243,7 +3181,6 @@ parse_def (const char *name_start) ...@@ -3243,7 +3181,6 @@ parse_def (const char *name_start)
if (t.num_sizes - t.num_dims - t.extra_sizes != 1) if (t.num_sizes - t.num_dims - t.extra_sizes != 1)
{ {
error_line = __LINE__; error_line = __LINE__;
saber_stop ();
goto bomb_out; goto bomb_out;
} }
...@@ -3337,7 +3274,7 @@ bomb_out: ...@@ -3337,7 +3274,7 @@ bomb_out:
/* Parse .end directives. */ /* Parse .end directives. */
STATIC void static void
parse_end (const char *start) parse_end (const char *start)
{ {
const char *start_func, *end_func_p1; const char *start_func, *end_func_p1;
...@@ -3399,7 +3336,7 @@ parse_end (const char *start) ...@@ -3399,7 +3336,7 @@ parse_end (const char *start)
/* Parse .ent directives. */ /* Parse .ent directives. */
STATIC void static void
parse_ent (const char *start) parse_ent (const char *start)
{ {
const char *start_func, *end_func_p1; const char *start_func, *end_func_p1;
...@@ -3436,7 +3373,7 @@ parse_ent (const char *start) ...@@ -3436,7 +3373,7 @@ parse_ent (const char *start)
/* Parse .file directives. */ /* Parse .file directives. */
STATIC void static void
parse_file (const char *start) parse_file (const char *start)
{ {
char *p; char *p;
...@@ -3508,7 +3445,7 @@ mark_stabs (const char *start ATTRIBUTE_UNUSED) ...@@ -3508,7 +3445,7 @@ mark_stabs (const char *start ATTRIBUTE_UNUSED)
0 a zero or a line number 0 a zero or a line number
value a numeric value or an address. */ value a numeric value or an address. */
STATIC void static void
parse_stabs_common (const char *string_start, /* start of string or NULL */ parse_stabs_common (const char *string_start, /* start of string or NULL */
const char *string_end, /* end+1 of string or NULL */ const char *string_end, /* end+1 of string or NULL */
const char *rest) /* rest of the directive. */ const char *rest) /* rest of the directive. */
...@@ -3706,7 +3643,7 @@ parse_stabs_common (const char *string_start, /* start of string or NULL */ ...@@ -3706,7 +3643,7 @@ parse_stabs_common (const char *string_start, /* start of string or NULL */
} }
STATIC void static void
parse_stabs (const char *start) parse_stabs (const char *start)
{ {
const char *end = strchr (start+1, '"'); const char *end = strchr (start+1, '"');
...@@ -3721,7 +3658,7 @@ parse_stabs (const char *start) ...@@ -3721,7 +3658,7 @@ parse_stabs (const char *start)
} }
STATIC void static void
parse_stabn (const char *start) parse_stabn (const char *start)
{ {
parse_stabs_common ((const char *) 0, (const char *) 0, start); parse_stabs_common ((const char *) 0, (const char *) 0, start);
...@@ -3731,11 +3668,11 @@ parse_stabn (const char *start) ...@@ -3731,11 +3668,11 @@ parse_stabn (const char *start)
/* Parse the input file, and write the lines to the output file /* Parse the input file, and write the lines to the output file
if needed. */ if needed. */
STATIC void static void
parse_input (void) parse_input (void)
{ {
char *p; char *p;
Size_t i; size_t i;
thead_t *ptag_head; thead_t *ptag_head;
tag_t *ptag; tag_t *ptag;
tag_t *ptag_next; tag_t *ptag_next;
...@@ -3794,7 +3731,7 @@ parse_input (void) ...@@ -3794,7 +3731,7 @@ parse_input (void)
/* Update the global headers with the final offsets in preparation /* Update the global headers with the final offsets in preparation
to write out the .T file. */ to write out the .T file. */
STATIC void static void
update_headers (void) update_headers (void)
{ {
symint_t i; symint_t i;
...@@ -3842,14 +3779,14 @@ update_headers (void) ...@@ -3842,14 +3779,14 @@ update_headers (void)
if ((st_t) sym->st == st_Static) if ((st_t) sym->st == st_Static)
{ {
char *str = ORIG_LSTRS (fd_ptr->issBase + sym->iss); char *str = ORIG_LSTRS (fd_ptr->issBase + sym->iss);
Size_t len = strlen (str); size_t len = strlen (str);
shash_t *hash_ptr; shash_t *hash_ptr;
/* Ignore internal labels. */ /* Ignore internal labels. */
if (str[0] == '$' && str[1] == 'L') if (str[0] == '$' && str[1] == 'L')
continue; continue;
hash_ptr = hash_string (str, hash_ptr = hash_string (str,
(Ptrdiff_t) len, (ptrdiff_t) len,
&file_ptr->shash_head[0], &file_ptr->shash_head[0],
(symint_t *) 0); (symint_t *) 0);
if (hash_ptr == (shash_t *) 0) if (hash_ptr == (shash_t *) 0)
...@@ -3883,9 +3820,8 @@ update_headers (void) ...@@ -3883,9 +3820,8 @@ update_headers (void)
symbolic_header.issMax += file_ptr->fdr.cbSs; symbolic_header.issMax += file_ptr->fdr.cbSs;
} }
#ifndef ALIGN_SYMTABLE_OFFSET /* Align ecoff symbol tables to avoid OSF1/1.3 nm complaints. */
#define ALIGN_SYMTABLE_OFFSET(OFFSET) (OFFSET) #define ALIGN_SYMTABLE_OFFSET(OFFSET) (((OFFSET) + 7) & ~7)
#endif
file_offset = ALIGN_SYMTABLE_OFFSET (file_offset); file_offset = ALIGN_SYMTABLE_OFFSET (file_offset);
i = WORD_ALIGN (symbolic_header.cbLine); /* line numbers */ i = WORD_ALIGN (symbolic_header.cbLine); /* line numbers */
...@@ -3980,7 +3916,7 @@ update_headers (void) ...@@ -3980,7 +3916,7 @@ update_headers (void)
/* Write out a varray at a given location. */ /* Write out a varray at a given location. */
STATIC void static void
write_varray (varray_t *vp, /* virtual array */ write_varray (varray_t *vp, /* virtual array */
off_t offset, /* offset to write varray to */ off_t offset, /* offset to write varray to */
const char *str) /* string to print out when tracing */ const char *str) /* string to print out when tracing */
...@@ -4024,7 +3960,7 @@ write_varray (varray_t *vp, /* virtual array */ ...@@ -4024,7 +3960,7 @@ write_varray (varray_t *vp, /* virtual array */
/* Write out the symbol table in the object file. */ /* Write out the symbol table in the object file. */
STATIC void static void
write_object (void) write_object (void)
{ {
int sys_write; int sys_write;
...@@ -4249,8 +4185,8 @@ write_object (void) ...@@ -4249,8 +4185,8 @@ write_object (void)
/* Read some bytes at a specified location, and return a pointer. */ /* Read some bytes at a specified location, and return a pointer. */
STATIC page_t * static page_t *
read_seek (Size_t size, /* # bytes to read */ read_seek (size_t size, /* # bytes to read */
off_t offset, /* offset to read at */ off_t offset, /* offset to read at */
const char *str) /* name for tracing */ const char *str) /* name for tracing */
{ {
...@@ -4318,7 +4254,7 @@ read_seek (Size_t size, /* # bytes to read */ ...@@ -4318,7 +4254,7 @@ read_seek (Size_t size, /* # bytes to read */
if it is different from the input object file), and remove the old if it is different from the input object file), and remove the old
symbol table. */ symbol table. */
STATIC void static void
copy_object (void) copy_object (void)
{ {
char buffer[ PAGE_SIZE ]; char buffer[ PAGE_SIZE ];
...@@ -4566,9 +4502,9 @@ copy_object (void) ...@@ -4566,9 +4502,9 @@ copy_object (void)
{ {
auto symint_t hash_index; auto symint_t hash_index;
char *str = ORIG_LSTRS (fd_ptr->issBase + sym->iss); char *str = ORIG_LSTRS (fd_ptr->issBase + sym->iss);
Size_t len = strlen (str); size_t len = strlen (str);
shash_t *shash_ptr = hash_string (str, shash_t *shash_ptr = hash_string (str,
(Ptrdiff_t) len, (ptrdiff_t) len,
&orig_str_hash[0], &orig_str_hash[0],
&hash_index); &hash_index);
...@@ -4596,9 +4532,9 @@ copy_object (void) ...@@ -4596,9 +4532,9 @@ copy_object (void)
if (*str != '\0') if (*str != '\0')
{ {
Size_t len = strlen (str); size_t len = strlen (str);
shash_t *shash_ptr = hash_string (str, shash_t *shash_ptr = hash_string (str,
(Ptrdiff_t) len, (ptrdiff_t) len,
&orig_str_hash[0], &orig_str_hash[0],
(symint_t *) 0); (symint_t *) 0);
...@@ -4626,9 +4562,9 @@ copy_object (void) ...@@ -4626,9 +4562,9 @@ copy_object (void)
{ {
SYMR *proc_sym = ORIG_LSYMS (fd_ptr->isymBase + proc->isym); SYMR *proc_sym = ORIG_LSYMS (fd_ptr->isymBase + proc->isym);
char *str = ORIG_LSTRS (fd_ptr->issBase + proc_sym->iss); char *str = ORIG_LSTRS (fd_ptr->issBase + proc_sym->iss);
Size_t len = strlen (str); size_t len = strlen (str);
shash_t *shash_ptr = hash_string (str, shash_t *shash_ptr = hash_string (str,
(Ptrdiff_t) len, (ptrdiff_t) len,
&orig_str_hash[0], &orig_str_hash[0],
(symint_t *) 0); (symint_t *) 0);
...@@ -4704,7 +4640,7 @@ main (int argc, char **argv) ...@@ -4704,7 +4640,7 @@ main (int argc, char **argv)
(void) signal (SIGBUS, catch_signal); (void) signal (SIGBUS, catch_signal);
(void) signal (SIGABRT, catch_signal); (void) signal (SIGABRT, catch_signal);
#if !defined(__SABER__) && !defined(lint) #ifndef lint
if (sizeof (efdr_t) > PAGE_USIZE) if (sizeof (efdr_t) > PAGE_USIZE)
fatal ("efdr_t has a sizeof %d bytes, when it should be less than %d", fatal ("efdr_t has a sizeof %d bytes, when it should be less than %d",
(int) sizeof (efdr_t), (int) sizeof (efdr_t),
...@@ -4916,7 +4852,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" ...@@ -4916,7 +4852,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
/* Catch a signal and exit without dumping core. */ /* Catch a signal and exit without dumping core. */
STATIC void static void
catch_signal (int signum) catch_signal (int signum)
{ {
(void) signal (signum, SIG_DFL); /* just in case... */ (void) signal (signum, SIG_DFL); /* just in case... */
...@@ -4973,8 +4909,8 @@ out_of_bounds (symint_t indx, /* index that is out of bounds */ ...@@ -4973,8 +4909,8 @@ out_of_bounds (symint_t indx, /* index that is out of bounds */
#ifndef MALLOC_CHECK #ifndef MALLOC_CHECK
#ifdef USE_MALLOC #ifdef USE_MALLOC
STATIC page_t * static page_t *
allocate_cluster (Size_t npages) allocate_cluster (size_t npages)
{ {
page_t *value = xcalloc (npages, PAGE_USIZE); page_t *value = xcalloc (npages, PAGE_USIZE);
...@@ -4986,8 +4922,8 @@ allocate_cluster (Size_t npages) ...@@ -4986,8 +4922,8 @@ allocate_cluster (Size_t npages)
#else /* USE_MALLOC */ #else /* USE_MALLOC */
STATIC page_t * static page_t *
allocate_cluster (Size_t npages) allocate_cluster (size_t npages)
{ {
page_t *ptr = (page_t *) sbrk (0); /* current sbreak */ page_t *ptr = (page_t *) sbrk (0); /* current sbreak */
unsigned long offset = ((unsigned long) ptr) & (PAGE_SIZE - 1); unsigned long offset = ((unsigned long) ptr) & (PAGE_SIZE - 1);
...@@ -5021,8 +4957,8 @@ static unsigned pages_left = 0; ...@@ -5021,8 +4957,8 @@ static unsigned pages_left = 0;
/* Allocate some pages (which is initialized to 0). */ /* Allocate some pages (which is initialized to 0). */
STATIC page_t * static page_t *
allocate_multiple_pages (Size_t npages) allocate_multiple_pages (size_t npages)
{ {
#ifndef MALLOC_CHECK #ifndef MALLOC_CHECK
if (pages_left == 0 && npages < MAX_CLUSTER_PAGES) if (pages_left == 0 && npages < MAX_CLUSTER_PAGES)
...@@ -5050,8 +4986,8 @@ allocate_multiple_pages (Size_t npages) ...@@ -5050,8 +4986,8 @@ allocate_multiple_pages (Size_t npages)
/* Release some pages. */ /* Release some pages. */
STATIC void static void
free_multiple_pages (page_t *page_ptr, Size_t npages) free_multiple_pages (page_t *page_ptr, size_t npages)
{ {
#ifndef MALLOC_CHECK #ifndef MALLOC_CHECK
if (pages_left == 0) if (pages_left == 0)
...@@ -5079,7 +5015,7 @@ free_multiple_pages (page_t *page_ptr, Size_t npages) ...@@ -5079,7 +5015,7 @@ free_multiple_pages (page_t *page_ptr, Size_t npages)
/* Allocate one page (which is initialized to 0). */ /* Allocate one page (which is initialized to 0). */
STATIC page_t * static page_t *
allocate_page (void) allocate_page (void)
{ {
#ifndef MALLOC_CHECK #ifndef MALLOC_CHECK
...@@ -5101,7 +5037,7 @@ allocate_page (void) ...@@ -5101,7 +5037,7 @@ allocate_page (void)
/* Allocate scoping information. */ /* Allocate scoping information. */
STATIC scope_t * static scope_t *
allocate_scope (void) allocate_scope (void)
{ {
scope_t *ptr; scope_t *ptr;
...@@ -5140,7 +5076,7 @@ allocate_scope (void) ...@@ -5140,7 +5076,7 @@ allocate_scope (void)
/* Free scoping information. */ /* Free scoping information. */
STATIC void static void
free_scope (scope_t *ptr) free_scope (scope_t *ptr)
{ {
alloc_counts[ (int) alloc_type_scope ].total_free++; alloc_counts[ (int) alloc_type_scope ].total_free++;
...@@ -5158,7 +5094,7 @@ free_scope (scope_t *ptr) ...@@ -5158,7 +5094,7 @@ free_scope (scope_t *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 (void) allocate_vlinks (void)
{ {
vlinks_t *ptr; vlinks_t *ptr;
...@@ -5191,7 +5127,7 @@ allocate_vlinks (void) ...@@ -5191,7 +5127,7 @@ allocate_vlinks (void)
/* Allocate string hash buckets. */ /* Allocate string hash buckets. */
STATIC shash_t * static shash_t *
allocate_shash (void) allocate_shash (void)
{ {
shash_t *ptr; shash_t *ptr;
...@@ -5224,7 +5160,7 @@ allocate_shash (void) ...@@ -5224,7 +5160,7 @@ allocate_shash (void)
/* Allocate type hash buckets. */ /* Allocate type hash buckets. */
STATIC thash_t * static thash_t *
allocate_thash (void) allocate_thash (void)
{ {
thash_t *ptr; thash_t *ptr;
...@@ -5257,7 +5193,7 @@ allocate_thash (void) ...@@ -5257,7 +5193,7 @@ allocate_thash (void)
/* Allocate structure, union, or enum tag information. */ /* Allocate structure, union, or enum tag information. */
STATIC tag_t * static tag_t *
allocate_tag (void) allocate_tag (void)
{ {
tag_t *ptr; tag_t *ptr;
...@@ -5296,7 +5232,7 @@ allocate_tag (void) ...@@ -5296,7 +5232,7 @@ allocate_tag (void)
/* Free scoping information. */ /* Free scoping information. */
STATIC void static void
free_tag (tag_t *ptr) free_tag (tag_t *ptr)
{ {
alloc_counts[ (int) alloc_type_tag ].total_free++; alloc_counts[ (int) alloc_type_tag ].total_free++;
...@@ -5314,7 +5250,7 @@ free_tag (tag_t *ptr) ...@@ -5314,7 +5250,7 @@ free_tag (tag_t *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 (void) allocate_forward (void)
{ {
forward_t *ptr; forward_t *ptr;
...@@ -5353,7 +5289,7 @@ allocate_forward (void) ...@@ -5353,7 +5289,7 @@ allocate_forward (void)
/* Free scoping information. */ /* Free scoping information. */
STATIC void static void
free_forward (forward_t *ptr) free_forward (forward_t *ptr)
{ {
alloc_counts[ (int) alloc_type_forward ].total_free++; alloc_counts[ (int) alloc_type_forward ].total_free++;
...@@ -5371,7 +5307,7 @@ free_forward (forward_t *ptr) ...@@ -5371,7 +5307,7 @@ free_forward (forward_t *ptr)
/* Allocate head of type hash list. */ /* Allocate head of type hash list. */
STATIC thead_t * static thead_t *
allocate_thead (void) allocate_thead (void)
{ {
thead_t *ptr; thead_t *ptr;
...@@ -5410,7 +5346,7 @@ allocate_thead (void) ...@@ -5410,7 +5346,7 @@ allocate_thead (void)
/* Free scoping information. */ /* Free scoping information. */
STATIC void static void
free_thead (thead_t *ptr) free_thead (thead_t *ptr)
{ {
alloc_counts[ (int) alloc_type_thead ].total_free++; alloc_counts[ (int) alloc_type_thead ].total_free++;
...@@ -5424,9 +5360,6 @@ free_thead (thead_t *ptr) ...@@ -5424,9 +5360,6 @@ free_thead (thead_t *ptr)
#endif #endif
} }
#endif /* MIPS_DEBUGGING_INFO */
/* Output an error message and exit. */ /* Output an error message and exit. */
...@@ -5448,7 +5381,6 @@ fatal (const char *format, ...) ...@@ -5448,7 +5381,6 @@ fatal (const char *format, ...)
if (line_number > 0) if (line_number > 0)
fprintf (stderr, "line:\t%s\n", cur_line_start); fprintf (stderr, "line:\t%s\n", cur_line_start);
saber_stop ();
exit (1); exit (1);
} }
...@@ -5471,8 +5403,6 @@ error (const char *format, ...) ...@@ -5471,8 +5403,6 @@ error (const char *format, ...)
had_errors++; had_errors++;
va_end (ap); va_end (ap);
saber_stop ();
} }
/* More 'friendly' abort that prints the line and file. */ /* More 'friendly' abort that prints the line and file. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment