(struct m68k_incant): Change m_operands field to be const.
(struct m68k_it): Change args field to be const.
(m68k_ip): Change local variable s to be const.
(opcode_ptr): Remove.
(md_begin): Use m68k_numopcodes, not numopcodes. Use
m68k_opcodes, not removed opcode_ptr. Use m68k_numaliases, not
numaliases.
* as.h (flag_mri): Declare/define.
* as.c (show_usage): Mention -M and its synonym --mri.
(parse_args): Add 'M' to std_shortopts. Add "mri" to
std_longopts. Set flag_mri if -M is seen.
(main): Call parse_args before input_scrub_begin. Call
expr_begin.
* app.c (do_scrub_begin): Don't set lex for '"' or '\'' in MRI
mode. Do set lex for ';', '*', and '!' in MRI mode.
(do_scrub_next_char): Remove MRI ifdef in LEX_IS_WHITESPACE case.
In MRI mode, keep spaces between labels and colons. Remove MRI
ifndef around LEX_IS_ONECHAR_QUOTE case. In MRI mode, don't use
'!' or '*' as comment characters even if they are in
comment_chars.
* read.h (lex_type): No longer const.
* read.c: Include libiberty.h.
(lex_type): No longer const.
(read_begin): In MRI mode, set lex_type of '?' to 3.
(potable): Add dc, dc.b, dc.d, dc.l, dc.s, dc.w, dc.x, ds, ds.b,
ds.l, ds.w, and xdef.
(read_a_source_file): Change LABELS_WITHOUT_COLON ifdef to check
for MRI mode at runtime rather than compile time. Handle the EQU
pseudo-op in MRI mode. Remove bogus MRI ifdef around done_pseudo.
Change NO_PSEUDO_DOT ifdef to also take effect for MRI mode at
runtime.
(cons): In MRI mode, always call parse_mri_cons rather than
TC_PARSE_CONS_EXPRESSION.
(parse_mri_cons): Always compile, not just when MRI is defined.
Call TC_PARSE_CONS_EXPRESSION, not expression, when the input is
not a string constant. Handle A and E modifiers.
(float_cons): Accept :xxxx, where the x's are hex digits.
* expr.h (operatorT): Add O_eq, O_ne, O_lt, O_le, O_ge, O_gt.
(expr_begin): Declare.
* expr.c (integer_constant): In MRI mode, if the base was not
specified, look for a suffix on the number to set the base.
(mri_char_constant): New static function.
(operand): Remove MRI ifdef. In MRI mode, do various things: Pass
0 as the base when calling integer_constant if there was no
prefix. Check for a hex constant suffix if when a leading '0' is
seen. Don't accept 0x or 0b as a prefix. Check for E'chars' and
A'chars'. Handle MRI character constants. Treat '"' as the
unary bitwise not operator. Treat $ as the program counter, or as
the prefix for a hex constant. Treat % as the prefix for a binary
constant and @ as the prefix for an octal constant. Treat : as
the prefix for a hex constant.
(op_encoding): Set '"' to O_bit_not, '<' to O_lt, and '>' to O_gt.
(op_rank): No longer const. Change rank values.
(expr_begin): New function.
(operator): New static function.
(expr): Use operator. Don't bother to mention the operator in
warnings. Remove bogus #if 0 code. Handle new operatorT values.
* atof-generic.c (atof_generic): In MRI mode, accept underscores
around the exponent in floating point numbers.
* symbols.h (symbols_case_sensitive): Declare.
* symbols.c (symbols_case_sensitive): New global variable.
(symbol_create): Check symbols_case_sensitive.
(symbol_find_base): Likewise.
(resolve_symbol_value): Handle new operatorT values.
(print_expr_1): Likewise.
(S_IS_LOCAL): In MRI mode, names beginning with two '?' characters
are local.
(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.
(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.
(ecoff_directive_def): Set ecoff_debugging_seen.
(ecoff_stab): Likewise.
* ecoff.h: Make idempotent.
(ecoff_debugging_seen): Declare.
* config/tc-mips.c: Include ecoff.h.
(mips_debug): New static variable.
(s_stringer, s_mips_space): Remove unneeded declarations.
(md_parse_option): In case 'g', set mips_debug to debugging level.
(mips_local_label): New function.
* tc-mips.h (LOCAL_LABEL): Call mips_local_label.
(mips_local_label): Declare.
PR 6978.
* config/tc-hppa.c (tc_gen_reloc, SOM version): Handle
relocations for the difference of two (possibly external)
symbols.
(hppa_fix_adjustable): For SOM, reject reductions involving
the difference of two symbols.
(hppa_force_relocation): Force relocations for expressions
involving the difference of two symbols.
gas/bfd part of mentor-7363
* config/obj-coff.c (filename_list_head, filename_list_tail): New.
(yank_symbols): Notice and record filenames which are too long.
(w_strings): Write out filename strings.
(c_dot_file_symbols): Put long filenames onto list.
the strange common symbol format that other 386s formats
do.
* config/tc-i386.c (md_begin): If LEX_AT defined then
'@' is in the set of identifiers.
(i386_operand): If LEX_AT, then don't look for @goto stuff.
* config/te-pe.h: Define LEX_AT.
and libcoff.h.
(fill_section): Call PROGRESS.
* Makefile.in (INCLUDES): Add bfd srcdir.
* mpw-config.in: Add bfd_gas flag and set for each config.
(i386-unknown-go32, m68k-unknown-coff): Recognize.
* mpw-make.in (HACK_O_RAMA, OBJ_COFF_OMIT_TIMESTAMP): Add to
config.h.
FAKE_LABEL_NAME instead of checking third character. (Suggested by Pat Rankin.)
Mon 5 Jun 20:10:46 1995 Pat Rankin (rankin@eql.caltech.edu)
Add support for N_ABS and N_ABS|N_EXT type symbols.
* config/obj-vms.h (LSY_S_M_{DEF,REL}, ENV_S_M_{DEF,NESTED}): New macros for
local symbols (from <lsydef.h> and <envdef.h>).
* config/obj-vms.c (Current_Environment): New file-scope variable.
(VMS_Local_Environment_Setup): New routine.
(GBLSYM_LCL): New macro.
(VMS_Global_Symbol_Spec): Handle local symbols too.
(VMS_Psect_Spec): Set GLOBALVALUE_BIT for absolute symbols.
(VMS_Emit_Globalvalues): Handle local and global absolute symbols.
(VMS_Store_PIC_Symbol_Reference): Ditto.
(vms_write_object_file: GSD symbol loop): Ditto.
Check explicitly for undefined local dollar and f/b labels, and print a useful
message if any are found, instead of generating obscure undefined symbol table
entries.
For VMS gas port, make libiberty build on its own instead of driving it all out
of the gas directory. Also improve some of the libiberty support for VMS.
* config/obj-multi.h (obj_frob_symbol, obj_frob_file, S_GET_SIZE, S_SET_SIZE,
S_GET_ALIGN, S_SET_ALIGN, obj_copy_symbol_attributes, OBJ_PROCESS_STAB): New
macros.
* config/tc-mips.c: Protect against redefining them also when including
obj-elf.h. Test only OBJ_ELF for including elf/mips.h.
Initial support for PE object files.
* configure.in, configure (i386-*-pe, i386-*-*nt): Add.
* config/obj-coff.c (fixup_segment): Cope with PE wierdness.
* config/obj-coff.h (TE_PE): New target format.
non-MANY_SEGMENTS configuration. It should never get invoked, but this is
easier than conditionalizing some of the uses.
(struct seg_info_trash): Dummy type used by above to make code compile.
isn't set, abort.
(SEPARATE_STAB_SECTIONS): Default to zero.
(aout_process_stab): New function, split out from s_stab_generic.
(OBJ_PROCESS_STAB) [AOUT_STABS]: Define to call aout_process_stab, if not
already defined.
(s_stab_generic): Test SEPARATE_STAB_SECTIONS at run time. If it's not set,
and OBJ_PROCESS_STAB isn't defined, abort. Always pass six arguments to
OBJ_PROCESS_STAB.
* config/obj-aout.h (AOUT_STABS): Define.
* config/obj-bout.h (AOUT_STABS): Define.
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.
PC relative call since those only occur in cases where the linker
can fix them up.
(hppa_force_relocation): Force relocations for out of range PC
relative calls.
from Bryan Ford <baford@schirf.cs.utah.edu>:
* read.c (potable): Added balign and p2align, for aligning by bytes or powers
of two independent of what ".align" does for a given target.
* doc/as.texinfo: Document them.
* config/tc-sh.c (md_convert_frag): Instead of aborting on large displacements,
print an error message. Don't invoke the code that followed the abort call
until it's been verified.
some AIX versions.
* configure: Regenerated.
* configure.in: Add m68k-*-elf.
* config/tc-m68k.c (comment_chars) [OBJ_ELF]: Include '#'.
(md_pseudo_table) [OBJ_ELF]: Ignore "swbeg".
(md_begin): Set alt_notend_table['&'], so svr4-style immediate operands are
accepted.
(md_apply_fix): Argument VALP should point to valueT.
(md_convert_frag): Argument SEC should be type segT.
(md_shortopts) [OBJ_ELF]: Accept 'Q' with an argument.
(md_parse_option): Ignore it.
(md_convert_frag_1): Add in frag address for the symbol in the displacement
calculation.
* config/tc-m68k.h (TARGET_FORMAT) [OBJ_ELF]: Use "elf32-m68k".
(TARGET_ARCH): Define.
(REGISTER_PREFIX_OPTIONAL) [OBJ_ELF]: Default to 0.
(LOCAL_LABEL, FAKE_LABEL_NAME, REGISTER_PREFIX_OPTIONAL): Handle these the same
way for OBJ_ELF as for M68KCOFF.
unsigned seemingly negative number. Don't bother shifting a zero
value.
(mips_ip): For case 'j', if there are more alternatives, and the
ISA level is at least 3, don't accept an unsigned seemingly
negative number.
(fixup_segment): If linkrelax is set, just return.
(write_object_file): Don't treat h8300 and z8k specially with regard to fixups.
* config/tc-h8300.c (md_begin): Set linkrelax.
* config/tc-z8k.c (md_begin): Ditto.
Tue Jan 10 13:34:14 1995 Ken Raeburn <raeburn@cujo.cygnus.com>
* config/obj-coff.c (write_object_file): Don't treat h8300 and z8k
specially with regard to fixups.
r10000. If mips_isa is 4, set the machine number to 8000.
(append_insn): If mips_isa is at least 4, don't generate nops for
coprocessor delays. Check INSN_READ_FPR_R when setting
mips_cprmask[1].
(mips_emit_delays): If mips_isa is at least 4, don't generate nops
for coprocessor delays.
(mips_ip): Check for INSN_ISA4 instructions. Handle new argument
types 'h', 'R', 'N', and 'M'.
(md_longopts): Accept "mips4".
(md_parse_option): Handle -mips4, and -mcpu=10000 and -mcpu=8000.
(s_mipsset): Permit .set mips4.
(md_begin): Make hash table errors fatal. Process opcode aliases after main
opcode table.
(md_apply_fix_2, case 4): Recode setting of lower_limit to avoid gcc warning.
be consistent with current naming conventions.
(md_begin): Set a default architecture and machine type.
(pa_ip): If the current instruction specifies a newer machine type
than the current machine type, then update the current machine
type.
(need_pa11_opcode): Likewise.
* config/tc-sparc.c (md_apply_fix): If OBJ_ELF, subtract out the
value of a defined symbol; the value was added in by
fixup_segment. This was previously corrected, if the reloc was
changed to be against a section symbol, in tc_gen_reloc.
BFD_RELOC_32 to BFD_RELOC_386_GOTPC to handle a switch in frags.
Patch originally from Rob Ryan <robr@cmu.edu>.
* config/tc-i386.c: Include subsegs.h.
(tc_i386_fix_adjustable): Declare return value.
(i386_operand): Don't use an assignment directly as a condition.
* config/vms-conf.h (HAVE_UNISTD_H): define it unconditionally.
* config-gas.com: test for availability of <unistd.h>; create a rudimentary
one if necessary.
* config/tc-hppa.c (md_apply_fix): Go ahead and call
hppa_field_adjust to get a new value for R_DATA_ONE_SYMBOL
relocations in SOM.
(hppa_fix_adjustable): Refine somewhat.
* config/tc-ppc.c (md_parse_option): Accept mpwr2 as a synonym for
mpwrx; mppc32, m603, and m604 as synonyms for mppc; and mppc64 and
m620 for PowerPC64 mode.
(ppc_symbol_new_hook): Add T0 as synonym for TC0 suffix.
* config/tc-sh.c (md_begin): Remove unused variable table.
(md_assemble): Remove unused variable p.
(md_convert_frag): Cast fr_address to unsigned long for printf.
(md_apply_fix): Use as_warn_where rather than as_warn.
(sh_init_after_args): Remove empty function.
* config/obj-vms.c: Changed exported function names to lower case. (Changed
call sites in write.c.) Declare VMS system function names used, conditional on
actually being on VMS. Changed many functions that returned no useful value to
now be declared to return void. Removed many unused variables. Supply missing
return statements or values. Supply `default' case in switch statements.
Ensure local variables get initialized.
* config/tc-vax.c: Minor changes to silence "gcc -Wall".
* config/obj-vms.h, config/tc-vax.h: Added some missing declarations.
* expr.c (operand): Parenthesize && within ||.
* listing.c (listing_newline): Likewise.
(list_symbol_table): Use %lu to print sizeof.
* symbols.c: Comment out unused function indent.
(print_symbol_value_1): Cast pointer to unsigned long for printf.
* config/obj-coff.c (do_relocs_for): Only declare symbol_ptr if it
will be used.
* config/tc-h8300.c (md_begin): Remove unused variable reg.
(get_operand): Declare type of parameter direction. Remove unused
variable size.
(get_specific): Fix comment to avoid nested comments.
(check_operand): Cast X_add_number to unsigned long for printf.
(build_bytes): Remove unused local variables output_ptr, part, and
high.
(build_bytes): Cast X_add_number to unsigned long for printf.
(clever_message): Remove unused variable scan.
(md_assemble): Remove unused variable i.
(tc_coff_sizemachdep): Remove unused function.
* tc-h8300.h (tc_reloc_mangle): Declare.
(md_begin): Handle a cpu string of "4650". If mips_4650 was not
initialized, set it to 0.
(append_insn): Don't insert nops around HI and LO on a 4650.
(mips_emit_delays): Likewise.
(mips_ip): Use INSN_ISA mask to check ISA of instruction. Check
for INSN_4650.
(md_longopts): Add m4650 and no-m4650.
(md_parse_option): Handle mips-cpu=4650. Handle -m4650 and
-no-m4650.
* doc/as.texinfo: Document new MIPS options.
* read.c (s_space): Rewrite to handle general expressions. Generate rs_space
frags for non-constant values.
* write.c (cvt_frag_to_fill): Treat rs_align_code and rs_space like rs_align
and rs_org. Verify that fr_offset is non-negative, and force frag type to
rs_fill only after assertion checks.
(relax_segment): Treat rs_align_code like rs_align. Treat rs_space like rs_org
in the first switch; in the second, force the operand to a constant, and use it
for the growth size.
* 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.
config/tc-h8500.c, config/tc-hppa.c, config/tc-hppa.h, config/tc-sh.c,
config/tc-z8k.c: Don't rely on use of ".." when including header files.
* config/tc-rce.c: Ditto.
* config/obj-coff.c (fixup_segment): Reformat condition in an `if' statement.
objects and speed up the linker.
* config/tc-hppa.c (struct call_info): Replace end_symbol field
with a size field.
(hppa_elf_mark_end_function): Delete unneeded function.
(pa_build_unwind_subspace): For the 2nd unwind relocation, use
the function symbol + function size instead of a special symbol
for the end of the function.
(process_exit): Compute the function size here. Don't call
hppa_elf_mark_end_of_function anymore.
(pa_procend): Likewise.
(hppa_fix_adjustable): Only reject 32bit relocations for SOM.
(elf_hppa_final_processing): Simplify.
OBJDUMP_FOR_TARGET, NM_FOR_TARGET; they're not used.
(AS_FOR_TARGET, CC_FOR_TARGET, OBJDUMP, OBJDUMP_FOR_TARGET, NM, NM_FOR_TARGET):
Don't define.
(VMS_OTHER_OBJS): Add xmalloc.o and xexit.o from libiberty.
(tooldir): Use exec_prefix, not libdir.
requiring that the X_op_symbol be in the text_section.
(macro): Change the test for a legel expression difference to
correspond to changes in pseudo_set in read.c.
(tc_frob_file): Define to call pa_check_eof.
* config/tc-hppa.c (pa_check_current_space_and_subspace): New
function to verify the current space and subspace are reasonable.
Call for the appropriate pseudo-ops and before instruction parsing.
(pa_check_eof): New function to verify enter/exit and proc/procend
pairs match at EOF.
(pa_code): Simplify.
* config/obj-som.c: Delete #if 0 code.
offset within the current subspace along with updating the
alignment of the subspace itself.
(pa_subspace): Default alignment to one byte rathern than zero
bytes to avoid setting alignment to log2(0).
(md_pseudo_table): Use pa_alignment for .align.
definition.
(tc_frob_symbol): Make this condition on OBJ_SOM or OBJ_ELF. For
ELF, subtract out the symbol->section->vma for non-common symbols.
* gas/testsuite/gas/hppa/unsorted/unsorted.exp (importbug): Tweak
to match current expected ELF output.
* gas/testsuite/gas/hppa/reloc/reloc.exp
(do_plabel_relocation_test, do_r_no_reloc): Likewise.