(s_uses): New static function.
(sh_coff_frob_file): New function.
(md_convert_frag): Call subseg_change before calling fix_new.
(sh_handle_align): New function.
(SWITCH_TABLE): Define.
(sh_force_relocation): New function.
(md_apply_fix): Handle R_SH_USES, R_SH_COUNT and R_SH_ALIGN.
(sh_coff_reloc_mangle): Likewise. Also handle switch table
entries.
* config/tc-sh.h (HANDLE_ALIGN): Define.
(sh_handle_align): Declare.
(TC_FORCE_RELOCATION): Define.
(sh_force_relocation): Declare.
(TC_COUNT_RELOC): Simplify; rely on TC_FORCE_RELOCATION instead.
(tc_frob_file): Define.
(sh_coff_frob_file): Declare.
* config/obj-coff.c (write_object_file): Call tc_frob_file if it
is defined.
(fixup_mdeps): Call HANDLE_ALIGN if it is defined.
(TC_FORCE_RELOCATION): Define if not defined.
(fixup_segment): Use TC_FORCE_RELOCATION to decide whether to
clear the symbol fields of fixP.
* config/tc-arm.h (BYTE_ORDER): Delete.
(TARGET_FORMAT): Provide value for OBJ_COFF and TE_PE.
(ARM_BI_ENDIAN): Define if OBJ_COFF and TE_PE.
* config/tc-arm.c (byte_order): Delete.
(md_number_to_chars): Reference target_big_endian, not byte_order.
(md_chars_to_number): Likewise.
(md_longopts): Add -EB/-EL if ARM_BI_ENDIAN.
(md_parse_options): Recognize -EB/-EL.
(md_show_usage): List -EB/-EL.
* config/tc-sparc.h (sparc_pic_code): Always declare, not just
when OBJ_ELF.
(TC_RELOC_RTSYM_LOC_FIXUP): Define when OBJ_AOUT.
(tc_fix_adjustable): New definition for OBJ_AOUT.
* config/tc-sparc.c (sparc_pic_code): Always define, not just when
OBJ_ELF.
(md_apply_fix): Adjust reloc addend for OBJ_AOUT and PIC. In
BFD_RELOC_32_PCREL_S2 case, don't increment val for an external
symbol when PIC.
(tc_gen_reloc): Generate different PIC relocs when OBJ_AOUT, as
well as when OBJ_ELF.
(md_shortopts): If OBJ_AOUT, include `k'.
(md_parse_option): If OBJ_AOUT, handle 'k'.
(md_show_usage): Mention -k if OBJ_AOUT, and -KPIC if OBJ_ELF.
(md_pcrel_from): Don't add in size for an external symbol when
PIC.
* write.c (adjust_reloc_syms): Set sy_used_in_reloc for both
symbols in a fixup where a defined symbol is subtracted from an
undefined symbol (when UNDEFINED_DIFFERENCE_OK is defined).
(fixup_segment): Do nothing for the difference of two symbols if
UNDEFINED_DIFFERENCE_OK is defined.
* ecoff.c (add_file): Don't collapse multiple .file commands into
a single file structure.
(ecoff_build_lineno): Set ilineBase to sum of previous file's
ilineBase and cline.
* config/tc-mips.c (mips_4010): New static variable.
(interlocks): New static variable.
(md_begin): Check for a cpu of "r4010". Set mips_4010 correctly.
If mips_4650 or mips_4010, set interlocks.
(append_insn): Check interlocks, not mips_4650.
(mips_emit_delays): Likewise.
(mips_ip): Only permit INSN_4010 instructions if mips_4010.
(md_longopts): Add "m4010" and "no-m4010".
(md_parse_option): Accept -mcpu=r4010. Handle -m4010 and
-no-m4010.
(md_show_usage): Document -m4010 and -no-m4010.
(init_file): Initialize fake.
(add_file): Add new parameter fake. Change all callers.
(ecoff_build_debug): Don't warn about a missing .end for a fake
file.
PR 6509.
* config/tc-i386.c (md_apply_fix3): Rename from md_apply_fix1.
Accept pointer to value and segment. Fix OBJ_ELF PCREL case to
handle global defined symbols correctly.
(md_apply_fix): Remove both versions.
* config/tc-i386.h (MD_APPLY_FIX3): Define.
BSF_FUNCTION.
(symbol_globalP, symbol_global_lastP): New global variables.
(yank_symbols): Sort defined global symbols to the end, just
before the undefined symbols.
(glue_symbols): Add two arguments, and use them instead of
referring directly to global variables.
(crawl_symbols): Call glue_symbols twice, once for defined globals
and once for undefined. Add corresponding know calls.
PR 5491.
* write.c (fixup_segment): Pass fixP to TC_RELOC_RTSYM_LOC_FIXUP,
not fixP->fx_r_type.
* config/tc-sparc.c (sparc_pic_code): New global variable.
(md_apply_fix): If generating PIC, adjust fx_addnumber for any non
PC relative reloc.
(tc_gen_reloc): If generating PIC, adjust various reloc types.
Remove fx_pcrel assert, since it is no longer true.
(md_parse_option): Handle -K PIC.
* config/tc-sparc.h (sparc_pic_code): Declare if OBJ_ELF.
(TC_RELOC_RTSYM_LOC_FIXUP): Define if OBJ_ELF.
(tc_fix_adjustable): Don't adjust PC relative relocs if PIC.
* config/tc-i386.h (TC_RELOC_RTSYM_LOC_FIXUP): Take a fixp, not a
reloc type.
PR 7131.
* 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.
at_end.
(file_info): Initialize at_end, not end_pending.
(buffer_line): If at_end set, just return immediately. Don't
worry about end_pending cases. Set at_end when EOF is read.
(print_source): Check at_end, not end_pending.
(listing_listing): Likewise.
PR 6636.
(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.