* 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.
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-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>
new_argv[new_argc++] = optarg;
new_argv[new_argc] = NULL;
break;
-
+
case OPTION_TARGET_HELP:
md_show_usage (stdout);
exit (EXIT_SUCCESS);
{
bfd_vma addr;
static struct dwarf2_line_info debug_line;
-
+
/* First update the notion of the current source line. */
- dwarf2_where (& debug_line);
-
+ dwarf2_where (&debug_line);
+
/* We want the offset of the start of this
instruction within the the current frag. */
addr = frag_now->fr_address + frag_now_fix () - size;
-
+
/* And record the information. */
- dwarf2_gen_line_info (addr, & debug_line);
+ dwarf2_gen_line_info (addr, &debug_line);
}
-
/*======================================================================*/
/* structures for keeping itbl format entries */
-struct itbl_range
- {
- int sbit; /* mask starting bit position */
- int ebit; /* mask ending bit position */
- };
-
-struct itbl_field
- {
- e_type type; /* dreg/creg/greg/immed/symb */
- struct itbl_range range; /* field's bitfield range within instruction */
- unsigned long flags; /* field flags */
- struct itbl_field *next; /* next field in list */
- };
+struct itbl_range {
+ int sbit; /* mask starting bit position */
+ int ebit; /* mask ending bit position */
+};
+
+struct itbl_field {
+ e_type type; /* dreg/creg/greg/immed/symb */
+ struct itbl_range range; /* field's bitfield range within instruction */
+ unsigned long flags; /* field flags */
+ struct itbl_field *next; /* next field in list */
+};
/* These structures define the instructions and registers for a processor.
* If the type is an instruction, the structure defines the format of an
* instruction where the fields are the list of operands.
* The flags field below uses the same values as those defined in the
* gnu assembler and are machine specific. */
-struct itbl_entry
- {
- e_processor processor; /* processor number */
- e_type type; /* dreg/creg/greg/insn */
- char *name; /* mnemionic name for insn/register */
- unsigned long value; /* opcode/instruction mask/register number */
- unsigned long flags; /* effects of the instruction */
- struct itbl_range range; /* bit range within instruction for value */
- struct itbl_field *fields; /* list of operand definitions (if any) */
- struct itbl_entry *next; /* next entry */
- };
+struct itbl_entry {
+ e_processor processor; /* processor number */
+ e_type type; /* dreg/creg/greg/insn */
+ char *name; /* mnemionic name for insn/register */
+ unsigned long value; /* opcode/instruction mask/register number */
+ unsigned long flags; /* effects of the instruction */
+ struct itbl_range range; /* bit range within instruction for value */
+ struct itbl_field *fields; /* list of operand definitions (if any) */
+ struct itbl_entry *next; /* next entry */
+};
/* local data and structures */
static int itbl_num_opcodes = 0;
/* 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},
#include "symbols.h"
static void append_insns_as_macros (void);
-/* initialize for gas */
+/* Initialize for gas. */
+
void
itbl_init (void)
{
e_type type;
if (!itbl_have_entries)
- return;
+ return;
/* Since register names don't have a prefix, put them in the symbol table so
they can't be used as symbols. This simplifies argument parsing as
for (e = *es; e; e = e->next)
{
symbol_table_insert (symbol_create (e->name, reg_section,
- e->value, &zero_address_frag));
+ e->value, &zero_address_frag));
}
}
append_insns_as_macros ();
int n, id, size, new_size, new_num_opcodes;
if (!itbl_have_entries)
- return;
+ return;
if (!itbl_num_opcodes) /* no new instructions to add! */
{
struct itbl_field *f;
if (!ITBL_IS_INSN (insn))
- return 0; /* error*/
+ return 0; /* error */
processor = get_processor (ITBL_DECODE_PNUM (insn));
/* find entry in list */
return 0; /* opcode not in table; invalid instrustion */
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, ... */
{
struct itbl_entry *r;
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");
- else /* ','s separate following operands */
+ else /* ','s separate following operands. */
strcat (s, ",");
value = extract_range (insn, f->range);
/* n should be in form $n or 0xhhh (are symbol names valid?? */
case e_creg:
case e_greg:
/* 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);
if (r)
strcat (s, r->name);
sprintf (s, "%s$%lu", s, value);
break;
case e_addr:
- /* use assembler's symbol table to find symbol */
- /* FIXME!! Do we need this?
- * if so, what about relocs??
- */
- /* If not a symbol, fall thru to IMMED */
+ /* Use assembler's symbol table to find symbol. */
+ /* FIXME!! Do we need this? If so, what about relocs?? */
+ /* If not a symbol, fall through to IMMED. */
case e_immed:
sprintf (s, "%s0x%lx", s, value);
break;
return 0; /* error; invalid field spec */
}
}
- return 1; /* done! */
+ return 1; /* Done! */
}
/*======================================================================*/
#endif
/* This structure remembers which .s were used. */
-typedef struct file_info_struct
-{
+typedef struct file_info_struct {
struct file_info_struct * next;
char * filename;
long pos;
unsigned int linenum;
int at_end;
-}
-file_info_type;
+} file_info_type;
/* This structure rememebrs which line from which file goes into which
frag. */
-struct list_info_struct
-{
+struct list_info_struct {
/* Frag which this line of source is nearest to. */
fragS *frag;
/* Pointer to any error message associated with this line. */
char *message;
- enum
- {
- EDICT_NONE,
- EDICT_SBTTL,
- EDICT_TITLE,
- EDICT_NOLIST,
- EDICT_LIST,
- EDICT_NOLIST_NEXT,
- EDICT_EJECT
- } edict;
+ enum {
+ EDICT_NONE,
+ EDICT_SBTTL,
+ EDICT_TITLE,
+ EDICT_NOLIST,
+ EDICT_LIST,
+ EDICT_NOLIST_NEXT,
+ EDICT_EJECT
+ } edict;
char *edict_arg;
/* Nonzero if this line is to be omitted because it contains
extern int listing;
/* File to output listings to. */
-static FILE * list_file;
+static FILE *list_file;
/* This static array is used to keep the text of data to be printed
before the start of the line. */
/* Prototypes. */
static void listing_message PARAMS ((const char *name, const char *message));
-static file_info_type * file_info PARAMS ((const char *file_name));
+static file_info_type *file_info PARAMS ((const char *file_name));
static void new_frag PARAMS ((void));
static char *buffer_line PARAMS ((file_info_type *file,
char *line, unsigned int size));
/* describe the formal arguments to a macro */
-typedef struct formal_struct
- {
- struct formal_struct *next; /* next formal in list */
- sb name; /* name of the formal */
- sb def; /* the default value */
- sb actual; /* the actual argument (changed on each expansion) */
- int index; /* the index of the formal 0..formal_count-1 */
- }
-formal_entry;
+typedef struct formal_struct {
+ struct formal_struct *next; /* next formal in list */
+ sb name; /* name of the formal */
+ sb def; /* the default value */
+ sb actual; /* the actual argument (changed on each expansion) */
+ int index; /* the index of the formal 0..formal_count-1 */
+} formal_entry;
/* Other values found in the index field of a formal_entry. */
#define QUAL_INDEX (-1)
/* describe the macro. */
-typedef struct macro_struct
- {
- sb sub; /* substitution text. */
- int formal_count; /* number of formal args. */
- formal_entry *formals; /* pointer to list of formal_structs */
- struct hash_control *formal_hash; /* hash table of formals. */
- }
-macro_entry;
+typedef struct macro_struct {
+ sb sub; /* substitution text. */
+ int formal_count; /* number of formal args. */
+ formal_entry *formals; /* pointer to list of formal_structs */
+ struct hash_control *formal_hash; /* hash table of formals. */
+} macro_entry;
/* Whether any macros have been defined. */
/* 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.
This file is part of GAS, the GNU Assembler.
static void as_warn_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:
*
* as_fatal() is used when gas is quite confused and
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
had_warnings ()
}
/* 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;
fprintf (stderr, "%s:%u: ", file, line);
}
-/*
- * a s _ p e r r o r
- *
- * Like perror(3), but with more info.
- */
+/* Like perror(3), but with more info. */
void
as_perror (gripe, filename)
#endif
}
-/*
- * a s _ t s k t s k ()
- *
- * Send to stderr a string as a warning, and locate warning
- * in input file(s).
- * Please only use this for when we have some recovery action.
- * Please explain in string (which may have '\n's) what recovery was done.
- */
+/* Send to stderr a string as a warning, and locate warning
+ in input file(s).
+ 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
void
-as_tsktsk (const char *format,...)
+as_tsktsk (const char *format, ...)
{
va_list args;
vfprintf (stderr, format, args);
va_end (args);
(void) putc ('\n', stderr);
-} /* as_tsktsk() */
+}
#else
void
as_tsktsk (format, va_alist)
vfprintf (stderr, format, args);
va_end (args);
(void) putc ('\n', stderr);
-} /* as_tsktsk() */
+}
#endif /* not NO_STDARG */
/* The common portion of as_warn and as_warn_where. */
#endif
}
-/*
- * a s _ w a r n ()
- *
- * Send to stderr a string as a warning, and locate warning
- * in input file(s).
- * Please only use this for when we have some recovery action.
- * Please explain in string (which may have '\n's) what recovery was done.
- */
+/* Send to stderr a string as a warning, and locate warning
+ in input file(s).
+ 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
void
-as_warn (const char *format,...)
+as_warn (const char *format, ...)
{
va_list args;
char buffer[2000];
va_end (args);
as_warn_internal ((char *) NULL, 0, buffer);
}
-} /* as_warn() */
+}
#else
-/*VARARGS1 */
void
as_warn (format, va_alist)
const char *format;
va_end (args);
as_warn_internal ((char *) NULL, 0, buffer);
}
-} /* as_warn() */
+}
#endif /* not NO_STDARG */
-/* as_warn_where, like as_bad but the file name and line number are
- passed in. Unfortunately, we have to repeat the function in order
- to handle the varargs correctly and portably. */
+/* Like as_bad but the file name and line number are passed in.
+ Unfortunately, we have to repeat the function in order to handle
+ the varargs correctly and portably. */
#ifdef USE_STDARG
void
-as_warn_where (char *file, unsigned int line, const char *format,...)
+as_warn_where (char *file, unsigned int line, const char *format, ...)
{
va_list args;
char buffer[2000];
va_end (args);
as_warn_internal (file, line, buffer);
}
-} /* as_warn() */
+}
#else
-/*VARARGS1 */
void
as_warn_where (file, line, format, va_alist)
char *file;
va_end (args);
as_warn_internal (file, line, buffer);
}
-} /* as_warn() */
+}
#endif /* not NO_STDARG */
/* The common portion of as_bad and as_bad_where. */
#endif
}
-/*
- * a s _ b a d ()
- *
- * Send to stderr a string as a warning, and locate warning in input file(s).
- * Please us when there is no recovery, but we want to continue processing
- * but not produce an object file.
- * Please explain in string (which may have '\n's) what recovery was done.
- */
+/* Send to stderr a string as a warning, and locate warning in input
+ file(s). Please us when there is no recovery, but we want to
+ continue processing but not produce an object file.
+ Please explain in string (which may have '\n's) what recovery was
+ done. */
#ifdef USE_STDARG
void
-as_bad (const char *format,...)
+as_bad (const char *format, ...)
{
va_list args;
char buffer[2000];
}
#else
-/*VARARGS1 */
void
as_bad (format, va_alist)
const char *format;
}
#endif /* not NO_STDARG */
-/* as_bad_where, like as_bad but the file name and line number are
- passed in. Unfortunately, we have to repeat the function in order
- to handle the varargs correctly and portably. */
+/* Like as_bad but the file name and line number are passed in.
+ Unfortunately, we have to repeat the function in order to handle
+ the varargs correctly and portably. */
#ifdef USE_STDARG
void
-as_bad_where (char *file, unsigned int line, const char *format,...)
+as_bad_where (char *file, unsigned int line, const char *format, ...)
{
va_list args;
char buffer[2000];
}
#else
-/*VARARGS1 */
void
as_bad_where (file, line, format, va_alist)
char *file;
}
#endif /* not NO_STDARG */
-/*
- * a s _ f a t a l ()
- *
- * Send to stderr a string as a fatal message, and print location of error in
- * input file(s).
- * Please only use this for when we DON'T have some recovery action.
- * It xexit()s with a warning status.
- */
+/* Send to stderr a string as a fatal message, and print location of
+ error in 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
void
-as_fatal (const char *format,...)
+as_fatal (const char *format, ...)
{
va_list args;
(void) putc ('\n', stderr);
va_end (args);
xexit (EXIT_FAILURE);
-} /* as_fatal() */
+}
#else
-/*VARARGS1*/
void
as_fatal (format, va_alist)
char *format;
(void) putc ('\n', stderr);
va_end (args);
xexit (EXIT_FAILURE);
-} /* as_fatal() */
+}
#endif /* not NO_STDARG */
-/*
- * as_assert: Indicate assertion failure.
- * Arguments: Filename, line number, optional function name.
- */
+/* Indicate assertion failure.
+ Arguments: Filename, line number, optional function name. */
void
as_assert (file, line, fn)
/* as_abort: Print a friendly message saying how totally hosed we are,
and exit without producing a core file. */
+
void
as_abort (file, line, fn)
const char *file, *fn;
#endif
abort ();
}
-
-/* end of messages.c */
#endif
/* 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, /* PQRSTUVWXYZ[\]^_ */
0, 0, 0, LEX_HASH, LEX_DOLLAR, LEX_PCT, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, /* _!"#$%&'()*+,-./ */
/* In: a character.
Out: 1 if this character ends a line. */
-char is_end_of_line[256] =
-{
+char is_end_of_line[256] = {
#ifdef CR_EOL
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, /* @abcdefghijklmno */
#else
static struct hash_control *po_hash;
-static const pseudo_typeS potable[] =
-{
+static const pseudo_typeS potable[] = {
{"abort", s_abort, 0},
{"align", s_align_ptwo, 0},
{"ascii", stringer, 0},
symbol in the symbol table. */
if (!mri_line_macro
#ifdef TC_START_LABEL_WITHOUT_COLON
- && TC_START_LABEL_WITHOUT_COLON(c,
- input_line_pointer)
+ && TC_START_LABEL_WITHOUT_COLON(c,
+ input_line_pointer)
#endif
- )
+ )
line_label = colon (line_start);
else
line_label = symbol_create (line_start,
int len;
/* Find the end of the current expanded macro line. */
- for (s = input_line_pointer - 1; *s ; ++s)
+ for (s = input_line_pointer - 1; *s; ++s)
if (is_end_of_line[(unsigned char) *s])
break;
/* Copy it for safe keeping. Also give an indication of
how much macro nesting is involved at this point. */
- len = s - (input_line_pointer-1);
+ len = s - (input_line_pointer - 1);
copy = (char *) xmalloc (len + macro_nest + 2);
memset (copy, '>', macro_nest);
copy[macro_nest] = ' ';
strncpy (original_case_string, s2, sizeof (original_case_string));
original_case_string[sizeof (original_case_string) - 1] = 0;
-
+
while (*s2)
{
if (isupper ((unsigned char) *s2))
if (align)
frag_align (align, 0, 0);
- /* Detach from old frag. */
+ /* Detach from old frag. */
if (S_GET_SEGMENT (symbolP) == bss_seg)
symbol_get_frag (symbolP)->fr_symbol = NULL;
break;
} /* Won't fit. */
- hold = ++input_line_pointer; /* skip ':' */
+ /* Skip ':'. */
+ hold = ++input_line_pointer;
(void) expression (exp);
if (exp->X_op != O_constant)
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-/*
- * Segments & sub-segments.
- */
+/* Segments & sub-segments. */
#include "as.h"
frchainS *data0_frchainP, *bss0_frchainP;
#endif /* MANY_SEGMENTS */
-char const *const seg_name[] =
-{
+char const *const seg_name[] = {
"absolute",
#ifdef MANY_SEGMENTS
"e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9",
/* Return whether the specified segment is thought to hold text. */
#ifndef BFD_ASSEMBLER
-const char * const nontext_section_names[] =
-{
+const char * const nontext_section_names[] = {
".eh_frame",
".gcc_except_table",
#ifdef OBJ_COFF
frag chain, even if it contains no (complete) frags. */
extern frchainS *frchain_now;
-typedef struct segment_info_struct
-{
+typedef struct segment_info_struct {
frchainS *frchainP;
unsigned int hadone : 1;
symbolS *sym;
#endif
- union
- {
- /* Current size of section holding stabs strings. */
- unsigned long stab_string_size;
- /* Initial frag for ELF. */
- char *p;
- }
+ union {
+ /* Current size of section holding stabs strings. */
+ unsigned long stab_string_size;
+ /* Initial frag for ELF. */
+ char *p;
+ }
stabu;
#ifdef NEED_LITERAL_POOL
#ifndef TC_FIX_ADJUSTABLE
#define TC_FIX_ADJUSTABLE(fix) 1
#endif
-
+
#ifndef MD_PCREL_FROM_SECTION
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from(FIXP)
#endif