2000-10-12 Kazu Hirata <kazu@hxi.com>

* app.c: Fix formatting.
	* as.c: Likewise.
	* as.h: Likewise.
	* bit_fix.h: Likewise.
	* cgen.c: Likewise.
	* cgen.h: Likewise.
	* cond.c: Likewise.
This commit is contained in:
Kazu Hirata 2000-10-11 20:24:32 +00:00
parent d01e2a23a3
commit 30a2b4ef8f
8 changed files with 156 additions and 159 deletions

View File

@ -1,3 +1,13 @@
2000-10-12 Kazu Hirata <kazu@hxi.com>
* app.c: Fix formatting.
* as.c: Likewise.
* as.h: Likewise.
* bit_fix.h: Likewise.
* cgen.c: Likewise.
* cgen.h: Likewise.
* cond.c: Likewise.
2000-10-11 Alan Modra <alan@linuxcare.com.au> 2000-10-11 Alan Modra <alan@linuxcare.com.au>
* config/obj-elf.c (elf_frob_symbol): Revert 2000-10-07 change. * config/obj-elf.c (elf_frob_symbol): Revert 2000-10-07 change.

View File

@ -211,24 +211,23 @@ static char mri_last_ch;
state at the time .include is interpreted is completely unrelated. state at the time .include is interpreted is completely unrelated.
That's why we have to save it all. */ That's why we have to save it all. */
struct app_save struct app_save {
{ int state;
int state; int old_state;
int old_state; char * out_string;
char * out_string; char out_buf[sizeof (out_buf)];
char out_buf[sizeof (out_buf)]; int add_newlines;
int add_newlines; char * saved_input;
char * saved_input; int saved_input_len;
int saved_input_len;
#ifdef TC_M68K #ifdef TC_M68K
int scrub_m68k_mri; int scrub_m68k_mri;
#endif #endif
const char * mri_state; const char * mri_state;
char mri_last_ch; char mri_last_ch;
#if defined TC_ARM && defined OBJ_ELF #if defined TC_ARM && defined OBJ_ELF
const char * symver_state; const char * symver_state;
#endif #endif
}; };
char * char *
app_push () app_push ()
@ -779,19 +778,20 @@ do_scrub_chars (get, tostart, tolen)
} }
#ifdef KEEP_WHITE_AROUND_COLON #ifdef KEEP_WHITE_AROUND_COLON
if (lex[ch] == LEX_IS_COLON) if (lex[ch] == LEX_IS_COLON)
{ {
/* only keep this white if there's no white *after* the colon */ /* Only keep this white if there's no white *after* the
ch2 = GET (); colon. */
UNGET (ch2); ch2 = GET ();
if (!IS_WHITESPACE (ch2)) UNGET (ch2);
{ if (!IS_WHITESPACE (ch2))
state = 9; {
UNGET (ch); state = 9;
PUT (' '); UNGET (ch);
break; PUT (' ');
} break;
} }
}
#endif #endif
if (IS_COMMENT (ch) if (IS_COMMENT (ch)
|| ch == '/' || ch == '/'
@ -1014,7 +1014,7 @@ do_scrub_chars (get, tostart, tolen)
case LEX_IS_COLON: case LEX_IS_COLON:
#ifdef KEEP_WHITE_AROUND_COLON #ifdef KEEP_WHITE_AROUND_COLON
state = 9; state = 9;
#else #else
if (state == 9 || state == 10) if (state == 9 || state == 10)
state = 3; state = 3;
@ -1040,7 +1040,7 @@ do_scrub_chars (get, tostart, tolen)
#ifdef TC_V850 #ifdef TC_V850
case LEX_IS_DOUBLEDASH_1ST: case LEX_IS_DOUBLEDASH_1ST:
ch2 = GET(); ch2 = GET ();
if (ch2 != '-') if (ch2 != '-')
{ {
UNGET (ch2); UNGET (ch2);
@ -1062,7 +1062,7 @@ do_scrub_chars (get, tostart, tolen)
#endif #endif
#ifdef DOUBLEBAR_PARALLEL #ifdef DOUBLEBAR_PARALLEL
case LEX_IS_DOUBLEBAR_1ST: case LEX_IS_DOUBLEBAR_1ST:
ch2 = GET(); ch2 = GET ();
if (ch2 != '|') if (ch2 != '|')
{ {
UNGET (ch2); UNGET (ch2);
@ -1140,12 +1140,14 @@ do_scrub_chars (get, tostart, tolen)
Trap is the only short insn that has a first operand that is Trap is the only short insn that has a first operand that is
neither register nor label. neither register nor label.
We must prevent exef0f ||trap #1 to degenerate to exef0f ||trap#1 . We must prevent exef0f ||trap #1 to degenerate to exef0f ||trap#1 .
We can't make '#' LEX_IS_SYMBOL_COMPONENT because it is already We can't make '#' LEX_IS_SYMBOL_COMPONENT because it is
LEX_IS_LINE_COMMENT_START. However, it is the only character in already LEX_IS_LINE_COMMENT_START. However, it is the
line_comment_chars for d10v, hence we can recognize it as such. */ only character in line_comment_chars for d10v, hence we
can recognize it as such. */
/* An alternative approach would be to reset the state to 1 when /* An alternative approach would be to reset the state to 1 when
we see '||', '<'- or '->', but that seems to be overkill. */ we see '||', '<'- or '->', but that seems to be overkill. */
if (state == 10) PUT (' '); if (state == 10)
PUT (' ');
#endif #endif
/* We have a line comment character which is not at the /* We have a line comment character which is not at the
start of a line. If this is also a normal comment start of a line. If this is also a normal comment
@ -1165,9 +1167,9 @@ do_scrub_chars (get, tostart, tolen)
#if defined TC_ARM && defined OBJ_ELF #if defined TC_ARM && defined OBJ_ELF
/* On the ARM, `@' is the comment character. /* On the ARM, `@' is the comment character.
Unfortunately this is also a special character in ELF .symver Unfortunately this is also a special character in ELF .symver
directives (and .type, though we deal with those another way). So directives (and .type, though we deal with those another way).
we check if this line is such a directive, and treat the character So we check if this line is such a directive, and treat
as default if so. This is a hack. */ the character as default if so. This is a hack. */
if ((symver_state != NULL) && (*symver_state == 0)) if ((symver_state != NULL) && (*symver_state == 0))
goto de_fault; goto de_fault;
#endif #endif
@ -1217,7 +1219,7 @@ do_scrub_chars (get, tostart, tolen)
{ {
int type; int type;
ch2 = * (unsigned char *) s; ch2 = *(unsigned char *) s;
type = lex[ch2]; type = lex[ch2];
if (type != 0 if (type != 0
&& type != LEX_IS_SYMBOL_COMPONENT) && type != LEX_IS_SYMBOL_COMPONENT)

View File

@ -91,8 +91,7 @@ int debug_memory = 0;
/* We build a list of defsyms as we read the options, and then define /* We build a list of defsyms as we read the options, and then define
them after we have initialized everything. */ them after we have initialized everything. */
struct defsym_list struct defsym_list {
{
struct defsym_list *next; struct defsym_list *next;
char *name; char *name;
valueT value; valueT value;
@ -102,8 +101,7 @@ static struct defsym_list *defsyms;
/* Keep a record of the itbl files we read in. */ /* Keep a record of the itbl files we read in. */
struct itbl_file_list struct itbl_file_list {
{
struct itbl_file_list *next; struct itbl_file_list *next;
char *name; char *name;
}; };
@ -350,24 +348,23 @@ parse_args (pargc, pargv)
char *shortopts; char *shortopts;
extern CONST char *md_shortopts; extern CONST char *md_shortopts;
static const char std_shortopts[] = static const char std_shortopts[] = {
{ '-', 'J',
'-', 'J',
#ifndef WORKING_DOT_WORD #ifndef WORKING_DOT_WORD
/* -K is not meaningful if .word is not being hacked. */ /* -K is not meaningful if .word is not being hacked. */
'K', 'K',
#endif #endif
'L', 'M', 'R', 'W', 'Z', 'f', 'a', ':', ':', 'D', 'I', ':', 'o', ':', 'L', 'M', 'R', 'W', 'Z', 'f', 'a', ':', ':', 'D', 'I', ':', 'o', ':',
#ifndef VMS #ifndef VMS
/* -v takes an argument on VMS, so we don't make it a generic /* -v takes an argument on VMS, so we don't make it a generic
option. */ option. */
'v', 'v',
#endif #endif
'w', 'X', 'w', 'X',
/* New option for extending instruction set (see also --itbl below) */ /* New option for extending instruction set (see also --itbl below) */
't', ':', 't', ':',
'\0' '\0'
}; };
struct option *longopts; struct option *longopts;
extern struct option md_longopts[]; extern struct option md_longopts[];
extern size_t md_longopts_size; extern size_t md_longopts_size;
@ -474,7 +471,7 @@ parse_args (pargc, pargv)
VMS code in md_parse_option can return 0 in that case, VMS code in md_parse_option can return 0 in that case,
but it has no way of pushing the filename argument back. */ but it has no way of pushing the filename argument back. */
if (optarg && *optarg) if (optarg && *optarg)
new_argv[new_argc++] = optarg, new_argv[new_argc] = NULL; new_argv[new_argc++] = optarg, new_argv[new_argc] = NULL;
else else
#else #else
case 'v': case 'v':

150
gas/as.h
View File

@ -21,8 +21,7 @@
#ifndef GAS #ifndef GAS
#define GAS 1 #define GAS 1
/* /* I think this stuff is largely out of date. xoxorich.
* I think this stuff is largely out of date. xoxorich.
* *
* CAPITALISED names are #defined. * CAPITALISED names are #defined.
* "lowercaseH" is #defined if "lowercase.h" has been #include-d. * "lowercaseH" is #defined if "lowercase.h" has been #include-d.
@ -221,11 +220,11 @@ extern char **environ;
#include "asintl.h" #include "asintl.h"
#define BAD_CASE(val) \ #define BAD_CASE(val) \
{ \ { \
as_fatal(_("Case value %ld unexpected at line %d of file \"%s\"\n"), \ as_fatal (_("Case value %ld unexpected at line %d of file \"%s\"\n"), \
(long) val, __LINE__, __FILE__); \ (long) val, __LINE__, __FILE__); \
} }
#include "flonum.h" #include "flonum.h"
@ -262,12 +261,9 @@ typedef addressT valueT;
/* input_scrub.c */ /* input_scrub.c */
/* /* Supplies sanitised buffers to read.c.
* Supplies sanitised buffers to read.c. Also understands printing line-number part of error messages. */
* Also understands printing line-number part of error messages.
*/
/* subsegs.c Sub-segments. Also, segment(=expression type)s.*/ /* subsegs.c Sub-segments. Also, segment(=expression type)s.*/
#ifndef BFD_ASSEMBLER #ifndef BFD_ASSEMBLER
@ -290,20 +286,19 @@ typedef addressT valueT;
#define SEG_LIST SEG_TEXT,SEG_DATA,SEG_BSS #define SEG_LIST SEG_TEXT,SEG_DATA,SEG_BSS
#endif #endif
typedef enum _segT typedef enum _segT {
{ SEG_ABSOLUTE = 0,
SEG_ABSOLUTE = 0, SEG_LIST,
SEG_LIST, SEG_UNKNOWN,
SEG_UNKNOWN, SEG_GOOF, /* Only happens if AS has a logic error. */
SEG_GOOF, /* Only happens if AS has a logic error. */ /* Invented so we don't crash printing */
/* Invented so we don't crash printing */ /* error message involving weird segment. */
/* error message involving weird segment. */ SEG_EXPR, /* Intermediate expression values. */
SEG_EXPR, /* Intermediate expression values. */ SEG_DEBUG, /* Debug segment */
SEG_DEBUG, /* Debug segment */ SEG_NTV, /* Transfert vector preload segment */
SEG_NTV, /* Transfert vector preload segment */ SEG_PTV, /* Transfert vector postload segment */
SEG_PTV, /* Transfert vector postload segment */ SEG_REGISTER /* Mythical: a register-valued expression */
SEG_REGISTER /* Mythical: a register-valued expression */ } segT;
} segT;
#define SEG_MAXIMUM_ORDINAL (SEG_REGISTER) #define SEG_MAXIMUM_ORDINAL (SEG_REGISTER)
#else #else
@ -350,51 +345,50 @@ extern segT text_section, data_section, bss_section;
/* relax() */ /* relax() */
enum _relax_state enum _relax_state {
{ /* Variable chars to be repeated fr_offset times.
/* Variable chars to be repeated fr_offset times. Fr_symbol unused. Used with fr_offset == 0 for a
Fr_symbol unused. Used with fr_offset == 0 for a constant length frag. */
constant length frag. */ rs_fill = 1,
rs_fill = 1,
/* Align. The fr_offset field holds the power of 2 to which to /* Align. The fr_offset field holds the power of 2 to which to
align. The fr_var field holds the number of characters in the align. The fr_var field holds the number of characters in the
fill pattern. The fr_subtype field holds the maximum number of fill pattern. The fr_subtype field holds the maximum number of
bytes to skip when aligning, or 0 if there is no maximum. */ bytes to skip when aligning, or 0 if there is no maximum. */
rs_align, rs_align,
/* Align code. The fr_offset field holds the power of 2 to which /* Align code. The fr_offset field holds the power of 2 to which
to align. This type is only generated by machine specific to align. This type is only generated by machine specific
code, which is normally responsible for handling the fill code, which is normally responsible for handling the fill
pattern. The fr_subtype field holds the maximum number of pattern. The fr_subtype field holds the maximum number of
bytes to skip when aligning, or 0 if there is no maximum. */ bytes to skip when aligning, or 0 if there is no maximum. */
rs_align_code, rs_align_code,
/* Org: Fr_offset, fr_symbol: address. 1 variable char: fill /* Org: Fr_offset, fr_symbol: address. 1 variable char: fill
character. */ character. */
rs_org, rs_org,
#ifndef WORKING_DOT_WORD #ifndef WORKING_DOT_WORD
/* JF: gunpoint */ /* JF: gunpoint */
rs_broken_word, rs_broken_word,
#endif #endif
/* machine-specific relaxable (or similarly alterable) instruction */ /* machine-specific relaxable (or similarly alterable) instruction */
rs_machine_dependent, rs_machine_dependent,
/* .space directive with expression operand that needs to be computed /* .space directive with expression operand that needs to be computed
later. Similar to rs_org, but different. later. Similar to rs_org, but different.
fr_symbol: operand fr_symbol: operand
1 variable char: fill character */ 1 variable char: fill character */
rs_space, rs_space,
/* A DWARF leb128 value; only ELF uses this. The subtype is 0 for /* A DWARF leb128 value; only ELF uses this. The subtype is 0 for
unsigned, 1 for signed. */ unsigned, 1 for signed. */
rs_leb128, rs_leb128,
/* Exception frame information which we may be able to optimize. */ /* Exception frame information which we may be able to optimize. */
rs_cfa rs_cfa
}; };
typedef enum _relax_state relax_stateT; typedef enum _relax_state relax_stateT;
@ -463,15 +457,14 @@ extern int listing;
/* Type of debugging information we should generate. We currently /* Type of debugging information we should generate. We currently
support stabs, ECOFF, and DWARF2. */ support stabs, ECOFF, and DWARF2. */
enum debug_info_type enum debug_info_type {
{ DEBUG_UNSPECIFIED,
DEBUG_UNSPECIFIED, DEBUG_NONE,
DEBUG_NONE, DEBUG_STABS,
DEBUG_STABS, DEBUG_ECOFF,
DEBUG_ECOFF, DEBUG_DWARF,
DEBUG_DWARF, DEBUG_DWARF2
DEBUG_DWARF2 };
};
extern enum debug_info_type debug_type; extern enum debug_info_type debug_type;
@ -482,15 +475,14 @@ extern int max_macro_nest;
increase malloc calls for monitoring memory allocation. */ increase malloc calls for monitoring memory allocation. */
extern int chunksize; extern int chunksize;
struct _pseudo_type struct _pseudo_type {
{ /* assembler mnemonic, lower case, no '.' */
/* assembler mnemonic, lower case, no '.' */ const char *poc_name;
const char *poc_name; /* Do the work */
/* Do the work */ void (*poc_handler) PARAMS ((int));
void (*poc_handler) PARAMS ((int)); /* Value to pass to handler */
/* Value to pass to handler */ int poc_val;
int poc_val; };
};
typedef struct _pseudo_type pseudo_typeS; typedef struct _pseudo_type pseudo_typeS;

View File

@ -33,17 +33,16 @@
#ifndef __bit_fix_h__ #ifndef __bit_fix_h__
#define __bit_fix_h__ #define __bit_fix_h__
struct bit_fix struct bit_fix {
{ int fx_bit_size; /* Length of bitfield */
int fx_bit_size; /* Length of bitfield */ int fx_bit_offset; /* Bit offset to bitfield */
int fx_bit_offset; /* Bit offset to bitfield */ long fx_bit_base; /* Where do we apply the bitfix.
long fx_bit_base; /* Where do we apply the bitfix. If this is zero, default is assumed. */
If this is zero, default is assumed. */ long fx_bit_base_adj; /* Adjustment of base */
long fx_bit_base_adj; /* Adjustment of base */ long fx_bit_max; /* Signextended max for bitfield */
long fx_bit_max; /* Signextended max for bitfield */ long fx_bit_min; /* Signextended min for bitfield */
long fx_bit_min; /* Signextended min for bitfield */ long fx_bit_add; /* Or mask, used for huffman prefix */
long fx_bit_add; /* Or mask, used for huffman prefix */ };
};
typedef struct bit_fix bit_fixS; typedef struct bit_fix bit_fixS;
#endif /* __bit_fix_h__ */ #endif /* __bit_fix_h__ */

View File

@ -57,8 +57,7 @@ cgen_asm_record_register (name, number)
OPINDEX is the index in the operand table. OPINDEX is the index in the operand table.
OPINFO is something the caller chooses to help in reloc determination. */ OPINFO is something the caller chooses to help in reloc determination. */
struct fixup struct fixup {
{
int opindex; int opindex;
int opinfo; int opinfo;
expressionS exp; expressionS exp;
@ -87,7 +86,7 @@ queue_fixup (opindex, opinfo, expP)
/* We need to generate a fixup for this expression. */ /* We need to generate a fixup for this expression. */
if (num_fixups >= GAS_CGEN_MAX_FIXUPS) if (num_fixups >= GAS_CGEN_MAX_FIXUPS)
as_fatal (_("too many fixups")); as_fatal (_("too many fixups"));
fixups[num_fixups].exp = * expP; fixups[num_fixups].exp = *expP;
fixups[num_fixups].opindex = opindex; fixups[num_fixups].opindex = opindex;
fixups[num_fixups].opinfo = opinfo; fixups[num_fixups].opinfo = opinfo;
++ num_fixups; ++ num_fixups;
@ -315,7 +314,7 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP)
*resultP = CGEN_PARSE_OPERAND_RESULT_REGISTER; *resultP = CGEN_PARSE_OPERAND_RESULT_REGISTER;
break; break;
default: default:
queue_fixup (opindex, opinfo, & exp); queue_fixup (opindex, opinfo, &exp);
*valueP = 0; *valueP = 0;
*resultP = CGEN_PARSE_OPERAND_RESULT_QUEUED; *resultP = CGEN_PARSE_OPERAND_RESULT_QUEUED;
break; break;

View File

@ -33,13 +33,13 @@ extern CGEN_CPU_DESC gas_cgen_cpu_desc;
/* Struct defining result of gas_cgen_finish_insn. */ /* Struct defining result of gas_cgen_finish_insn. */
typedef struct { typedef struct {
/* frag containing the insn */ /* frag containing the insn */
fragS * frag; fragS *frag;
/* Address of insn in frag. */ /* Address of insn in frag. */
char * addr; char *addr;
/* Number of fixups this insn has. */ /* Number of fixups this insn has. */
int num_fixups; int num_fixups;
/* Array of fixups. */ /* Array of fixups. */
fixS * fixups[GAS_CGEN_MAX_FIXUPS]; fixS *fixups[GAS_CGEN_MAX_FIXUPS];
} finished_insnS; } finished_insnS;
/* Callback for operand parsing. /* Callback for operand parsing.

View File

@ -28,8 +28,7 @@
scanned. */ scanned. */
struct obstack cond_obstack; struct obstack cond_obstack;
struct file_line struct file_line {
{
char *file; char *file;
unsigned int line; unsigned int line;
}; };
@ -37,8 +36,7 @@ struct file_line
/* We push one of these structures for each .if, and pop it at the /* We push one of these structures for each .if, and pop it at the
.endif. */ .endif. */
struct conditional_frame struct conditional_frame {
{
/* The source file & line number of the "if". */ /* The source file & line number of the "if". */
struct file_line if_file_line; struct file_line if_file_line;
/* The source file & line of the "else". */ /* The source file & line of the "else". */