* frags.c (frag_var): Change offset parameter to offsetT.
(frag_variant): Likewise.
* frags.h (frag_variant, frag_var): Update declarations.
* config/tc-m68k.c (struct m68k_it): Change foff field to
offsetT.
(add_frag): Change off parameter to offsetT.
* Several files: Add casts to calls to frag_var.
(symbol_append): Set sy_next and sy_previous when adding a single
symbol to an empty list. Call debug_verify_symchain.
(verify_symbol_chain): Use assert, not know.
an equated symbol.
* write.c (write_relocs): Avoid looping on equated symbols.
Adjust fx_offset by X_add_number for each symbol.
* config/obj-coff.c (do_relocs_for): Avoid looping on equated
symbols.
(fixup_segment): Add a loop to track down equated symbols and
adjust fx_offset appropriately.
* config/tc-i386.h (md_number_to_chars): New macro.
* config/tc-alpha.c (build_operate_n, build_mem): Moved earlier in the file.
(load_symbol_address, load_expression): Use build_mem.
(build_operate): New function.
(emit_addq_r): Use it.
Wed Mar 13 22:14:14 1996 Pat Rankin <rankin@eql.caltech.edu>
* symbols.c (colon): #if VMS, use S_SET_OTHER to store `const_flag'.
Tue Mar 5 14:31:45 1996 Pat Rankin <rankin@eql.caltech.edu>
* config/tc-vax.h (NOP_OPCODE): Define.
Sun Feb 4 21:01:03 1996 Pat Rankin <rankin@eql.caltech.edu>
* config/obj-vms.h (S_IS_COMMON): Define.
(S_IS_LOCAL): Check for \002 as well as \001.
(LONGWORD_ALIGNMENT): New macro.
(SUB_SEGMENT_ALIGN): Use it.
Fri Jan 26 17:44:09 1996 Pat Rankin <rankin@eql.caltech.edu>
* config/vms-conf.h: Reconcile with conf.in.
* read.h (mri_comon_symbol): Declare.
(s_mri_common): Declare.
* read.c (mri_line_label): New static variable.
(mri_common_symbol): New global variable.
(potable): Add "common" and "common.s".
(read_a_source_file): In MRI mode, set mri_line_label for a label
at the start of a line.
(s_mri_common): New function.
(s_space): Handle mri_common_symbol.
* symbols.c (colon): Change return value from void to symbolS *,
and return new symbol. If mri_common_symbol is set, attach the
new symbol to it.
(resolve_symbol_value): Handle an sy_mri_common symbol.
* symbols.h (colon): Change return value in declaration.
* subsegs.c (subseg_set_rest): Clear mri_common_symbol.
(subseg_set (both versions)): Likewise.
* frags.c (frag_more): Warn if mri_common_symbol is not NULL.
* write.c (adjust_reloc_syms): Skip sy_mri_common symbols.
(write_object_file): Discard sy_mri_common symbols.
(fixup_segment): Change relocations against sy_mri_common symbols
to be against the common symbol itself.
* config/obj-coff.c (yank_symbols): Discard sy_mri_common symbols.
(fixup_segment): Change relocations against sy_mri_common symbols
to be against the common symbol itself.
* config/obj-aout.c (obj_crawl_symbol_chain): Discard
sy_mri_common symbols.
* 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.
undefined or in expr_section.
(resolve_symbol_value, case O_add): For symbol plus constant-valued symbol,
convert to O_symbol and re-reduce.
(S_GET_VALUE): If symbol needs resolving, resolve it.
(indent_level): No longer static.
(print_symbol_value_1): Don't print frag address if it matches
zero_address_frag. Don't print "resolving" if already resolved. Print segment
name. Don't call print_expr_1 on an undefined symbol.
(print_expr_1): Fix whitespace before printing X_add_number.
(symbol_begin): Moved to end of file, so function inlining can work better.
(fb_label_count, fb_label_max): Default C static initializers are sufficient.
* symbols.h (dot_text_symbol, dot_data_symbol, dot_bss_symbol): Declarations
deleted.
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.
* configure.in (m88k-*-coff*): New target. Use coffbfd and
m88kcoff.
* config/m88kcoff.mt: New file.
* read.c (lex_type): New macro LEX_AT to set lex type of '@'.
(pseudo_set): Handle difference of symbols in different fragments
by saving the entire expression as the value of the symbol.
* symbols.c (resolve_symbol_value): Resolve difference
expressions.
* config/obj-coffbfd.c (obj_pseudo_table): If TC_M88K, accept
"sdef" as a synonym for "def".
* config/obj-coffbfd.h: If TC_M88K, include coff/m88k.h and set
TARGET_FORMAT.
(S_IS_LOCAL): Any symbol which includes \001 in the name is local.
* config/tc-m88k.c, config/tc-m88k.h: Numerous changes to bring
m88k port up to date, and to add COFF support.
as the value of a symbol.
* struc-symbol.h (struct symbol): Removed sy_forward field. Added
sy_resolved and sy_resolving single bit fields.
* symbols.c (symbol_new): Don't initialize sy_forward field.
(resolve_symbol_value): New function to adjust symbol value by
fragment address, using recursion to resolve forward symbols.
* symbols.h: Added prototype for new function.
* read.c (pseudo_set): Set symbolP->sy_value to an undefined
expression rather than setting symbolP->sy_forward.
* write.c (write_object_file): Use resolve_symbol_value on
symbols, keeping the common case (the old behaviour) inline.
* config/obj-aout.c (obj_aout_frob_symbol): Removed sy_forward
handling (subsumed by write.c change).
* config/obj-coff.c, config/obj-coffbfd.c (obj_coff_val): Set
sy_value rather than sy_forward.
* config/obj-coffbfd.c (obj_coff_endef, yank_symbols): Check
expression segment rather than sy_forward.
(yank_symbols): Use resolve_symbol_value.
(crawl_symbols): Removed extra pass over symbols.
* config/obj-aout.c, config/obj-bout.c, config/obj-coff.c,
config/obj-vms.c (obj_crawl_symbol_chain): Removed extra pass over
symbols which handled sy_forward; use resolve_symbol_value
instead.
* config/obj-coff.h, config/obj-coffbfd.h (obj_frob_forward_symbol):
Define.
* config/obj-elf.c (obj_elf_stab_generic): Check expression
segment rather than sy_forward.
* config/obj-vms.c (VMS_Check_For_Main): Don't initialize
sy_forward; do initialize sy_resolved and sy_resolving.
* config/tc-hppa.h (STAB_FIXUP): Use sy_value, not sy_forward.
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.
* app.c, config/tc-*.c: Don't include read.h, since it is already
included by as.h.
* These are based on patches from Minh Tran-le
<mtranle@paris.intellicorp.com>.
* configure.in (i[34]86-ibm-aix*): Accept i486 for host. Use
obj_format coffbfd and gas_target i386coff for target.
(i[34]86-*-isc*): New host (uses sysv).
* config/i386aix.mt: Removed (no longer used).
* config/mh-i386aix (RANLIB): Use true rather than /bin/true.
(MINUS_G): Removed.
(LDFLAGS): Added, defined as -shlib.
* config/te-i386aix.h (REVERSE_SORT_RELOCS): Undefine.
* config/te-sco386.h (LOCAL_LABEL): Don't define.
(DOT_LABEL_PREFIX): Define.
* expr.c (operand): If DOT_LABEL_PREFIX, use .L0\001 as a label
name rather than L0\001.
* read.c (s_lcomm): Make a frag in SEG_BSS rather than using
local_bss_counter.
* symbols.c, symbols.h (local_bss_counter): Removed.
* write.c (write_object_file): bss no longer uses
local_bss_counter. Pass correct data and bss size to
VMS_write_object_file.
* config/obj-vms.c (VMS_write_object_file): Accept bss size as
argument, rather than using local_bss_counter.
* config/tc-m88k.c (s_bss): Don't use local_bss_counter.
* config/tc-sparc.c (s_reserve): Don't use local_bss_counter.
* config/obj-coffbfd.c (had_lineno, had_reloc): Removed.
(size_section): Restored sanity check.
(do_relocs_for): Base section address on s_paddr rather than
computing it. Adjust a29k R_IHIHALF special case to account for
section paddr (used to require paddr to be zero). If there are no
reclos, set s_relptr to 0. Set relocation size in object_headers.
(fill_section): Always set s_vaddr here, removing
ZERO_BASED_SEGMENTS case. Force s_scnptr for bss to 0. Don't set
NOLOAD for i386 .bss, because it confuses the SVR3 native linker.
Set STYP_INFO for .comment.
(coff_header_append): Use object headers and H_{SET,GET}_* macros.
Make aouthdr writing depend on OBJ_COFF_OMIT_OPTIONAL_HEADER.
(crawl_symbols): Handle 8 character section name correctly. Use
H_{SET,GET}_* macros.
(do_linenos_for): Set lineno size in object_headers.
(write_object_file): Use H_{SET,GET}_* macros. Don't bother to
set s_vaddr here. If string_byte_count remains 4, set it back to
0, and only write strings out if there are some. Call
fill_section before do_relocs_for and do_linenos_for.
(obj_coff_section): Handle optional quoted second argument giving
section characteristics.
(obj_coff_bss): Added to handle .bss.
(obj_coff_ident): Added to handle .ident (puts string in .comment
section).
(obj_coff_lcomm): Put common symbols in .bss, not .data.
(fixup_mdeps): Change to segment. Call frag_wane after
md_convert_frag.
(fixup_segment): Explicitly check S_IS_COMMON before making 386
adjustment (already happened only for common symbols, but this is
clearer).
* config/obj-coffbfd.h (OBJ_COFF_OMIT_OPTIONAL_HEADER): Define.
* config/tc-i386.c (s_bss): Don't use if I386COFF.
(md_pseudo_table): Ignore .optim and .noopt.
(tc_coff_sizemachdep): New function.
* config/tc-i386.h (REVERSE_SORT_RELOCS): Undef, for SVR3
compatibility.
(LOCAL_LABEL): Removed definition.
(DOT_LABEL_PREFIX): Defined.