Wed Aug 24 12:46:08 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+ * as.c (main): Move a inside the #if 0 block which uses it.
+ * ecoff.c (current_stabs_filename): Make const.
+ * frags.h (frag_align_pattern): Declare.
+ * gasp.c (new_file): Cast isp to long, and use %ld to print it.
+ * config/tc-alpha.h (md_operand): Add cast to void.
+ (alpha_do_align): Declare argument types.
+ (tc_get_register): Declare.
+ (alpha_frob_ecoff_data): Declare.
+ * config/tc-alpha.c: Include <ctype.h>.
+ (s_mask): Don't declare; does not exist.
+ (line_comment_chars): Remove /* from descriptive comment.
+ (tc_get_register): Remove unused local reg.
+ (tc_gen_reloc): Don't bother to compare unsigned to zero.
+ (s_base): Correct warning to actually print register number.
+ (md_begin): Remove unused locals retval, lose, and i.
+ (alpha_fix_adjustable): Move default case inside switch to avoid
+ warning.
+ (load_symbol_address): Remove unused locals reloc_addr, p, sym,
+ and addend.
+ (emit_byte_manip_r): Declare types for all arguments.
+ (emit_extract_r, emit_insert_r, emit_mask_r): Likewise.
+ (emit_sign_extend, emit_bis_r, s_proc): Likewise.
+ (alpha_ip): Use sprint_value to print offsetT value. Remove
+ unused local size. Remove unused label get_macro.
+ (alpha_do_align): Make fill const.
+ (md_apply_fix): Remove unused label check_zov.
+
* configure.in: Recognize i586 as a synonym for i[34]86.
Tue Aug 23 12:32:14 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
h include high-level source\n\
l include assembly\n\
n omit forms processing\n\
- s include symbols\n\
+ s include symbols\n");
+ fprintf (stream, "\
-D produce assembler debugging messages\n\
-f skip whitespace and comment preprocessing\n\
--help show this message and exit\n\
char *shortopts;
extern CONST char *md_shortopts;
- /* -v takes an argument on VMS, so we don't make it a generic option.
- It gets recognized as an abbreviation of -version, anyway. */
+ /* -v takes an argument on VMS, so we don't make it a generic option
+ in that case. */
+#ifdef OBJ_VMS
CONST char *std_shortopts = "-JKLRWZfa::DI:o:wX";
+#else
+ /* Normal set of short options. */
+ CONST char *std_shortopts = "-JKLRWZfa::DI:o:vwX";
+#endif
struct option *longopts;
extern struct option md_longopts[];
/* Construct the option lists from the standard list and the
target dependent list. */
shortopts = concat (std_shortopts, md_shortopts, (char *) NULL);
- longopts = xmalloc (sizeof (std_longopts) + md_longopts_size);
+ longopts = (struct option *) xmalloc (sizeof (std_longopts) + md_longopts_size);
memcpy (longopts, std_longopts, sizeof (std_longopts));
memcpy ((char *) longopts + sizeof (std_longopts),
md_longopts, md_longopts_size);
print_version_id ();
exit (0);
+ case 'v':
+ print_version_id ();
+
case 'J':
flag_signed_overflow_ok = 1;
break;
int argc;
char **argv;
{
- char a;
int keep_it;
long start_time = get_run_time ();
+#ifdef HOST_SPECIAL_INIT
+ HOST_SPECIAL_INIT (argc, argv);
+#endif
+
#if 0 /* do we need any of this?? */
{
static const int sig[] = {SIGHUP, SIGINT, SIGPIPE, SIGTERM, 0};
+ int a;
for (a = 0; sig[a] != 0; a++)
if (signal (sig[a], SIG_IGN) != SIG_IGN)
* Date: Jan 1993
*/
+#include <ctype.h>
+
#include "as.h"
#include "alpha-opcode.h"
#include "subsegs.h"
/* We'll probably be using this relocation frequently, and we
will want to compare for it. */
-static reloc_howto_type *gpdisp_hi16_howto;
+static const reloc_howto_type *gpdisp_hi16_howto;
/* These are exported to ECOFF code. */
unsigned long alpha_gprmask, alpha_fprmask;
s_data (), float_cons ();
/* Static functions, needing forward declarations. */
-static void s_mask (), s_base (), s_proc (), s_alpha_set ();
+static void s_base (), s_proc (), s_alpha_set ();
static void s_gprel32 (), s_rdata (), s_sdata (), s_alpha_comm ();
static int alpha_ip ();
/* Note that input_file.c hand checks for '#' at the beginning of the
first line of the input file. This is because the compiler outputs
#NO_APP at the beginning of its output. */
-/* Also note that '/*' will always start a comment */
+/* Also note that C style comments are always recognized. */
const char line_comment_chars[] = "#!";
/* Chars that can be used to separate mant from exp in floating point nums */
tc_get_register (frame)
int frame;
{
- int reg;
int framereg = SP;
SKIP_WHITESPACE ();
reloc->sym_ptr_ptr = &fixp->fx_addsy->bsym;
reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
- if (fixp->fx_r_type > BFD_RELOC_UNUSED || fixp->fx_r_type < 0)
+ if (fixp->fx_r_type > BFD_RELOC_UNUSED)
abort ();
if (fixp->fx_r_type == BFD_RELOC_ALPHA_GPDISP_HI16)
if (base_register < 0 || base_register > 31)
{
base_register = GP;
- as_warn ("Bad base register, using $r.", base_register);
+ as_warn ("Bad base register, using $%d.", base_register);
}
demand_empty_rest_of_line ();
}
if (strchr (name, '/'))
{
- const char *name2, *p, *q;
+ char *name2, *p;
+ const char *q;
name2 = xmalloc (strlen (name));
p = name2;
void
md_begin ()
{
- const char *retval;
- int lose = 0;
- unsigned int i = 0;
-
op_hash = hash_new ();
load_insn_table (alpha_opcodes, NUMOPCODES);
return 0;
case BFD_RELOC_GPREL32:
return 1;
+ default:
+ return !alpha_force_relocation (f);
}
- return !alpha_force_relocation (f);
+ /*NOTREACHED*/
}
valueT
static symbolS *lita_sym;
int x;
- addressT reloc_addr;
valueT retval;
- char *p;
- symbolS *sym;
- valueT addend;
if (!lita_sym)
{
int reg;
struct alpha_it *insn;
{
- valueT addend;
+ valueT addend, addendhi, addendlo;
int num_insns = 1;
if (insn->reloc[0].exp.X_add_symbol->bsym->flags & BSF_SECTION_SYM)
load_symbol_address (reg, insn);
if (addend)
{
- num_insns++;
- {
- valueT x = addend;
- if ((x & ~0x7fff) != 0
- && (x & ~0x7fff) + 0x8000 != 0)
- {
- as_bad ("assembler not prepared to handle constants >16 bits yet");
- addend = 0;
- }
- }
- insn[1].opcode = (0x20000000 /* lda */
- | (reg << SA)
- | (reg << SB)
- | (addend & 0xffff));
- insn[1].reloc[0].code = BFD_RELOC_ALPHA_LITUSE;
- insn[1].reloc[0].exp = lituse_basereg;
+ if ((addend & ~0x7fffffff) != 0
+ && (addend & ~0x7fffffff) + 0x80000000 != 0)
+ {
+ as_bad ("assembler not prepared to handle constants >32 bits yet");
+ addend = 0;
+ }
+ addendlo = addend & 0xffff;
+ addend -= addendlo;
+ addendhi = addend >> 16;
+ if (addendlo & 0x8000)
+ addendhi++;
+ /* It appears that the BASEREG LITUSE reloc should not be used on
+ an LDAH instruction. */
+ if (addendlo)
+ {
+ insn[1].opcode = (0x20000000 /* lda */
+ | (reg << SA)
+ | (reg << SB)
+ | (addendlo & 0xffff));
+ insn[1].reloc[0].code = BFD_RELOC_ALPHA_LITUSE;
+ insn[1].reloc[0].exp = lituse_basereg;
+ num_insns++;
+ }
+ if (addendhi)
+ {
+ insn[num_insns].opcode = (0x24000000
+ | (reg << SA)
+ | (reg << SB)
+ | (addendhi & 0xffff));
+ num_insns++;
+ }
+ if (num_insns == 1)
+ abort ();
lituse_pending = 0;
}
return num_insns;
static void
emit_byte_manip_r (op, in, mask, out, mode, which)
char *op;
+ int in, mask, out, mode, which;
{
char buf[90];
sprintf (buf, "%s%c%c $%d,$%d,$%d", op, mode, which, in, mask, out);
static void
emit_extract_r (in, mask, out, mode, which)
+ int in, mask, out, mode, which;
{
emit_byte_manip_r ("ext", in, mask, out, mode, which);
}
static void
emit_insert_r (in, mask, out, mode, which)
+ int in, mask, out, mode, which;
{
emit_byte_manip_r ("ins", in, mask, out, mode, which);
}
static void
emit_mask_r (in, mask, out, mode, which)
+ int in, mask, out, mode, which;
{
emit_byte_manip_r ("msk", in, mask, out, mode, which);
}
static void
emit_sign_extend (reg, size)
+ int reg, size;
{
char buf[90];
sprintf (buf, "sll $%d,0x%x,$%d", reg, 64 - size, reg);
static void
emit_bis_r (in1, in2, out)
+ int in1, in2, out;
{
char buf[90];
sprintf (buf, "bis $%d,$%d,$%d", in1, in2, out);
else if (at_ok && macro_ok)
{
/* Constant value supplied, but it's too large. */
+ char buf[50];
char expansion[64];
- sprintf (expansion, "lda $%d,%d($%d)", AT,
- insns[0].reloc[0].exp.X_add_number, ZERO);
+ sprint_value (buf, insns[0].reloc[0].exp.X_add_number);
+ sprintf (expansion, "lda $%d,%s($%d)", AT, buf, ZERO);
md_assemble (expansion);
opcode |= 0x1000 /* use reg */ | (AT << SB);
insns[0].reloc[0].code = BFD_RELOC_NONE;
case 'F':
{
- int format, length, mode, i, size;
+ int format, length, mode, i;
char temp[20 /*MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT*/];
char *err;
static const char formats[4] = "FGfd";
/* fall through */
case 'G': /* Addressing macros: GET */
- get_macro:
/* All it is missing is the expression, which is what we
will get now */
{
/* Pick apart name and set flags. */
- char *s = pattern->name;
+ const char *s = pattern->name;
if (*s == 'u')
{
-32addr treat addresses as 32-bit values\n\
-F lack floating point instructions support\n\
-m21064 | -m21066 | -m21164\n\
- specify variant of Alpha architecture\n\
--nocpp ignored\n");
+ specify variant of Alpha architecture\n");
}
\f
static void
s_proc (is_static)
+ int is_static;
{
/* XXXX Align to cache linesize XXXXX */
char *name;
int
alpha_do_align (n, fill)
int n;
- char *fill;
+ const char *fill;
{
if (!fill
&& (now_seg == text_section
*p |= value;
value >>= 5;
fixP->fx_done = 1;
- check_zov:
if (value != 0)
as_bad_where (fixP->fx_file, fixP->fx_line,
"overflow in type-%d reloc", (int) fixP->fx_r_type);
static int stabs_seen = 0; /* != 0 if stabs have been seen */
static int current_file_idx;
+static const char *current_stabs_filename;
/* Pseudo symbol to use when putting stabs into the symbol table. */
#ifndef STABS_SYMBOL
listing_source_file (file_name);
#endif
+ current_stabs_filename = file_name;
+
/* If we're creating stabs, then we don't actually make a new FDR.
Instead, we just create a stabs symbol. */
if (stabs_seen)
&cur_file_ptr->thash_head[0]);
if (generate_asm_line_stab)
{
- static char itstr[] = "int:t1=r1;-2147483648;2147483647;";
+ static char itstr[] = "void:t1=1";
mark_stabs (0);
(void) add_ecoff_symbol (file_name, st_Nil, sc_Nil,
symbol_new ("L0\001", now_seg,
void (* const swap_pdr_out) PARAMS ((bfd *, const PDR *, PTR))
= backend->swap_pdr_out;
char *pdr_out;
- int first_fil;
long iproc;
vlinks_t *file_link;
pdr_out = *buf + offset;
- first_fil = 1;
iproc = 0;
/* The procedures are stored by file. */
S_GET_SEGMENT (adr_sym)));
if (first)
{
- if (first_fil)
- first_fil = 0;
- else
- fil_ptr->fdr.adr = adr;
+ /* This code used to force the adr of the very
+ first fdr to be 0. However, the native tools
+ don't do that, and I can't remember why it
+ used to work that way, so I took it out. */
+ fil_ptr->fdr.adr = adr;
first = 0;
}
proc_ptr->pdr.adr = adr - fil_ptr->fdr.adr;
static int line_label_cnt = 0;
void
-ecoff_generate_asm_line_stab (lineno)
+ecoff_generate_asm_line_stab (filename, lineno)
+ char *filename;
int lineno;
{
char *ll;
+ if (strcmp (current_stabs_filename, filename))
+ {
+ add_file (filename, 0);
+ generate_asm_line_stab = 1;
+ }
+
line_label_cnt++;
/* generate local label $LMnn */
ll = xmalloc(10);
/* JF changed < 1 to <= 1 to avoid a race conditon */
#define FRAG_APPEND_1_CHAR(datum) \
{ \
- if (obstack_room( &frags ) <= 1) {\
- frag_wane (frag_now); \
- frag_new (0); \
- } \
- obstack_1grow( &frags, datum ); \
- }
-
-
-#if __STDC__ == 1
-
-char *frag_more (int nchars);
-void frag_align (int alignment, int fill_character);
-void frag_new (int old_frags_var_max_size);
-void frag_wane (fragS * fragP);
-
-char *frag_variant (relax_stateT type,
- int max_chars,
- int var,
- relax_substateT subtype,
- symbolS * symbol,
- long offset,
- char *opcode,
- int pcrel_adjust,
- int bsr);
-
-char *frag_var (relax_stateT type,
- int max_chars,
- int var,
- relax_substateT subtype,
- symbolS * symbol,
- long offset,
- char *opcode);
-
-#else /* not __STDC__ */
-
-char *frag_more ();
-char *frag_var ();
-char *frag_variant ();
-void frag_align ();
-void frag_new ();
-void frag_wane ();
-
-#endif /* not __STDC__ */
-
-/*
- * Local Variables:
- * comment-column: 0
- * fill-column: 131
- * End:
- */
+ if (obstack_room( &frags ) <= 1) {\
+ frag_wane (frag_now); \
+ frag_new (0); \
+ } \
+ obstack_1grow( &frags, datum ); \
+}
+
+
+void frag_init PARAMS ((void));
+void frag_grow PARAMS ((unsigned int nchars));
+char *frag_more PARAMS ((int nchars));
+void frag_align PARAMS ((int alignment, int fill_character));
+void frag_align_pattern PARAMS ((int alignment,
+ const char *fill_pattern,
+ int n_fill));
+void frag_new PARAMS ((int old_frags_var_max_size));
+void frag_wane PARAMS ((fragS * fragP));
+
+char *frag_variant PARAMS ((relax_stateT type,
+ int max_chars,
+ int var,
+ relax_substateT subtype,
+ symbolS * symbol,
+ long offset,
+ char *opcode,
+ int pcrel_adjust,
+ int bsr));
+
+char *frag_var PARAMS ((relax_stateT type,
+ int max_chars,
+ int var,
+ relax_substateT subtype,
+ symbolS * symbol,
+ long offset,
+ char *opcode));
/* end of frags.h */