Commit Graph

40 Commits

Author SHA1 Message Date
Alan Modra 773f551c1d Catch some more cases where we can represent a 16 bit immediate operand as
8 bit sign extended.
2000-02-26 04:00:13 +00:00
Alan Modra cc5ca5ce51 Extend the i386 gas testsuite to do some tests for intel_syntax. Fix all
the errors exposed by this addition.  These were intel mode
"fi... word ptr", "fi... dword ptr", "jmp Imm seg, Imm offset", "out dx,al".
The failure with intel "out dx,al" was also present in att "out al,dx".
Extend testsuite to catch this case too.
2000-02-25 11:41:12 +00:00
Alan Modra 36bf8ab9fb Yet more .intel_syntax fixes. 2000-02-24 15:26:57 +00:00
Alan Modra 7f3f1ea2a1 Correct intel_syntax fsub* and fdiv* handling. Oh, how I'd like to be rid
of UNIXWARE_COMPAT.
2000-02-24 12:40:45 +00:00
Alan Modra 520dc8e893 config/tc-i386.c (struct _i386_insn): Combine disps, imms, regs into
a union.  Use throughout file.  Delete TC_RELOC macro.
2000-02-24 08:18:20 +00:00
Richard Henderson 7e0527420a * config/tc-i386.c (md_assemble): When swapping operands for
intel_syntax, assume everything that's not Imm or Disp is a
        register.
2000-02-24 00:43:29 +00:00
Alan Modra f6af82bd44 This lot mainly cleans up `comparison between signed and unsigned' gcc
warnings.  One usused var, and a macro parenthesis fix too.  Also check
input sections are elf when doing gc in elflink.h.
2000-02-21 12:01:27 +00:00
Alan Modra 4c63da97a7 This set of patches add support for aout emulation on the x86
assembler.  ie. You will be able to do "as --em=i386aout" on an x86
linux-elf assembler to generate aout format object files, rather than
using a separate assembler.  The aout emulation is enabled by giving
"--enable-targets=i386-linuxaout" to configure.
Oh yeah, there's a couple of fixes too.  Error messages shouldn't be
passed to printf in the format arg just in case someone puts a `%' in
the message.
2000-01-26 22:48:31 +00:00
Alan Modra add0c67765 Cosmetic changes to tc-i386.[ch] + extend x86 gas testsuite jmp and
call tests + tweak intel mode far call and jmp.
2000-01-15 12:06:03 +00:00
Alan Modra 3138f287b1 x86 indirect jump/call syntax fixes. Disassembly fix for lcall. 1999-12-27 16:10:31 +00:00
Alan Modra 2daf4fd896 * config/tc-i386.c (i386_immediate): Disallow O_big immediates.
(i386_displacement): Disallow O_big displacements.
1999-11-16 12:27:25 +00:00
Alan Modra c388dee89b Nit fix. 1999-10-12 11:07:34 +00:00
Ian Lance Taylor 4cc782b591 1999-09-19 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* config/tc-i386.c (md_shortopts): Check OBJ_MAYBE_ELF as well as
	OBJ_ELF.  If ELF, add "sq".
	(md_parse_option): If ELF, ignore -s and -q.
	(md_show_usage): Mention ELF options.
1999-09-19 23:03:56 +00:00
Alan Modra 2f66722d55 Hackery to handle ix86 "jmp constant" as a pc-relative jump to the given
absolute address.
1999-09-13 06:45:15 +00:00
Alan Modra a217f122fa Tidy jump handling code and comments. 1999-09-13 03:44:49 +00:00
Ian Lance Taylor d33e1d248c 1999-09-11 Donn Terry <donn@interix.com>
* config/tc-i386.c (tc_i386_fix_adjustable): Don't adjust
	BFD_RELOC_RVA relocations.
1999-09-12 05:09:50 +00:00
Ian Lance Taylor c0c949c786 * config/tc-i386.c (md_apply_fix3): Add horrible adjustments to
the value if TE_PE and a global defined symbol.
1999-09-12 05:06:09 +00:00
Ian Lance Taylor 18dc2407f4 1999-09-11 Donn Terry <donn@interix.com>
* config/tc-i386.c (md_undefined_symbol): Compare the name against
	the macro GLOBAL_OFFSET_TABLE_NAME, rather than assuming that it
	starts with "_G".
1999-09-12 03:50:42 +00:00
Ian Lance Taylor 79d292aaa2 1999-09-11 Donn Terry <donn@interix.com>
* config/tc-i386.c (tc_i386_fix_adjustable): Don't adjust
	relocations against global symbols if TE_PE.
1999-09-12 03:18:54 +00:00
Ian Lance Taylor 0723899b7e comment change 1999-09-12 02:27:31 +00:00
Ian Lance Taylor 2ab9b79ef9 1999-09-11 Donn Terry <donn@interix.com>
* config/atof-ieee.c (atof_ieee): Change what_kind to int.
	* config/atof-vax.c (flonum_gen2vax): Change format_letter to
	int.
	(md_atof): Return NULL rather than 0.
	* config/tc-i386.c (md_atof): Change type to int.
1999-09-12 02:12:38 +00:00
Alan Modra af6bdddf8c i386 gas code cleanups: combine i386_is_reg and parse_register. 1999-08-30 13:12:54 +00:00
Alan Modra 5f47d35be1 Allow spaces in i386 FP reg names, eg. %st ( 1 ). 1999-08-29 23:44:27 +00:00
Alan Modra b23bac3600 *gas/config/tc-i386.c: Fix errors in displacement size when
automatically inferring an address prefex.
1999-08-20 11:59:19 +00:00
Alan Modra bf6d389561 config/tc-i386.c: Remove dead code 1999-08-11 14:10:07 +00:00
Alan Modra eecb386cd7 Support for gcc to generate 16-bit i386 code. (.code16gcc) 1999-08-04 10:07:41 +00:00
Ian Lance Taylor a04b544b56 * config/obj-coff.c (coff_frob_symbol): Always update set_end with
next_set_end even if the end symbol is being discarded.

	* gasp.c: Add ATTRIBUTE_UNUSED as needed for non-BFD_ASSEMBLER.
	* output-file.c, symbols.c, config/tc-i386.c: Likewise.
	* config/obj-coff.c: Likewise.
	(seg_info_type): Remove.
	(seg_info_off_by_4): Change to array of segT.
	(s_get_segment): Adjust accordingly.
	(obj_pseudo_table): Fully initialize sentinel entry.
1999-08-03 15:29:04 +00:00
Alan Modra 24eab124bd Rationalize some of the i386 intel mode code.
Indentation and white space changes.
1999-08-03 14:30:05 +00:00
Alan Modra c3332e24e8 * config/tc-i386.c: Add INFER_ADDR_PREFIX code. Fix 16 bit mode nop. 1999-08-03 05:47:26 +00:00
Alan Modra b77ad1d4c9 Fix an overflow checking bug uncovered when a 32 bit target is compiled
with a 64 bit bfd.
1999-07-28 23:19:26 +00:00
Alan Modra b4cac588ae * gas/config/tc-i386.c: Fix for immediates and displacements in 16-bit
mode when no insn suffix present, eg. push $0x12345678.  Fix some
compiler warnings.  Disallow immediate jump absolute.
1999-07-16 11:09:15 +00:00
Ian Lance Taylor ab9da55419 * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
as appropriate.  Fill in structure initializations.  Add variable
	initializations.  Add casts.
	* dwarf2dbg.c (print_stats): Change i to size_t.
	* listing.c (listing_listing): Change list_line to unsigned int.
1999-07-11 20:20:04 +00:00
Ian Lance Taylor ae69440806 * config/tc-i386.c (i386_immediate): Remove unused label
seg_unimplemented.
1999-06-11 21:07:03 +00:00
Ian Lance Taylor 5865bb778d * config/tc-i386.c (md_apply_fix3): Add default case to switch. 1999-06-10 21:47:35 +00:00
Ian Lance Taylor 49309057b4 Add support for storing local symbols in a small structure to save
memory when assembling large files.
	* as.h: Don't include struc-symbol.h.
	(symbolS): Add typedef.
	* symbols.c: Include struc-symbol.h.
	(local_hash): New static variable.
	(save_symbol_name): New static function, from symbol_create.
	(symbol_create): Call save_symbol_name.
	(local_symbol_count): New static variable.
	(local_symbol_conversion_count): Likewise.
	(LOCAL_SYMBOL_CHECK): Define.
	(local_symbol_make): New static function.
	(local_symbol_convert): New static function.
	(colon): Handle local symbols.  Create local symbol for local
	label name.
	(symbol_table_insert): Handle local symbols.
	(symbol_find_or_make): Create local symbol for local label name.
	(symbol_find_base): Check for local symbol.
	(symbol_append, symbol_insert): Check for local symbols.
	(symbol_clear_list_pointers, symbol_remove): Likewise.
	(verify_symbol_chain): Likewise.
	(copy_symbol_attributes): Likewise.
	(resolve_symbol_value): Handle local symbols.
	(resolve_local_symbol): New static function.
	(resolve_local_symbol_values): New function.
	(S_GET_VALUE, S_SET_VALUE): Handle local symbols.
	(S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise.
	(S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise.
	(S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise.
	(S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise.
	(symbol_previous, symbol_next): New functions.
	(symbol_get_value_expression): Likewise.
	(symbol_set_value_expression): Likewise.
	(symbol_set_frag, symbol_get_frag): Likewise.
	(symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise.
	(symbol_mark_used_in_reloc): Likewise.
	(symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise.
	(symbol_mark_mri_common, symbol_clear_mri_common): Likewise.
	(symbol_mri_common_p): Likewise.
	(symbol_mark_written, symbol_clear_written): Likewise.
	(symbol_written_p): Likewise.
	(symbol_mark_resolved, symbol_resolved_p): Likewise.
	(symbol_section_p, symbol_equated_p): Likewise.
	(symbol_constant_p): Likewise.
	(symbol_get_bfdsym, symbol_set_bfdsym): Likewise.
	(symbol_get_obj, symbol_set_obj): Likewise.
	(symbol_get_tc, symbol_set_tc): Likewise.
	(symbol_begin): Initialize local_hash.
	(print_symbol_value_1): Handle local symbols.
	(symbol_print_statistics): Print local symbol statistics.
	* symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER.
	Declare new symbols.c functions.  Move many declarations here from
	struc-symbol.h.
	(SYMBOLS_NEED_BACKPOINTERS): Define if needed.
	* struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set.
	(struct symbol): Move bsym to make it clearly the first field.
	Remove TARGET_SYMBOL_FIELDS.
	(symbolS): Don't typedef.
	(struct broken_word): Remove.
	(N_TYPE_seg, seg_N_TYPE): Move to symbol.h.
	(SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise.
	(symbol_clear_list_pointers): Likewise.
	(symbol_insert, symbol_remove): Likewise.
	(symbol_previous, symbol_append): Likewise.
	(verify_symbol_chain, verify_symbol_chain_2): Likewise.
	(struct local_symbol): Define.
	(local_symbol_converted_p, local_symbol_mark_converted): Define.
	(local_symbol_resolved_p, local_symbol_mark_resolved): Define.
	(local_symbol_get_frag, local_symbol_set_frag): Define.
	(local_symbol_get_real_symbol): Define.
	(local_symbol_set_real_symbol): Define.
	Define.
	* write.c (write_object_file): Call resolve_local_symbol_values.
	* config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define.
	(TARGET_SYMBOL_FIELDS): Don't define.
	* config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field.  If
	ECOFF_DEBUGGING, add ECOFF fields.
	(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
	* config/obj-multi.h (struct elf_obj_sy): Add local field.  If
	ECOFF_DEBUGGING, add ECOFF fields.
	(ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define.
	(ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define.
	* config/tc-mcore.h: Don't include struc-symbol.h.
	(TARGET_SYMBOL_FIELDS): Don't define.
	(struct mcore_tc_sy): Define.
	(TC_SYMFIELD_TYPE): Define.
	* Many files: Use symbolS instead of struct symbol.  Use new
	accessor functions rather than referring to symbolS fields
	directly.
	* read.c (s_mri_common): Don't add in value of line_label.
	* config/tc-mips.c (md_apply_fix): Correct parenthesization when
	checking for SEC_LINK_ONCE.
	* config/tc-sh.h (sh_fix_adjustable): Declare.
1999-06-03 00:29:48 +00:00
Alan Modra e1b283bbb7 ÿ
Fiz i386-iaout breakage introduced by last patch.
1999-05-24 18:25:27 +00:00
Alan Modra 93382f6dd7 n
Move bitfield overflow checks to after the md_apply_fix call in
fixup_segment so that md_apply_fix has a chance to modify value.
Handle 8 and 16-bit pcrel relocs for i386.
Prototypes and other minor code cleanups.
1999-05-17 03:21:50 +00:00
Alan Modra 3f4438abfd ÿ
i386 PIII SIMD support, remove ReverseRegRegmem kludge
tidy a few things in i386 intel mode disassembly
1999-05-13 06:00:13 +00:00
Richard Henderson 83183c0c36 * config/tc-i386.c (i386_immediate): Skip whitespace before
complaining about junk after expression.
        (i386_displacement): Likewise.
1999-05-06 23:16:36 +00:00
Richard Henderson 252b5132c7 19990502 sourceware import 1999-05-03 07:29:11 +00:00