print out MD fields of fix.
* frags.c (frag_var, frag_variant): Use TC_FRAG_INIT macro (if
defined) to initialize MD fields in frag.
* as.h (struct frag, ns32k support): Rename ns32k to fr_ns32k.
Delete pcrel_adjust. Add fr_opcode_fragP, fr_opcode_offset.
* config/tc-ns32k.h: Add comments. Remove obsolete
BFD_FAST_SECTION_FILL definition, change prototypes for
fix_new_ns32k and fix_new_ns32k_exp to add new arguments
opcode_frag and opcode_offset and remove pcrel_adjust.
(TC_FIX_TYPE): add opcode_fragP and opcode_offset fields.
(TC_FIX_DATA_PRINT): new macro to print out TC_FIX_TYPE.
(TC_FRAG_INIT): new macro to initialize machine dependent field in
frags.
(frag_opcode_frag, frag_opcode_offset, frag_bsr): macros to access
MD fields in frag structure.
(fix_im_disp, fix_bit_fixP, fix_opcode_frag, fix_opcode_offset,
fix_bsr): macros to access MD fields in fix structure.
* config/tc-ns32k.c: Avoid overlength lines. Align comments. Don't
use struct opcode_location as these fields are now in the frag
structure.
(convert_iif): Call frag_more as it is needed instead
of trying to allocate for the whole insn. Avoid call of frag_more
with negative argument.
(md_pcrel_adjust, md_fix_pcrel_adjust, md_apply_fix,
md_estimate_size_before_relax, md_pcrel_from,
tc_aout_fix_to_chars): use accessor macros to get md fields in fix
and frag structures.
(fix_new_ns32k, fix_new_ns32k_exp): add new arguments opcode_frag and
opcode_offset and remove pcrel_adjust.
(convert_iif, cons_fix_new_ns32k): call fix_new_ns32k,
fix_new_ns32k_exp with changed arguments.
* configure.in: Make GAS_CHECK_DECL_NEEDED include <string.h> or
<strings.h> if they exist. Call GAS_CHECK_DECL_NEEDED on strstr
and sbrk.
* acconfig.h (NEED_DECLARATION_STRSTR): New macro.
(NEED_DECLARATION_SBRK): New macro.
* configure, conf.in: Rebuild.
* as.h: Only include <strings.h> if HAVE_STRINGS_H.
(strstr): Declare if NEED_DECLARATION_STRSTR.
* as.c: If HAVE_SBRK and NEED_DECLARATION_SBRK, declare sbrk.
* 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.
(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.
them to zero.
* config/tc-*.h, config/te-*.h: If defining them, define them to be 1 instead
of empty.
* expr.c (integer_constant, operand): Test them at run time instead of compile
time.
* read.c (read_a_source_file): Ditto.
* symbols.c (colon): Ditto.
(dollar_*, define_dollar_label, fb_*): Define unconditionally.
* symbols.h (dollar_*, define_dollar_label, fb_*): Declare unconditionally.
(relax_stateT): Separate typedef from enum definition.
(enum _relax_state): Reordered for better punctuation. Added new values
rs_align_code and rs_space.
(lineno, struct lineno_struct): Unused, deleted.
For friendlier assertion-failure messages:
* as.h: No longer include assert.h.
(as_assert): Declare.
(assert): New definition, calls as_assert longer needed.
(__PRETTY_FUNCTION__): Provide default for older versions of gcc.
* messages.c (as_assert): New function.
* gdbinit.in: Put a breakpoint there.
* 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.
(struct frag): Add some comments about the ns32k-specific fields and why
they're here.
(SIZEOF_STRUCT_FRAG): Cast addresses to char*, not int.
(flag_print_statistics): Declare.
* as.c (parse_args): Set flag_print_statistics instead of statistics_flag.
Options array is now const. Added new option "dump-config"; if specified,
print TARGET_ALIAS, TARGET_CANONICAL, TARGET_CPU, TARGET_OBJ_FORMAT, and
TARGET_FORMAT, if defined.
(main): Change test to check flag_print_statistics.
(statistics_flag): Deleted.
* 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.
* write.c (cvt_frag_to_fill): Don't assume that fr_var for rs_align or rs_org
frags will be 1.
(relax_segment): For rs_align, if fr_var is not 1, complain if
required padding is not a multiple of the size of the pad pattern.
(fixup_segment): Leave gp-relative relocations alone. For pcrel relocations
referring to the same segment, clear fx_pcrel when clearing fx_addsy.
* as.h: Adjust comments on rs_align.
* write.c, config/obj-{aout,bout,coff*}.c, config/tc-sparc.c: Query the fx_done
field instead of fx_addsy to see if the fixup still needs to be applied. Set
fx_done and clear fx_addsy both, for now. If TC_HANDLES_FX_DONE isn't defined,
assume md_apply_fix will only clear fx_addsy, and set fx_done accordingly after
returning.
* config/tc-sparc.h (TC_HANDLES_FX_DONE): Define.
* config/obj-coff.c (dot_text_symbol, dot_data_symbol, dot_bss_symbol): Defined
here, static.
* config/obj-aout.c [BFD_ASSEMBLER]: Undef NO_RELOC before including aout/aout64.h.
* write.c (write_object_file): If EMIT_SECTION_SYMBOLS is false, don't write
out a section symbol even if it's used in a relocation; assume relocations will
handle section numbers somehow. Rename "punt_it" label to "punt_it_if_unused"
to reflect it's true use.
(EMIT_SECTION_SYMBOLS): Default to 1.
(adjust_reloc_syms): Don't create a new symbol for an absolute
reference; just use the absolute section symbol.
(write_relocs): Make printout of reloc values dependent on flag DEBUG3, not
DEBUG2.
* config/obj-aout.h (EMIT_SECTION_SYMBOLS): Define as 0.
* config/obj-ecoff.h (EMIT_SECTION_SYMBOLS): Ditto.
Wrote non-BFD_ASSEMBLER subseg_new. Now subseg_new always takes a
section name, and subseg_set always takes a segT. Changed all
callers as appropriate.
* config/obj-coffbfd.c (change_to_section): Renamed to
obj_coff_add_segment. Corrected. Made callers use subseg_new.
* config/obj-coffbfd.h (obj_segment_name, obj_add_segment):
Define.
Also some more gcc warning removal.
just a longword:
* struc-symbol.h: New field sy_value.
* as.h: Include expr.h before struc-symbol.h.
* expr.h: Use struct symbol rather than symbolS.
* symbols.c (S_GET_VALUE, S_SET_VALUE): Rewrote to retrieve value
of sy_value field; compile unconditionally, not just if
BFD_ASSEMBLER.
* symbols.h: Compile S_{SG}ET_VALUE prototypes unconditionally.
* write.c (write_object_file): Set BFD symbol value to gas symbol
value.
* config/obj-aout.h, config/obj-bout.h, config/obj-coff.h,
config/obj-coffbfd.h, config/obj-generic.h, config/obj-vms.h
(S_GET_VALUE, S_SET_VALUE): Removed macro definitions.
* config/obj-ieee.c (S_GET_VALUE, S_SET_VALUE): Removed.
* config/obj-coff.h, obj-coffbfd.h: Rewrote several macros to use
S_GET_VALUE rather than ost_entry.n_value.
* config/obj-aout.c (obj_symbol_to_chars), config/obj-bout.c
(obj_symbol_to_chars), config/obj-coff.c (obj_symbol_to_chars),
config/obj-coffbfd.c (symbol_to_chars): Get value to write out
using S_GET_VALUE--don't assume it is already set.
* config/obj-ieee.c (do_symbols): Set BFD symbol value to gas
symbol value.
* config/obj-vms.c (various): Don't assign directly to
S_GET_VALUE; use S_SET_VALUE instead.
Deleted some unused code.
Fixed some declarations to use PARAMS macro.
Fixed up configure.in for new targets.
Some whitespace/comment fixes.
Merged config/ChangeLog.
* as.c: fix typo recently introduced.
* as.h : Don't include aout/reloc.h - it's not right for COFF!
* expr.c: Much rewriting, to accomodate MRI syntax for
expressions. Also easier to read now.
* listing.c: Put back defuns
* read.c: modified to accept MRI syntax, put back listing pseudo
ops so that an assembler built with NO_LISTING ignores list ops
rather than pukes.
* write.c, write.h: fixs - only keep a reloc type in a fix if the target
machine is a SPARC or a 29K.
* config/obj-aout.c: added s_sect pseudo op
* config/obj-coffbfd.c: lints, set the filehdr flags right and
fill in the timestamp.
* config/obj-coffbfd.h: Since we don't include aout/reloc.h
anymore, define all the relocs which the tc-<x> bit will use so we
can translate from them to the coff types.
* config/tc-a29k.c: reloc_type isn't ane enum any more
* config/tc-m68k.c: Added NO_RELOC definition.
Now compiles for sparc aout, 68k aout (MRI and MIT syntax),
29k coff.
So far works as replacement for sparc and 68k /bin/as.
* as.c: (perform_an_assembly_pass): moved declaration of i to
avoid a syntax error. Now always create the three default
sections when in MANY_SEGMENTS mode.
* as.h: New improved way of specifying MANY_SEGMENTS
* configure.in: hds object format is now coff-bfd
* subsegs.h: add line numbers and section stuff to the
segment_info structure. (But go back later and fix.. this is
COFF specific)