2000-11-06 Kazu Hirata <kazu@hxi.com>

* as.c: Fix formatting.
	* dwarf2dbg.c: Likewise.
	* itbl-ops.c: Likewise.
	* listing.c: Likewise.
	* macro.h: Likewise.
	* messages.c: Likewise.
	* read.c: Likewise.
	* subsegs.c: Likewise.
	* subsegs.h: Likewise.
	* write.c: Likewise.
This commit is contained in:
Kazu Hirata 2000-11-07 01:18:45 +00:00
parent 4efc3e0524
commit ef99799a42
11 changed files with 151 additions and 188 deletions

View File

@ -1,8 +1,18 @@
2000-11-06 Kazu Hirata <kazu@hxi.com> 2000-11-06 Kazu Hirata <kazu@hxi.com>
* input-file.c: Fix formatting. * as.c: Fix formatting.
* dwarf2dbg.c: Likewise.
* input-file.c: Likewise.
* input-file.h: Likewise. * input-file.h: Likewise.
* input-scrub.c: Likewise. * input-scrub.c: Likewise.
* itbl-ops.c: Likewise.
* listing.c: Likewise.
* macro.h: Likewise.
* messages.c: Likewise.
* read.c: Likewise.
* subsegs.c: Likewise.
* subsegs.h: Likewise.
* write.c: Likewise.
2000-11-06 Nick Clifton <nickc@redhat.com> 2000-11-06 Nick Clifton <nickc@redhat.com>

View File

@ -793,4 +793,3 @@ dwarf2_generate_asm_lineno (size)
/* And record the information. */ /* And record the information. */
dwarf2_gen_line_info (addr, &debug_line); dwarf2_gen_line_info (addr, &debug_line);
} }

View File

@ -114,14 +114,12 @@ int itbl_have_entries = 0;
/*======================================================================*/ /*======================================================================*/
/* structures for keeping itbl format entries */ /* structures for keeping itbl format entries */
struct itbl_range struct itbl_range {
{
int sbit; /* mask starting bit position */ int sbit; /* mask starting bit position */
int ebit; /* mask ending bit position */ int ebit; /* mask ending bit position */
}; };
struct itbl_field struct itbl_field {
{
e_type type; /* dreg/creg/greg/immed/symb */ e_type type; /* dreg/creg/greg/immed/symb */
struct itbl_range range; /* field's bitfield range within instruction */ struct itbl_range range; /* field's bitfield range within instruction */
unsigned long flags; /* field flags */ unsigned long flags; /* field flags */
@ -133,8 +131,7 @@ struct itbl_field
* instruction where the fields are the list of operands. * instruction where the fields are the list of operands.
* The flags field below uses the same values as those defined in the * The flags field below uses the same values as those defined in the
* gnu assembler and are machine specific. */ * gnu assembler and are machine specific. */
struct itbl_entry struct itbl_entry {
{
e_processor processor; /* processor number */ e_processor processor; /* processor number */
e_type type; /* dreg/creg/greg/insn */ e_type type; /* dreg/creg/greg/insn */
char *name; /* mnemionic name for insn/register */ char *name; /* mnemionic name for insn/register */
@ -149,8 +146,7 @@ struct itbl_entry
static int itbl_num_opcodes = 0; static int itbl_num_opcodes = 0;
/* Array of entries for each processor and entry type */ /* Array of entries for each processor and entry type */
static struct itbl_entry *entries[e_nprocs][e_ntypes] = static struct itbl_entry *entries[e_nprocs][e_ntypes] = {
{
{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0},
@ -273,7 +269,8 @@ itbl_add_operand (struct itbl_entry *e, int yytype, int sbit,
#include "symbols.h" #include "symbols.h"
static void append_insns_as_macros (void); static void append_insns_as_macros (void);
/* initialize for gas */ /* Initialize for gas. */
void void
itbl_init (void) itbl_init (void)
{ {
@ -612,15 +609,15 @@ itbl_disassemble (char *s, unsigned long insn)
return 0; /* opcode not in table; invalid instrustion */ return 0; /* opcode not in table; invalid instrustion */
strcpy (s, e->name); strcpy (s, e->name);
/* parse insn's args (if any) */ /* Parse insn's args (if any). */
for (f = e->fields; f; f = f->next) /* for each arg, ... */ for (f = e->fields; f; f = f->next) /* for each arg, ... */
{ {
struct itbl_entry *r; struct itbl_entry *r;
unsigned long value; unsigned long value;
if (f == e->fields) /* first operand is preceeded by tab */ if (f == e->fields) /* First operand is preceeded by tab. */
strcat (s, "\t"); strcat (s, "\t");
else /* ','s separate following operands */ else /* ','s separate following operands. */
strcat (s, ","); strcat (s, ",");
value = extract_range (insn, f->range); value = extract_range (insn, f->range);
/* n should be in form $n or 0xhhh (are symbol names valid?? */ /* n should be in form $n or 0xhhh (are symbol names valid?? */
@ -630,7 +627,7 @@ itbl_disassemble (char *s, unsigned long insn)
case e_creg: case e_creg:
case e_greg: case e_greg:
/* Accept either a string name /* Accept either a string name
* or '$' followed by the register number */ or '$' followed by the register number. */
r = find_entry_byval (e->processor, f->type, value, &f->range); r = find_entry_byval (e->processor, f->type, value, &f->range);
if (r) if (r)
strcat (s, r->name); strcat (s, r->name);
@ -638,11 +635,9 @@ itbl_disassemble (char *s, unsigned long insn)
sprintf (s, "%s$%lu", s, value); sprintf (s, "%s$%lu", s, value);
break; break;
case e_addr: case e_addr:
/* use assembler's symbol table to find symbol */ /* Use assembler's symbol table to find symbol. */
/* FIXME!! Do we need this? /* FIXME!! Do we need this? If so, what about relocs?? */
* if so, what about relocs?? /* If not a symbol, fall through to IMMED. */
*/
/* If not a symbol, fall thru to IMMED */
case e_immed: case e_immed:
sprintf (s, "%s0x%lx", s, value); sprintf (s, "%s0x%lx", s, value);
break; break;
@ -650,7 +645,7 @@ itbl_disassemble (char *s, unsigned long insn)
return 0; /* error; invalid field spec */ return 0; /* error; invalid field spec */
} }
} }
return 1; /* done! */ return 1; /* Done! */
} }
/*======================================================================*/ /*======================================================================*/

View File

@ -119,20 +119,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#endif #endif
/* This structure remembers which .s were used. */ /* This structure remembers which .s were used. */
typedef struct file_info_struct typedef struct file_info_struct {
{
struct file_info_struct * next; struct file_info_struct * next;
char * filename; char * filename;
long pos; long pos;
unsigned int linenum; unsigned int linenum;
int at_end; int at_end;
} } file_info_type;
file_info_type;
/* This structure rememebrs which line from which file goes into which /* This structure rememebrs which line from which file goes into which
frag. */ frag. */
struct list_info_struct struct list_info_struct {
{
/* Frag which this line of source is nearest to. */ /* Frag which this line of source is nearest to. */
fragS *frag; fragS *frag;
@ -157,8 +154,7 @@ struct list_info_struct
/* Pointer to any error message associated with this line. */ /* Pointer to any error message associated with this line. */
char *message; char *message;
enum enum {
{
EDICT_NONE, EDICT_NONE,
EDICT_SBTTL, EDICT_SBTTL,
EDICT_TITLE, EDICT_TITLE,

View File

@ -38,15 +38,13 @@
/* describe the formal arguments to a macro */ /* describe the formal arguments to a macro */
typedef struct formal_struct typedef struct formal_struct {
{
struct formal_struct *next; /* next formal in list */ struct formal_struct *next; /* next formal in list */
sb name; /* name of the formal */ sb name; /* name of the formal */
sb def; /* the default value */ sb def; /* the default value */
sb actual; /* the actual argument (changed on each expansion) */ sb actual; /* the actual argument (changed on each expansion) */
int index; /* the index of the formal 0..formal_count-1 */ int index; /* the index of the formal 0..formal_count-1 */
} } formal_entry;
formal_entry;
/* Other values found in the index field of a formal_entry. */ /* Other values found in the index field of a formal_entry. */
#define QUAL_INDEX (-1) #define QUAL_INDEX (-1)
@ -55,14 +53,12 @@ formal_entry;
/* describe the macro. */ /* describe the macro. */
typedef struct macro_struct typedef struct macro_struct {
{
sb sub; /* substitution text. */ sb sub; /* substitution text. */
int formal_count; /* number of formal args. */ int formal_count; /* number of formal args. */
formal_entry *formals; /* pointer to list of formal_structs */ formal_entry *formals; /* pointer to list of formal_structs */
struct hash_control *formal_hash; /* hash table of formals. */ struct hash_control *formal_hash; /* hash table of formals. */
} } macro_entry;
macro_entry;
/* Whether any macros have been defined. */ /* Whether any macros have been defined. */

View File

@ -1,5 +1,5 @@
/* messages.c - error reporter - /* messages.c - error reporter -
Copyright (C) 1987, 91, 92, 93, 94, 95, 96, 97, 1998 Copyright (C) 1987, 91, 92, 93, 94, 95, 96, 97, 98, 2000
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler. This file is part of GAS, the GNU Assembler.
@ -47,8 +47,7 @@ static void as_show_where PARAMS ((void));
static void as_warn_internal PARAMS ((char *, unsigned int, char *)); static void as_warn_internal PARAMS ((char *, unsigned int, char *));
static void as_bad_internal PARAMS ((char *, unsigned int, char *)); static void as_bad_internal PARAMS ((char *, unsigned int, char *));
/* /* Despite the rest of the comments in this file, (FIXME-SOON),
* Despite the rest of the comments in this file, (FIXME-SOON),
* here is the current scheme for error messages etc: * here is the current scheme for error messages etc:
* *
* as_fatal() is used when gas is quite confused and * as_fatal() is used when gas is quite confused and
@ -105,7 +104,8 @@ identify (file)
fprintf (stderr, _("Assembler messages:\n")); fprintf (stderr, _("Assembler messages:\n"));
} }
static int warning_count; /* Count of number of warnings issued */ /* The number of warnings issued. */
static int warning_count;
int int
had_warnings () had_warnings ()
@ -114,7 +114,7 @@ had_warnings ()
} }
/* Nonzero if we've hit a 'bad error', and should not write an obj file, /* Nonzero if we've hit a 'bad error', and should not write an obj file,
and exit with a nonzero error code */ and exit with a nonzero error code. */
static int error_count; static int error_count;
@ -138,11 +138,7 @@ as_show_where ()
fprintf (stderr, "%s:%u: ", file, line); fprintf (stderr, "%s:%u: ", file, line);
} }
/* /* Like perror(3), but with more info. */
* a s _ p e r r o r
*
* Like perror(3), but with more info.
*/
void void
as_perror (gripe, filename) as_perror (gripe, filename)
@ -165,14 +161,11 @@ as_perror (gripe, filename)
#endif #endif
} }
/* /* Send to stderr a string as a warning, and locate warning
* a s _ t s k t s k () in input file(s).
* Please only use this for when we have some recovery action.
* Send to stderr a string as a warning, and locate warning Please explain in string (which may have '\n's) what recovery was
* in input file(s). done. */
* Please only use this for when we have some recovery action.
* Please explain in string (which may have '\n's) what recovery was done.
*/
#ifdef USE_STDARG #ifdef USE_STDARG
void void
@ -185,7 +178,7 @@ as_tsktsk (const char *format,...)
vfprintf (stderr, format, args); vfprintf (stderr, format, args);
va_end (args); va_end (args);
(void) putc ('\n', stderr); (void) putc ('\n', stderr);
} /* as_tsktsk() */ }
#else #else
void void
as_tsktsk (format, va_alist) as_tsktsk (format, va_alist)
@ -199,7 +192,7 @@ as_tsktsk (format, va_alist)
vfprintf (stderr, format, args); vfprintf (stderr, format, args);
va_end (args); va_end (args);
(void) putc ('\n', stderr); (void) putc ('\n', stderr);
} /* as_tsktsk() */ }
#endif /* not NO_STDARG */ #endif /* not NO_STDARG */
/* The common portion of as_warn and as_warn_where. */ /* The common portion of as_warn and as_warn_where. */
@ -226,14 +219,11 @@ as_warn_internal (file, line, buffer)
#endif #endif
} }
/* /* Send to stderr a string as a warning, and locate warning
* a s _ w a r n () in input file(s).
* Please only use this for when we have some recovery action.
* Send to stderr a string as a warning, and locate warning Please explain in string (which may have '\n's) what recovery was
* in input file(s). done. */
* Please only use this for when we have some recovery action.
* Please explain in string (which may have '\n's) what recovery was done.
*/
#ifdef USE_STDARG #ifdef USE_STDARG
void void
@ -249,9 +239,8 @@ as_warn (const char *format,...)
va_end (args); va_end (args);
as_warn_internal ((char *) NULL, 0, buffer); as_warn_internal ((char *) NULL, 0, buffer);
} }
} /* as_warn() */ }
#else #else
/*VARARGS1 */
void void
as_warn (format, va_alist) as_warn (format, va_alist)
const char *format; const char *format;
@ -267,12 +256,12 @@ as_warn (format, va_alist)
va_end (args); va_end (args);
as_warn_internal ((char *) NULL, 0, buffer); as_warn_internal ((char *) NULL, 0, buffer);
} }
} /* as_warn() */ }
#endif /* not NO_STDARG */ #endif /* not NO_STDARG */
/* as_warn_where, like as_bad but the file name and line number are /* Like as_bad but the file name and line number are passed in.
passed in. Unfortunately, we have to repeat the function in order Unfortunately, we have to repeat the function in order to handle
to handle the varargs correctly and portably. */ the varargs correctly and portably. */
#ifdef USE_STDARG #ifdef USE_STDARG
void void
@ -288,9 +277,8 @@ as_warn_where (char *file, unsigned int line, const char *format,...)
va_end (args); va_end (args);
as_warn_internal (file, line, buffer); as_warn_internal (file, line, buffer);
} }
} /* as_warn() */ }
#else #else
/*VARARGS1 */
void void
as_warn_where (file, line, format, va_alist) as_warn_where (file, line, format, va_alist)
char *file; char *file;
@ -308,7 +296,7 @@ as_warn_where (file, line, format, va_alist)
va_end (args); va_end (args);
as_warn_internal (file, line, buffer); as_warn_internal (file, line, buffer);
} }
} /* as_warn() */ }
#endif /* not NO_STDARG */ #endif /* not NO_STDARG */
/* The common portion of as_bad and as_bad_where. */ /* The common portion of as_bad and as_bad_where. */
@ -335,14 +323,11 @@ as_bad_internal (file, line, buffer)
#endif #endif
} }
/* /* Send to stderr a string as a warning, and locate warning in input
* a s _ b a d () file(s). Please us when there is no recovery, but we want to
* continue processing but not produce an object file.
* Send to stderr a string as a warning, and locate warning in input file(s). Please explain in string (which may have '\n's) what recovery was
* Please us when there is no recovery, but we want to continue processing done. */
* but not produce an object file.
* Please explain in string (which may have '\n's) what recovery was done.
*/
#ifdef USE_STDARG #ifdef USE_STDARG
void void
@ -359,7 +344,6 @@ as_bad (const char *format,...)
} }
#else #else
/*VARARGS1 */
void void
as_bad (format, va_alist) as_bad (format, va_alist)
const char *format; const char *format;
@ -376,9 +360,9 @@ as_bad (format, va_alist)
} }
#endif /* not NO_STDARG */ #endif /* not NO_STDARG */
/* as_bad_where, like as_bad but the file name and line number are /* Like as_bad but the file name and line number are passed in.
passed in. Unfortunately, we have to repeat the function in order Unfortunately, we have to repeat the function in order to handle
to handle the varargs correctly and portably. */ the varargs correctly and portably. */
#ifdef USE_STDARG #ifdef USE_STDARG
void void
@ -395,7 +379,6 @@ as_bad_where (char *file, unsigned int line, const char *format,...)
} }
#else #else
/*VARARGS1 */
void void
as_bad_where (file, line, format, va_alist) as_bad_where (file, line, format, va_alist)
char *file; char *file;
@ -414,14 +397,10 @@ as_bad_where (file, line, format, va_alist)
} }
#endif /* not NO_STDARG */ #endif /* not NO_STDARG */
/* /* Send to stderr a string as a fatal message, and print location of
* a s _ f a t a l () error in input file(s).
* Please only use this for when we DON'T have some recovery action.
* Send to stderr a string as a fatal message, and print location of error in It xexit()s with a warning status. */
* input file(s).
* Please only use this for when we DON'T have some recovery action.
* It xexit()s with a warning status.
*/
#ifdef USE_STDARG #ifdef USE_STDARG
void void
@ -436,9 +415,8 @@ as_fatal (const char *format,...)
(void) putc ('\n', stderr); (void) putc ('\n', stderr);
va_end (args); va_end (args);
xexit (EXIT_FAILURE); xexit (EXIT_FAILURE);
} /* as_fatal() */ }
#else #else
/*VARARGS1*/
void void
as_fatal (format, va_alist) as_fatal (format, va_alist)
char *format; char *format;
@ -453,13 +431,11 @@ as_fatal (format, va_alist)
(void) putc ('\n', stderr); (void) putc ('\n', stderr);
va_end (args); va_end (args);
xexit (EXIT_FAILURE); xexit (EXIT_FAILURE);
} /* as_fatal() */ }
#endif /* not NO_STDARG */ #endif /* not NO_STDARG */
/* /* Indicate assertion failure.
* as_assert: Indicate assertion failure. Arguments: Filename, line number, optional function name. */
* Arguments: Filename, line number, optional function name.
*/
void void
as_assert (file, line, fn) as_assert (file, line, fn)
@ -479,6 +455,7 @@ as_assert (file, line, fn)
/* as_abort: Print a friendly message saying how totally hosed we are, /* as_abort: Print a friendly message saying how totally hosed we are,
and exit without producing a core file. */ and exit without producing a core file. */
void void
as_abort (file, line, fn) as_abort (file, line, fn)
const char *file, *fn; const char *file, *fn;
@ -536,5 +513,3 @@ sprint_value (buf, val)
#endif #endif
abort (); abort ();
} }
/* end of messages.c */

View File

@ -119,8 +119,7 @@ die horribly;
#endif #endif
/* Used by is_... macros. our ctype[]. */ /* Used by is_... macros. our ctype[]. */
char lex_type[256] = char lex_type[256] = {
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* @ABCDEFGHIJKLMNO */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* @ABCDEFGHIJKLMNO */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ[\]^_ */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ[\]^_ */
0, 0, 0, LEX_HASH, LEX_DOLLAR, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */ 0, 0, 0, LEX_HASH, LEX_DOLLAR, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */
@ -141,8 +140,7 @@ char lex_type[256] =
/* In: a character. /* In: a character.
Out: 1 if this character ends a line. */ Out: 1 if this character ends a line. */
char is_end_of_line[256] = char is_end_of_line[256] = {
{
#ifdef CR_EOL #ifdef CR_EOL
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, /* @abcdefghijklmno */ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, /* @abcdefghijklmno */
#else #else
@ -275,8 +273,7 @@ read_begin ()
static struct hash_control *po_hash; static struct hash_control *po_hash;
static const pseudo_typeS potable[] = static const pseudo_typeS potable[] = {
{
{"abort", s_abort, 0}, {"abort", s_abort, 0},
{"align", s_align_ptwo, 0}, {"align", s_align_ptwo, 0},
{"ascii", stringer, 0}, {"ascii", stringer, 0},
@ -3819,7 +3816,8 @@ parse_bitfield_cons (exp, nbytes)
break; break;
} /* Won't fit. */ } /* Won't fit. */
hold = ++input_line_pointer; /* skip ':' */ /* Skip ':'. */
hold = ++input_line_pointer;
(void) expression (exp); (void) expression (exp);
if (exp->X_op != O_constant) if (exp->X_op != O_constant)

View File

@ -19,9 +19,7 @@
Software Foundation, 59 Temple Place - Suite 330, Boston, MA Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */ 02111-1307, USA. */
/* /* Segments & sub-segments. */
* Segments & sub-segments.
*/
#include "as.h" #include "as.h"
@ -41,8 +39,7 @@ segment_info_type segment_info[SEG_MAXIMUM_ORDINAL];
frchainS *data0_frchainP, *bss0_frchainP; frchainS *data0_frchainP, *bss0_frchainP;
#endif /* MANY_SEGMENTS */ #endif /* MANY_SEGMENTS */
char const *const seg_name[] = char const *const seg_name[] = {
{
"absolute", "absolute",
#ifdef MANY_SEGMENTS #ifdef MANY_SEGMENTS
"e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9",
@ -567,8 +564,7 @@ section_symbol (sec)
/* Return whether the specified segment is thought to hold text. */ /* Return whether the specified segment is thought to hold text. */
#ifndef BFD_ASSEMBLER #ifndef BFD_ASSEMBLER
const char * const nontext_section_names[] = const char * const nontext_section_names[] = {
{
".eh_frame", ".eh_frame",
".gcc_except_table", ".gcc_except_table",
#ifdef OBJ_COFF #ifdef OBJ_COFF

View File

@ -64,8 +64,7 @@ extern frchainS *frchain_root;
frag chain, even if it contains no (complete) frags. */ frag chain, even if it contains no (complete) frags. */
extern frchainS *frchain_now; extern frchainS *frchain_now;
typedef struct segment_info_struct typedef struct segment_info_struct {
{
frchainS *frchainP; frchainS *frchainP;
unsigned int hadone : 1; unsigned int hadone : 1;
@ -103,8 +102,7 @@ typedef struct segment_info_struct
symbolS *sym; symbolS *sym;
#endif #endif
union union {
{
/* Current size of section holding stabs strings. */ /* Current size of section holding stabs strings. */
unsigned long stab_string_size; unsigned long stab_string_size;
/* Initial frag for ELF. */ /* Initial frag for ELF. */