Commit Graph

31 Commits

Author SHA1 Message Date
Ian Lance Taylor
8095b665cb * as.c (emulation_name): Remove unused static variable.
(default_emul_bfd_name): Add return NULL to avoid warning.
	* ecoff.c (ecoff_stab): Remove unused variables name and
	name_end.
	* frags.c (frag_new): Remove unused variable tmp.
	* hash.c (hash_grow): Parenthesize + within <<.
	(hash_print_statistics): Use %lu, not %d, to print unsigned
	long variables.
	* messages.c: Include "libiberty.h".
	(fprint_value): Add cast to avoid printf warning.
	(sprint_value): Likewise.
	* read.c: Include "ecoff.h".
	(emit_expr): Add casts to avoid printf warnings.
	* read.h: Use extern for function declarations.
	(pop_insert): Declare.
	* stabs.c: Include "ecoff.h".
	* subsegs.c (subseg_set_rest): Remove unused variables tmp,
	former_last_fragP, and new_fragP.
	* subsegs.h (subsegs_print_statistics): Declare.
	* symbols.c (debug_verify_symchain): Change macro to discard
	arguments.
	* write.c (dump_section_relocs): Likewise.
	* write.h: Use extern for function declarations.
	(write_print_statistics): Declare.
	* config/e-mipsecoff.c (mipsecoff_bfd_name): Return NULL to avoid
	warning.
	* config/e-mipself.c (mipself_bfd_name): Likewise.
	* config/obj-elf.h (elf_ecoff_set_ext): Declare.
1996-06-19 18:42:42 +00:00
Ian Lance Taylor
c7a89bde9b * as.h (strdup): Don't declare.
* stabs.c: Include libiberty.h
	(get_stab_string_offset): Use xstrdup rather than strdup.
	(s_stab_generic): Likewise.
	* as.c (parse_args): Likewise.
	* read.c (s_mri_sect): Likewise.
1996-03-22 16:44:21 +00:00
Ian Lance Taylor
7e047ac2c1 Add support for macros.
* as.c: Include sb.h and macro.h.
	(max_macro_next): New global variable.
	(main): Call macro_init.
	(macro_expr): New static function.
	* as.h (max_macro_nest): Declare.
	* read.c (line_label): Rename from mri_line_label.  Change all
	uses.
	(potable): Add exitm, irp, irpc, macro, mexit, rept.
	(read_a_source_file): Always clear line_label at the start of a
	line, not just when flag_mri or LABELS_WITHOUT_COLONS.  Fixup
	MRI/LABELS_WITHOUT_COLONS handling.  In MRI mode, permit label:
	equ val.  Set line_label when calling colon.  In MRI mode, a
	leading '.' does not imply a pseudo-op.  Check for macro expansion
	before calling md_assemble.
	(s_irp): New function.
	(get_line_sb): New static function.
	(s_macro): New function.
	(s_mexit): New function.
	(s_rept): New function.
	* read.h (line_label): Rename from mri_line_label.
	(s_irp, s_rept): Declare.
	(s_macro, s_mexit): Declare.
	* input-scrub.c: Include sb.h.
	(sb_index, from_sb): New static variables.
	(macro_nest): New static variable.
	(struct input_save): Add sb_index and from_sb fields.  Change
	next_saved_file field to be struct input_save *.
	(next_saved_file): Changed to be struct input_save *.
	(input_scrub_push): Change to return type struct input_save *.
	Save sb_index and from_sb.
	(input_scrub_pop): Change parameter type to struct input_save *.
	Restore sb_index and from_sb.
	(input_scrub_include_sb): New function.
	(input_scrub_next_buffer): Handle reading from from_sb.
	(bump_line_counters): Only increment lines if not using from_sb.
	* config/tc-m68k.c (opt_table): Add nest.
	(opt_nest): New static function.
	* gasp.c: Include sb.h and macro.h.  Move all sb related functions
	and definitions to sb.h and sb.c.  Move all macro related
	functions and definitions to macro.h and macro.c.
	* sb.h, sb.c: New files, extracted from gasp.c.
	* macro.h, macro.c: Likewise.
	* Makefile.in (OBJS): Add sb.o and macro.o
	(GASPOBJS): Define.
	(gasp.new): Depend upon $(GASPOBJS).  Use $(GASPOBJS) to link.
	(TARG_CPU_DEP_m68k): Depend upon subsegs.h.
	(gasp.o): Depend upon sb.h and macro.h.
	(sb.o): New target.
	(macro.o): New target.
	(as.o): Depend upon sb.h and macro.h.
	(input-scrub.o): Depend upon sb.h.
	(read.o): Depend upon sb.h and macro.h.
1995-08-21 18:35:11 +00:00
Ian Lance Taylor
85a961c6a1 Patches from Jerry Blakely <gerry_blakley@wellfleet.com>:
* as.c (listing_filename): New static variable.
	(show_usage): Mention -a=file.
	(parse_args): Support = option of -a to set name of listing file.
	(main): Pass listing_filename to listing_print.
	* listing.c (list_file): New static variable.
	(various): Replace printf with fprintf to list_file.
	(listing_print): If name argument is not NULL, open it as
	list_file.
	* doc/as.texinfo, doc/as.1: Document -a=file.
PR 6354.
1995-07-06 20:39:31 +00:00
Ian Lance Taylor
a7aa7a2ba9 * config/tc-sparc.c (md_shortopts): Add "K:" if OBJ_ELF.
(md_parse_option): If OBJ_ELF, check for -K.  Die if -K PIC, since
	PIC code is not currently supported.

	* as.c (parse_args): Change std_shortopts to be an array rather
	than a constant string.  Only include 'K' if WORKING_DOT_WORD is
	not defined.  Only check for 'K' in that case as well.
	* as.h (flag_warn_displacement): Only declare if WORKING_DOT_WORD
	is not defined.
PR 7131.
1995-07-05 21:52:10 +00:00
Fred Fish
e63c594dd0 * as.c (main): Only use sbrk when HAVE_SBRK defined.
* configure.in:  Add test for sbrk.
	* configure:  Regenerate using autoconf 2.4.
1995-07-05 08:04:28 +00:00
Ken Raeburn
4761bb029a more emulation fixes 1995-05-23 00:09:34 +00:00
Ken Raeburn
87e4849501 * frags.c (frag_init): Call obstack_begin on `frags'.
* subsegs.c (subsegs_begin): Don't do it here.
* as.c (main): Call frag_init before subsegs_begin.

* frags.c (frag_append_1_char): New function.
* frags.h (frag_append_1_char): Declare it.
(FRAG_APPEND_1_CHAR): Call it.  Old definition is commented out for now.

* as.h (struct frag): Added (but commented out) new fields for tracking current
alignment.
(frag_now_fix): Changed macro to function declaration.
* frags.c (frag_now_fix): Define function here.
(frag_new): Use it instead of accessing `frags' directly.
* frags.h (frags): Change comment to indicate it shouldn't be accessed directly.
* subsegs.h (struct frchain): New field frch_obstack, intended to eventually
replace global `frags' obstack.
* subsegs.c (subseg_set_rest): Use frag_now_fix instead of accessing `frags'
directly.  Initialize fields of new frchainS explicitly instead of with memset.
* config/obj-coff.c (obj_coff_ln) [!BFD_ASSEMBLER]: Use frag_now_fix.
* config/tc-mips.c (s_loc), config/obj-vms.c (vms_resolve_symbol_redef),
symbols.c (colon): Likewise.
1994-12-20 22:42:03 +00:00
Ken Raeburn
d2a0c9f960 switch to libiberty version of xmalloc 1994-11-30 00:56:43 +00:00
Michael Tiemann
fb870b50a7 Add changes from customer since last work. 1994-11-26 00:17:52 +00:00
Ken Raeburn
460531dad9 Use EXIT_SUCCESS and EXIT_FAILURE in all exit calls.
Use exit rather than returning from main, for consistency on VMS.
Call as_fatal instead of as_bad or as_warn followed by exit.
1994-09-13 23:07:48 +00:00
Ken Raeburn
b11fb93989 Conversion to autoconf:
* acconfig.h, aclocal.m4: New files.
* configure.in: Rewritten (except for some target-specific code) for autoconf.
* conf.in, configure: New files, generated from the above.
* Makefile.in: Changed magic sequence indicating insertion of makefile
fragments.
(VPATH, srcdir, CC, LIBS, OBJS dependencies): Use @-substitutions from
configure.
(LINKED_HEADERS): Deleted a.out.gnu.h, a.out.h, and host.h.
(config.status, configure): Rewrite rules.
(config-stamp): Depend on conf.  Skip variables that configure is now
substituting itself.
(*.o dependencies): Deleted host.h.
(distclean, realclean): Don't delete host.h.
* as.c: Don't include stdio.h, string.h, sys/types.h.  Include signal.h after
as.h.
* as.h: Include alloca-conf.h first.  Include ctype.h, string.h, strings.h,
stdlib.h, unistd.h, sys/types.h, fopen-bin.h, fopen-same.h, as suggested by
autoconf test results.
[BROKEN_ASSERT]: Don't include assert.h.
(strdup): Declare.
(volatile, const): Define if not __STDC__ and not already defined.
(malloc, realloc) [NEED_MALLOC_DECLARATION]: Declare.
(free) [NEED_FREE_DECLARATION]: Declare.
* gasp.c: Include config.h, stdlib.h (if HAVE_STDLIB_H).  Don't include host.h.
(malloc) [NEED_MALLOC_DECLARATION]: Declare.
* messages.c: Include as.h first.  Include errno.h only if HAVE_ERRNO_H.  If
HAVE_VARARGS_H and not __STDC__, undefine HAVE_STDARG_H.  Set NO_STDARG and
NO_VARARGS as appropriate.
* doc/Makefile.in (srcdir, INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Use
autoconf @-substitutions.
1994-08-28 07:59:06 +00:00
Ian Lance Taylor
a2a1a548c7 gcc lint.
* 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.
1994-08-24 21:48:18 +00:00
David MacKenzie
baed44cd14 * as.c (show_usage), config/tc-alpha.c (md_show_usage),
config/tc-mips.c (md_show_usage): Fix up messages.
1994-06-03 21:19:02 +00:00
David MacKenzie
def66e248c * as.h: Replace flagseen with separate variables.
* as.c (parse_args): Set them.  Don't accept -1 option, or -v
	explicitly (it's a synonym for --version).
	* as.c, input-scrub.c, messages.c, read.c, symbols.c, write.c,
	config/obj-aout.c, config/obj-aout.h, config/obj-bout.c,
	config/obj-bout.h, config/obj-coff.c, config/obj-coff.h,
	config/obj-vms.c, config/tc-hppa.c, config/tc-i386.c,
	config/tc-i960.c, config/tc-m68k.c, config/tc-mips.c,
	config/tc-vax.c: Use the new flag variables instead of flagseen.
	* config/tc-vax.c [OBJ_VMS]: Recognize -+, -1, -v, and document in
	usage.
1994-06-03 20:59:20 +00:00
David MacKenzie
f3d817d8b7 * as.c (show_usage): Remove target specific messages;
instead, call md_show_usage.
	(parse_args): Use getopt_long_only.  Take pointers to argc and
	argv.
	(main): Pass parse_args pointers.
	* as.h: Remove 3 variables that are redundant with flagseen.
	* as.c, messages.c: Change their users to use flagseen.
	Define getopt stuff.
	* tc.h: Update md_parse_option decl.  Add md_show_usage decl.
	* config/tc-*.c: Add md_shortopts, md_longopts,
	md_longopts_size, md_show_usage.  Change calling convention for
	md_parse_option.  Remove md_parse_long_option.
	* config/tc-ns32k.c: Rename `struct option' to `struct ns32k_option'.
	* config/tc-i386.h: Don't define md_parse_option.
1994-06-03 17:42:27 +00:00
David MacKenzie
ebd6f11797 * as.c (show_usage): New function.
(parse_args): Code moved from main.
	Recognize --help and --version.
	* config/tc-ns32k.h: Define TC_NS32K.
	* doc/as.texinfo: Document all of the target-independent command
	line options.
1994-06-02 21:00:19 +00:00
Ian Lance Taylor
fe9205735e * as.c (main): Print long values using %ld. 1994-01-27 21:53:17 +00:00
Stan Shebs
ca7bd5579a Tue Jan 25 18:30:34 1994 Stan Shebs (shebs@andros.cygnus.com)
* as.c (quiet_flag): New flag.
	(main): If -noquiet given, display execution time and memory used.
1994-01-26 02:34:20 +00:00
Ken Raeburn
398527f2a8 Don't include config.h directly any more. 1994-01-14 01:54:01 +00:00
Ken Raeburn
8b13fa4e5c * as.c (main): Call listing_print before BFD gets closed, when symbol data
hasn't been freed up yet.
1993-12-20 15:43:23 +00:00
Jeff Law
6aba9d2931 * as.c (main): Disable "-R" option if NO_FOLD_DATA_AND_TEXT
is defined.
1993-10-29 20:35:26 +00:00
Ken Raeburn
f520031860 localize a conditionally used variable 1993-07-07 12:33:11 +00:00
Ken Raeburn
d303835063 look for GAS_VERSION macro, not external version_string var 1993-03-30 15:15:53 +00:00
Ken Raeburn
67f3dd7170 more bfd merging - see ChangeLog 1993-02-24 12:57:00 +00:00
Ken Raeburn
6efd877de5 Ran "indent", for GNU coding style; some code & comments still need fixup.
Removed some unneeded files.

configure.in: Don't look for te-386bsd.h, which doesn't exist...
1992-11-23 20:39:57 +00:00
K. Richard Pixley
e6498b10d7 use -K for broken word option rather than -k which means pic to sun as 1992-04-27 20:17:02 +00:00
K. Richard Pixley
3340f7e5fd White space and comment changes. #ifdef __STDC__ becomes #if __STDC__
== 1.  Get the declarations right in listing.[hc].
1992-02-15 21:13:03 +00:00
K. Richard Pixley
a39116f1c9 White space and comments only. The devo tree prior to this delta is
tagged as "vanilla" for your convenience.

There are also some comment changes.
1992-02-13 08:33:54 +00:00
Steve Chamberlain
5d9f0ecf62 * as.c: change -l to -a[lsn], to avoid conflict with 68000
command line option.

	* listing.h, listing.c: now prints addresses with ??? instead of 0 when
	errors in assemble prevent addresses being known. Prints
	symbol table more tidily. Allows different parts of the
	listing to be selected.
1992-01-21 22:14:16 +00:00
K. Richard Pixley
fecd2382e7 Initial revision 1991-04-04 18:19:53 +00:00