(get_bf, get_cmp, get_cnd, get_cr, get_fcr, get_imm16, get_reg,
get_vec9, getval, get_pcr, calcop, match_name): make static and
prototype.
(s_file): remove extraneous forward decl.
(md_begin): add const to retval decl.
(calcop): cope with instructions without arguments. Handle 'o'
type argument, the o6 field of the prot insn.
(md_estimate_size_before_relax): return a dummy value.
set previous_section and previous_subsection and then call s_data
and s_text, respectively.
(obj_pseudo_table): Add data and text.
(obj_elf_section): Add SEC_LOAD to default initialization of
flags. Treat .rodata1 like .rodata. Set SEC_LOAD as well as
SEC_ALLOC for "alloc" string. Don't bother trying to find the
section; just use subseg_new.
* read.c (change_to_section): Removed. This is now done by
subseg_new.
(get_stab_string_offset): Rearranged somewhat. Create the section
using subseg_new. Store the string index in seg_info, rather than
in a static variable. Force the first string to be empty. Use
frag_more rather than FRAG_APPEND_1_CHAR.
(s_stab_generic): Rewrote.
* subsegs.h (segment_info_type): Added stabu union.
* subsegs.c (subseg_new): Initialize stab_string_size to 0.
* config/obj-aout.c: Don't include aout/stab_gnu.h.
(obj_aout_stab, obj_aout_desc): Removed.
(obj_pseudo_table): Removed desc and stabX entries.
* config/obj-bout.c: Same changes as config/obj-aout.c.
* config/obj-bout.h (S_SET_TYPE): Define.
(tc_bout_fix_to_chars): Declare.
* config/obj-coff.c (obj_coff_stab): Removed.
(obj_pseudo_table): Removed desc and stabX entries.
* config/obj-coff.h (SEPARATE_STAB_SECTIONS): Define.
* config/obj-coffbfd.c (current_stab_symbol): Removed.
* config/obj-coffbfd.h (obj_symbol_type): Removed n_strx, n_type,
n_other, n_desc and n_value fields.
(S_{S,G}ET_{OFFSET,OTHER,TYPE,DESC}): Removed.
(MAKE_STAB_SYMBOL): Removed.
* config/obj-ecoff.c (obj_ecoff_stab): Renamed to ecoff_stab.
Changed arguments and removed parsing code.
(obj_pseudo_table): Removed stabX entries.
* config/obj-ecoff.h (ecoff_stab): Declare.
(OBJ_PROCESS_STAB): Define.
* config/obj-elf.c: Don't include aout/stab_gnu.h.
(obj_elf_stab, obj_elf_xstab, obj_elf_desc,
elf_stab_symbol_string, elf_stab_symbol, obj_elf_stab_generic):
Removed.
(obj_pseudo_table): Removed desc, stabX and xstabs entries.
(obj_elf_version): Use subseg_new, not bfd_make_section. Don't
set SEC_LOAD for .note section.
(adjust_stab_sections): Get frag pointer from seg_info, rather
than looking through frags.
* config/obj-elf.h (S_{S,G}ET_{OTHER,TYPE,DESC}): Removed.
(SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION, OBJ_PROCESS_STAB):
Define.
* config/obj-vms.c (obj_aout_stab): Removed.
(obj_pseudo_table): Removed stabX entries.
* config/obj-vms.h (S_SET_TYPE): Define.
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.
* config/tc-mips.c (macro_build): Accept 'z', and ignore it.
(macro): Use "z,s,t" for div instructions to match corresponding
change in opcode table.
(mips_ip): Added 'z'--must be zero register.
load_register.
(set_at_unsigned): Removed; changed callers to use set_at.
(load_register): Removed unused ip argument. Changed callers.
(append_insn): Don't swap branch and branch likely.
(macro_build): Handle 'u'.
(load_register): Handle 64 bit constants.
(macro): Added M_DABS, removed M_ABSU. Numerous changes to
support 64 bit constants.
(mips_ip): Use hex constants in range checks for clarity.
(md_number_to_chars): Support 8 byte values.
(md_begin): Initialize mips_isa based on TARGET_CPU. Don't sanity
check macros. Set text alignment and GP size here.
(md_assemble): Don't set text alignment and GP size here.
(append_insn): Don't insert NOPs for load delays if mips_isa >= 2.
Use the right mask and shift for WRITE_FPR_T and WRITE_FPR_S. Add
a NOP after a branch likely.
(mips_emit_delays): Don't insert NOPS for load delays if mips_isa
>= 2.
(macro): Support r6000 and r4000 macros.
(mips_ip): Check insn ISA level against mips_isa before using it.
Added 'x' case for ignored register.
(md_parse_option): Handle -mipsN and -mcpu=XX.
(md_parse_option): New macro, converted from function.
* tc-i386.c (md_parse_option): Function deleted.
(comment_chars) [OBJ_ELF]: Include "/".
(line_comment_chars) [OBJ_ELF || TE_I386AIX]: Don't include "/".
(md_assemble): Cast 0xe9 to char explicitly, to avoid compiler warning.
(md_assemble, md_estimate_size_before_relax, md_create_long_jump): Call reloc
for fix_new type, or use correct enumerator, instead of always using NO_RELOC.
(i386_operand): Change "ifndef I386COFF" to "ifdef OBJ_AOUT" for
tests for valid section.
(md_convert_frag) [BFD_ASSEMBLER]: Compensate for frag start address.
(md_apply_fix_1) [BFD_ASSEMBLER]: For pc-relative reloc with
symbol, compensate for location of reloc.
(reloc, BFD_RELOC_32, BFD_RELOC_32_PCREL) [!BFD_ASSEMBLER]: Define to return
zero.
(obj_elf_weak): New function.
(obj_pseudo_table): Handle ".weak".
(obj_elf_section): If section directive includes a string, ignore
it for now. Accept "progbits" flag.
(obj_elf_type): Accept `@' before flag name.
if .set nobopt or .set volatile.
(gp_reference): .lit8 and .lit4 are accessed via the GP register.
(macro): Added cases M_LI_S, M_LI_SS. Fixed M_LI_D and M_LI_DD.
(mips_ip): Added cases 'F', 'L', 'f', 'l' for floating point.
* config/obj-ecoff.c: Renamed some variables to avoid shadow
warnings.
davidj@ICSI.Berkeley.EDU (David Johnson): Don't accept symbolic
names for 'E' and 'G' argument types (coprocessor registers) and
don't warn if $1 is used on the coprocessor.
debug section is new, allocate an extra 12 bytes at its start. If
".stabs" type is N_SO, fill in filename symbol field of that first
entry. Return early if "goof", to simplify later code slightly.
(adjust_stab_sections): New function.
(elf_frob_file): Apply adjust_stab_sections to each section.
* obj-elf.c (obj_elf_section, obj_elf_previous): No longer static.
* obj-elf.h (obj_elf_section, obj_elf_previous): Declare.
* tc-sparc.c (md_pseudo_table): Call them for "pushsection"
and "popsection", and call cons for "uaword" and "uahalf".
* obj-elf.c (obj_elf_version): Use English in error messages.
* tc-sparc.c (md_apply_fix, case BFD_RELOC_64): New case,
parallel to BFD_RELOC_32.
(tc_gen_reloc): Accept BFD_RELOC_64.
pseudo-op with a poc_handler field of NULL, ignore it and treat it
as an instruction instead.
* config/tc-m88k.c (md_pseudo_table): Add "set" with a NULL
poc_handler field.
* configure.in (case ${generic_target}): Add i[34]86-*-sysv4*
case to set obj_format=elf. Must go before i386-*-sysv* case that
sets obj_format=coffbsd. Add *-*-sysv4* to *-*-elf and
*-*-solaris case, and move to before *-sysv* case that wants to
set obj_format to coff.
* config/tc-i386.c (i386_operand): Change all 'exp.X_op' to
'exp->X_op'.
* config/tc-i386.c (md_apply_fix): Fix valp to be 'valueT *' for
BFD_ASSEMBLER case.
up opcodes as pseudo-ops even if they don't start with '.'.
* config/tc-m88k.h (NO_PSEUDO_DOT): Define.
* config/tc-m88k.c (md_assemble): Removed special pseudo-op
handling.
(md_apply_fix): Set fx_offset to the upper 16 bits of the reloc.
Output the low 16 bits for RELOC_HI16, not the high 16 bits.
* config/obj-coffbfd.c (do_relocs_for): If TC_M88K, set the
r_offset field of the reloc to the fixup offset.
(fixup_segments): If TC_M88K, don't warn about fixup overflows.
* doc/as.texinfo: Minor updates.
(previous_section, previous_subsection): New vars.
(obj_elf_section): Save current place in case DWARF code wants us
to pop back to it. Handle unquoted section name as well as quoted
section name. Don't crash on invalid strings.
(obj_pseudo_table): Handle new pseudos "previous", "2byte", and "4byte".
undefined symbols.
Fixes PR 2997.
* read.c (s_data), config/obj-coffbfd.c (obj_coff_data): If -R,
switch to text section rather than data section.
Fixes PR 2971.
* config/tc-mips.c: Many changes to support simple assembler
optimization.
(insn_label, prev_insn, prev_prev_insn, dummy_opcode,
prev_insn_valid, prev_insn_frag, prev_insn_where,
prev_insn_fixp, prev_insn_is_delay_slot): New static
variables.
(insn_uses_reg, mips_no_prev_insn, mips_emit_delays,
mips_align, s_stringer, s_mips_space): New static functions.
(mips_define_label): New global function.
(md_pseudo_table): For "ascii", "asciz", "asciiz", call
s_stringer. Changed argument to float_cons from 0 or 1 to 'f'
or 'd'. For "space" call s_mips_space.
(md_begin): Call mips_no_prev_insn.
(append_insn): Only insert necessary NOP instructions.
(macro): Call mips_emit_delays before setting mips_noreorder.
Increment and decrement mips_noreorder rather than using
save_reorder_condition. Don't bother to use noreorder in
M_L_DOB and M_L_DAB, since append_insn will not insert a NOP.
(md_atof): Handle floating point numbers correctly for both
big and little endian targets.
(s_align, s_cons): Call mips_align rather than frag_align.
(s_change_seg, s_cons): Call mips_emit_delays.
(s_float_cons): Let float_cons do the work.
(s_mipsset): Call mips_emit_delays when setting noreorder.
* config/tc-mips.h (tc_frob_label): Define to be
mips_define_label.
by md_pcrel_from if we are relocating against a symbol (we still
need md_pcrel_from for a PC relative relocation within the same
file).
* config/tc-m88k.c (md_pcrel_from): Corrected return value.
* 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.
* config/tc-mips.c: Include opcode/mips.h rather than
mips-opcode.h.
(append_insn): An extra NOP is only needed after instructions
which set HI or LO, not after instructions which read it.
(macro_build, mips_ip): Support new 'E', 'G' and 'B' arguments.
(macro): cfc1 and ctc1 now take "t,G" rather than "t,d".
* config/tc-mips.h (struct mips_opcode): Don't define.
* config/mips-big.mt, config/mips-lit.mt (TARG_CPU_DEPENDENTS):
Set to $(srcdir)/../include/opcode/mips.h.
Get the MIPS assembler up to speed with other gas changes:
* config/obj-ecoff.c (ecoff_set_vma, ecoff_frob_symbol):
Removed; don't change the symbol value.
(ecoff_build_symbols, ecoff_build_procs, ecoff_frob_file): Use
bfd_asymbol_value rather than S_GET_VALUE to include section
vma in symbol value.
(ecoff_frob_file): Ignore BSF_SECTION_SYM symbols, since ECOFF
doesn't output them. Set the vma of sections.
* config/obj-ecoff.h: Don't define obj_frob_symbol.
* config/tc-mips.c (tc_gen_reloc): Adjustment by section vma is no
longer necessary.
(various): use valueT rather than long.
(md_create_short_jump, md_create_long_jump, md_number_to_chars,
md_section_align): Adjusted for new interface.
(s_reserve): Permit use for other than a.out format.
(s_common): Handle Solaris-2 version.
(s_xword): For numbers, call big_cons.
(sparc_ip, md_apply_fix, tc_gen_reloc): Handle some sparc64 reloc types.
(md_number_to_chars): Handle 8-byte values.
Supply prototype for bfd_alloc for now.
(fixup_segment): Local add_number is now valueT. Fix some range-checking bugs.
(relax_align): Type `int' should be sufficient for the exponent.
(fix_new): Argument offset is offsetT. Locals size and newsize are valueT.