Commit Graph

902 Commits

Author SHA1 Message Date
Ken Raeburn
31909d4099 configure.in: Alphabetize list of cpu type alternatives. Enable OS values of
"linux*elf*" and "linux*coff*" to select those formats, with linux emulation.
Don't bother checking for upper- or mixed-case versions of "ose".
1993-10-04 20:17:30 +00:00
Ken Raeburn
8208ab5a91 tc-m68k.c change 1993-10-04 20:10:50 +00:00
K. Richard Pixley
6cc87fbb75 correct a few mistakes found while extending the dissassembler. 1993-09-29 23:18:06 +00:00
Stan Shebs
d0c25cae81 Keep te-lynx.h 1993-09-28 20:20:27 +00:00
Stan Shebs
8f3956b328 More Lynx support, plus better stabs-in-coff generation. 1993-09-28 19:22:08 +00:00
Ken Raeburn
43029a8f84 Whitespace/comment cleanup. Use PARAMS in tc-vax.c.
Make various routines return null pointer instead of empty string for
success indication.
1993-09-28 04:47:32 +00:00
Ken Raeburn
b9790da889 expr.c (expr) [DIFF_EXPR_OK]: Permit subtraction of symbols in different segs. 1993-09-27 04:23:13 +00:00
Ken Raeburn
b7318ac442 some 68k pic stuff 1993-09-27 03:57:58 +00:00
Ken Raeburn
e3fce8d283 define DIFF_EXPR_OK 1993-09-27 03:56:04 +00:00
Ken Raeburn
b80d39a01c (flag_want_pic): New variable, mostly ignored.
(md_parse_option) [TE_SUN3]: Set it for "-k".
(m68k_ip): Generate proper fixup for mode 7.3.
1993-09-27 03:55:33 +00:00
Ken Raeburn
c996b1994e minor tc-m68k.c changes 1993-09-25 09:32:32 +00:00
Ken Raeburn
bcb8dff8d8 Moved struct m68k_incant and related macros earlier in the file.
Make insop and add_exp functions for readability.
Whitespace/comment changes.
1993-09-25 09:32:12 +00:00
K. Richard Pixley
58f3e8a9db * config/tc-m88k.c (get_o6): new function.
(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.
1993-09-24 19:47:59 +00:00
K. Richard Pixley
6d6b97b749 * config/m88k-opcode.h (m88k_opcodes): comment change; o6 field is
in bits 10 through 7.  flt.[dxs]s requires an r register in the
	  second argument.  New instruction lda.x.  New instruction muls
	  (alias for mul).
1993-09-24 19:41:51 +00:00
Ian Lance Taylor
97f99d1196 * config/tc-mips.c (md_begin): Set BFD architecture and machine
based on MIPS ISA level.
1993-09-24 17:47:04 +00:00
Ken Raeburn
67972d5076 Add some "setup_xfail" commands, correct at least for sun4 native. 1993-09-23 20:28:35 +00:00
Ken Raeburn
6110df28cd obj-coffbfd relax_align change 1993-09-23 17:24:51 +00:00
Ken Raeburn
eae7e03cac relax_align is now static 1993-09-23 17:20:29 +00:00
Ken Raeburn
9956df6a4a Whitespace/comment fixups.
Mention a29k, not sparc, in error messages and comments.
1993-09-21 20:41:42 +00:00
Ian Lance Taylor
9bd0d6499c * read.c (get_stab_string_offset): Make non-static. Make
arguments const.  Don't align strings to 4 byte boundaries.
	* read.h: Declare get_stab_string_offset.
	* config/obj-elf.c (obj_elf_section): Set SEC_ALLOC as well as
	SEC_LOAD for progbits section.
	(obj_elf_init_stab_section): New function.
	(adjust_stab_sections): Add casts to avoid warnings.
	* config/obj-elf.h (INIT_STAB_SECTION): Call
	obj_elf_init_stab_section.
	(OBJ_PROCESS_STAB): Removed definition.
1993-09-20 23:29:42 +00:00
Ian Lance Taylor
80903ca67b * config/obj-elf.h (S_GET_SIZE): Define.
(obj_frob_forward_symbol): Define.
	* config/tc-i386.c (line_comment_chars): Initialize in all cases.
1993-09-17 22:16:29 +00:00
Ian Lance Taylor
1399802122 * tc.h: Declare tc_gen_reloc differently depending upong
RELOC_EXPANSION_POSSIBLE.
	* config/obj-elf.c (obj_elf_section): Only set flags when first
	creating the section.
1993-09-16 18:26:36 +00:00
Ian Lance Taylor
90397ff823 * config/obj-elf.c (obj_elf_data, obj_elf_text): New functions;
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.
1993-09-14 22:28:22 +00:00
Ian Lance Taylor
4f0bccc7d8 Some more gcc lint, and:
* 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.
1993-09-14 17:58:35 +00:00
Ian Lance Taylor
604633aeca * subsegs.c: Renamed non-BFD_ASSEMBLER subseg_new to subseg_set.
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.
1993-09-13 21:32:07 +00:00
David Edelsohn
54e3e909d2 config/tc-sparc.h (LOCAL_LABEL): Remove test for name[0] == 'L'. 1993-09-13 20:16:03 +00:00
Ian Lance Taylor
a938b1d6ba More gcc lint with harsher warning options. 1993-09-11 00:15:39 +00:00
Ian Lance Taylor
58d4951d00 gcc lint. See ChangeLog for details. Also:
* config/obj-elf.h (S_SET_SIZE): Actually set the size.
1993-09-10 16:01:07 +00:00
Ken Raeburn
892a3ff190 gcc -Wall cleanups from Utah 1993-09-09 21:53:03 +00:00
Ian Lance Taylor
abdd08c97c * read.c (get_stab_string_offset, s_stab_generic): If
BFD_ASSEMBLER, call subseg_set rather than subseg_new.
1993-09-09 19:09:23 +00:00
Ian Lance Taylor
414b2c8f7a * config/obj-elf.c (obj_elf_section): Set SEC_LOAD when using
default flag values.
1993-09-08 19:11:47 +00:00
Stan Shebs
1531386bca Add missing ifdef to make m68k-aout targets happy. 1993-09-08 00:20:59 +00:00
Stan Shebs
4064305ec0 Changes to support stabs-in-coff 1993-09-07 17:39:56 +00:00
Ken Raeburn
81b407c990 PA and ELF changes 1993-09-03 22:38:18 +00:00
Ken Raeburn
d30c96ce06 obj-elf.h change 1993-09-03 22:37:03 +00:00
Ken Raeburn
5cf4cd1b8b more Utah changes, some cleanup of mine 1993-09-03 22:36:26 +00:00
Ken Raeburn
6a54ad639f (elf_symbol): Fixed name of elf_symbol_type.
No longer conditionalized on sparcv9.
1993-09-03 22:19:09 +00:00
Ian Lance Taylor
ff3a5c1866 Reverted previous change, and added this one instead:
* 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.
1993-09-02 17:19:14 +00:00
Ian Lance Taylor
1849d6464f * config/tc-mips.c (macro): If $0 is destination of divide, just
generate the simple machine instruction, for compatibility with
	the MIPS assembler.
1993-09-02 14:46:54 +00:00
Ken Raeburn
e96d50d03c write.c, configure.in changes 1993-09-01 19:58:44 +00:00
Ken Raeburn
13e9182dd6 (write_relocs) [RELOC_EXPANSION_POSSIBLE]: Declare tc_gen_reloc correctly. 1993-09-01 19:32:36 +00:00
Ken Raeburn
1ecd6c4ad4 Deleted explicit "return" statements without values at the ends of functions. 1993-09-01 19:29:02 +00:00
K. Richard Pixley
56607c4e13 add an alias for data section type 1993-09-01 19:20:54 +00:00
K. Richard Pixley
37d719bb44 recognize m88110 1993-08-25 23:16:39 +00:00
Ken Raeburn
2834499323 more hppa elf support from utah 1993-08-25 20:15:17 +00:00
Ian Lance Taylor
6e8dda9c46 * config/tc-mips.c (set_at): Added unsignedp argument. Use
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.
1993-08-23 17:04:49 +00:00
K. Richard Pixley
1e35cd8f6d comments for tc-m88k.h change 1993-08-20 23:52:35 +00:00
K. Richard Pixley
78805240a0 updated copyrights, declare TC_CONS_RELOC 1993-08-20 23:52:10 +00:00
Ian Lance Taylor
8358c818ff * config/tc-mips.c (mips_isa): New static variable.
(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.
1993-08-20 15:45:50 +00:00
Ken Raeburn
c8d4cda17c tc-i386, tc-sparc, obj-elf, tc.h changes 1993-08-20 05:29:56 +00:00
Ken Raeburn
d7852a330d * tc-sparc.c (s_local): Function moved and renamed...
* obj-elf.c (obj_elf_local): ...to here.
* tc-sparc.c (md_pseudo_table), obj-elf.c (obj_pseudo_table): Move handling of ".local".
1993-08-20 05:29:24 +00:00
Ken Raeburn
7b23213f31 * tc-i386.h (NO_RELOC) [BFD_ASSEMBLER]: Define as BFD_RELOC_NONE.
(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.
1993-08-19 17:45:03 +00:00
David D. Zuhn
f64f179373 remove rcs cruft 1993-08-18 22:50:08 +00:00
Ken Raeburn
4915cac01d obj-elf, write, symbols, read changes 1993-08-18 21:21:23 +00:00
Ken Raeburn
b81b8a7d14 Undef NO_RELOC before including aout/aout64.h.
(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.
1993-08-18 21:09:23 +00:00
Ken Raeburn
ba71c54da8 (potable): Treat "string" like "asciz". 1993-08-18 20:53:03 +00:00
Ken Raeburn
092579095a updated to-do list 1993-08-18 20:45:18 +00:00
Ian Lance Taylor
19ed896035 * config/tc-mips.c (append_insn): Don't swap branch instructions
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.
1993-08-18 19:45:17 +00:00
David D. Zuhn
ae8c28f8fc use coffbfd for z8k 1993-08-16 21:17:04 +00:00
Ian Lance Taylor
0aa07269cf * config/tc-mips.c (mips_ip): Suggested by
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.
1993-08-12 15:52:57 +00:00
Ken Raeburn
6a9cf6fa53 * write.c (merge_data_into_text): Define only if BFD_ASSEMBLER is
defined or BFD is not.
	(relax_and_size_all_segments): Declare local variable fragP.
1993-08-09 17:40:58 +00:00
Ken Raeburn
b114e49215 changes to write.c, obj-elf.c, tc-sparc.c 1993-08-06 19:27:43 +00:00
Ken Raeburn
d37258ccdd v9 changes 1993-08-06 19:24:28 +00:00
Ian Lance Taylor
3d2330f897 * configure.in (mips-*-riscos*, mips-*-sysv*): New (untested)
targets, using ecoff and mips-big.
1993-08-06 18:46:17 +00:00
Ken Raeburn
9242112213 (md_apply_fix): Fill in values for BFD_RELOC_{32,64}, not zeros.
(md_pseudo_table): Handle .uaxword.
1993-08-06 16:10:40 +00:00
Ian Lance Taylor
ac32a7e7df * config/tc-mips.c (mips_ip): From davidj@ICSI.Berkeley.EDU (David
Johnson): Added case for 'C' for coprocessor instruction codes.
1993-08-06 15:14:31 +00:00
Ken Raeburn
b23f674392 (write_object_file): Test DEBUG_SYMS instead of DEBUG for verifying sym chain.
(merge_data_into_text, relax_and_size_all_segments): New fns, split out from
write_object_file.
1993-08-05 21:21:30 +00:00
Ken Raeburn
273aa9471d read.c change; yesterdays elf/sparc changes 1993-08-05 17:14:11 +00:00
Ken Raeburn
b31f2abb70 (emit_expr): Use BFD_RELOC_64 fr 8-byte expressions. 1993-08-05 17:07:22 +00:00
Ken Raeburn
046dc4bce1 v9 changes 1993-08-04 23:11:31 +00:00
Ken Raeburn
693b21e75a * obj-elf.c (obj_elf_stab_generic, in disabled code): If
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.
1993-08-04 23:10:43 +00:00
Ian Lance Taylor
4573d18601 * config/obj-ecoff.c: Updated for BFD ECOFF changes. Now gets the
swapping routines and external structure sizes via the
	ecoff_backend information.  No longer includes coff/mips.h.
1993-08-03 20:25:58 +00:00
Ian Lance Taylor
4c7ff23d32 * config/obj-ecoff.c (get_tag): Save tag name in permanent memory
and in hash_ptr->string.
1993-08-02 22:28:25 +00:00
Ian Lance Taylor
b4703fa618 * app.c (do_scrub_next_char): Reset state to 0 after .appline if
file name is not seen.
1993-08-02 21:39:05 +00:00
Ken Raeburn
28409e916f keep ho-hppaosf.h; m88k.patches is gone 1993-07-30 22:38:38 +00:00
Ian Lance Taylor
ced16de6bd * write.c: Don't use short int in a prototype. 1993-07-30 05:22:12 +00:00
Ian Lance Taylor
ab4d34cd91 * expr.c (operand): Make return value simply depend on contents of
returned expression.
1993-07-30 05:06:58 +00:00
David D. Zuhn
0ccc65ec79 fix ANSI decl conflicts 1993-07-30 01:40:25 +00:00
Ian Lance Taylor
7fe1797032 * config/tc-m68k.c (m68k_ip): If we have a normal constant when we
expect a bignum, turn it into a bignum.  Output extra zeroes
	before a short bignum, rather than after.
1993-07-28 15:36:45 +00:00
Ken Raeburn
0c2734c384 symbols.c: Use DEBUG_SYMS instead of DEBUG. 1993-07-27 19:58:39 +00:00
Ian Lance Taylor
e9f108bcba mips_optimize is also affected by -g. 1993-07-27 18:36:19 +00:00
Ian Lance Taylor
4e95866e2c * config/tc-mips.c (mips_optimize): New static variable.
(append_insn): If ! mips_optimize, don't swap branches.
	(md_parse_option): If -Ox, set mips_optimize accordingly.
1993-07-27 15:55:35 +00:00
Ian Lance Taylor
4fe45d2254 * config/tc-mips.c (mips_optimize): New static variable.
(append_insn): If ! mips_optimize, don't swap branches.
	(md_parse_option): If -Ox, set mips_optimize accordingly.
1993-07-27 15:47:11 +00:00
K. Richard Pixley
de9310b92b * Makefile.in (clean): if testsuite does not exist, then skip it. 1993-07-27 01:05:23 +00:00
Ian Lance Taylor
283dba4ba3 Fix stupid bugs inserted during expression conversion. 1993-07-23 19:17:12 +00:00
Ken Raeburn
7767e7e9c8 obj-elf.c, tc-sparc.c, symbols.c changes 1993-07-23 17:18:20 +00:00
Ian Lance Taylor
2a2d3d08d6 * write.c (fix_new_exp): Handle a O_uminus expression. 1993-07-23 03:32:57 +00:00
Ian Lance Taylor
e979ea0409 * expr.c (expr): Don't let absolute_section override
undefined_section for the return value.
1993-07-23 03:02:17 +00:00
Ian Lance Taylor
cf897ce253 * read.c (read_a_source_file): In NO_PSEUDO_DOT case, if we find a
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.
1993-07-23 02:55:25 +00:00
Ian Lance Taylor
88b457e59a * config/tc-h8500.c (md_begin): Use a local variable when
initializing md_relax_table to avoid warnings about modifying a
	supposedly const data structure.
1993-07-22 19:11:48 +00:00
Ian Lance Taylor
c2ac84cbbc Fixed typos. 1993-07-22 18:02:01 +00:00
Brendan Kehoe
88e124608b * config/obj-aout.c: Only include aout/aout64.h if BFD_ASSEMBLER
is defined.
1993-07-22 18:00:17 +00:00
Ian Lance Taylor
7a0405b989 Don't use #ifdef inside macro arguments. 1993-07-22 04:44:54 +00:00
Fred Fish
86a6ada2fd * configure.in (case ${host}): Map *-*-sysv4* to gas_host=sysv.
* 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.
1993-07-22 00:43:13 +00:00
Ian Lance Taylor
2c5c299f93 * config/obj-aout.c: Include aout/aout64.h.
(obj_aout_frob_symbol): Set BSF_DEBUGGING for a constructor
	symbol, so that BFD doesn't tamper with the type.
1993-07-21 19:26:20 +00:00
Ian Lance Taylor
8ff6f40e74 * read.c (read_a_source_file): If NO_PSEUDO_DOT is defined, look
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.
1993-07-21 17:19:33 +00:00
Ian Lance Taylor
5ac34ac37e * Extensive changes to permit symbols to contain any expression
type and to delay the computation of the expression until the
	value is actually needed.  This permits setting symbols to values
	calculated based on object code size.  Expressions were changed to
	no longer be in a section, to stop the overloading of segment and
	expression type that previously occurred.

	* as.c (big_section, pass1_section, diff_section, absent_section):
	Removed.
	(expr_section): Added (used for dummy symbols which hold
	intermediate expression values).
	(perform_an_assembly_pass): Create expr_section, do not create the
	sections now removed.
	* as.h (segT): Removed SEG_ABSENT, SEG_PASS1, SEG_BIG, and
	SEG_DIFFERENCE.  Added SEG_EXPR.
	(SEG_NORMAL): Corresponding changes.
	* subsegs.c (seg_name, subsegs_begin): Changed accordingly.
	* write.c (write_object_file): Ditto.
	* config/obj-aout.c (seg_N_TYPE): Ditto.
	* config/obj-bout.c (seg_N_TYPE): Ditto.
	* config/obj-coff.c (seg_N_TYPE): Ditto.
	* config/obj-coffbfd.c (seg_N_TYPE): Ditto.
	* config/obj-vms.c (seg_N_TYPE): Ditto.

	* expr.h (operatorT): Moved in from expr.c, added some values.
	(expressionS): Added X_op field, removed X_seg field; renamed
	X_subtract_symbol to X_op_symbol.
	* expr.c: Extensive changes to assign expression types rather than
	sections and to simplify the parsing.
	* write.c (fix_new_internal): New static function.
	(fix_new): Removed sub_symbol argument.
	(fix_new_exp): New function, takes expression argument.
	* write.h: Prototype changes for fix_new and fix_new_exp.
	* cond.c (s_if): Changed accordingly.
	* read.c (s_lsym, pseudo_set, emit_expr, parse_bitfield_cons,
	parse_repeat_cons, get_segmented_expression,
	get_known_segmented_expression, get_absolute_expression): Ditto.
	* symbols.c (resolve_symbol_value, S_GET_VALUE, S_SET_VALUE):
	Ditto.
	* write.c (write_object_file): Ditto.
	* config/obj-coff.c (obj_coff_def, obj_coff_val): Ditto.
	* config/obj-coffbfd.c (obj_coff_def, obj_coff_val,
	obj_coff_endef, yank_symbols): Ditto.
	* config/obj-elf.c (obj_elf_stab_generic, obj_elf_size): Ditto.
	* config/tc-a29k.c (md_assemble, parse_operand, machine_ip,
	print_insn, md_operand): Ditto.
	* config/tc-h8300.c (parse_exp, colonmod24, check_operand,
	do_a_fix_imm, build_bytes): Ditto.
	* config/tc-h8500.c (parse_exp, skip_colonthing, parse_reglist,
	get_specific, check, insert, md_convert_frag): Ditto.
	* config/tc-hppa.c (the_insn, fix_new_hppa, cons_fix_new_hppa,
	md_assemble, pa_ip, getExpression, getAbsoluteExpression,
	evaluateAbsolute, pa_build_unwind_subspace, pa_entry,
	process_exit): Ditto.
	* config/tc-hppa.h (STAB_FIXUP, is_DP_relative, is_PC_relative,
	is_complex): Ditto.
	* config/tc-i386.c (pe, md_assemble, i386_operand,
	md_estimate_size_before_relax, md_create_long_jump): Ditto.
	* config/tc-i860.c (md_assemble, getExpression, print_insn):
	Ditto.
	* config/tc-i960.c (parse_expr, subs, segs, md_convert_frag,
	get_cdisp, mem_fmt, parse_ldconst, relax_cobr, s_sysproc,
	i960_handle_align): Ditto.
	* config/tc-m68k.c (struct m68k_exp, struct m68k_it, seg, op,
	subs, add_fix, isvar, m68k_ip, md_assemble, md_convert_frag_1,
	md_estimate_size_before_relax, md_create_long_jump, get_num):
	Ditto.
	* config/tc-m88k.c (md_assemble, get_imm16, get_pcr,
	md_create_short_jump, md_create_long_jump): Ditto.
	* config/tc-mips.c (md_assemble, append_insn, gp_reference,
	macro_build, macro, my_getExpression): Ditto.  Also removed
	get_optional_absolute_expression; just use get_absolute_expression
	instead.
	* config/tc-ns32k.c (get_addr_mode, evaluate_expr, convert_iif,
	fix_new_ns32k, fix_new_ns32k_exp, cons_fix_new_ns32k): Ditto.
	* config/tc-ns32k.h (fix_new_ns32k prototype): Ditto.
	* config/tc-sh.c (parse_exp, check, insert, md_convert_frag):
	Ditto.
	* config/tc-sparc.c (md_assemble, sparc_ip, getExpression,
	print_insn): Ditto.
	* config/tc-tahoe.c (struct top, md_estimate_size_before_relax,
	tip_op, md_assemble): Ditto.
	* config/tc-vax.c (seg_of_operand, md_assemble,
	md_estimate_size_before_relax, md_create_long_jump): Ditto.
	* config/tc-z8k.c (parse_exp, check_operand, newfix): Ditto.
1993-07-21 00:41:42 +00:00
David D. Zuhn
84873870d7 add i386-lynx support 1993-07-20 19:18:13 +00:00
Ken Raeburn
623d6e9ab8 various changes 1993-07-19 20:05:41 +00:00
Ken Raeburn
8d6c34a108 (write_relocs): New function, split off from write_contents. Use memset
instead of bzero.
(write_object_file): Apply write_relocs to each section before applying
write_contents.
1993-07-19 20:05:16 +00:00
Ken Raeburn
4380166dfa (read_begin): Call obstack_begin with values closer to 1K multiples.
(read_a_source_file, big_cons, float_cons): Use memcpy instead of bcopy.
1993-07-19 20:04:25 +00:00
Ken Raeburn
9892550d29 forgot to check this in long ago... 1993-07-19 20:03:06 +00:00
Ken Raeburn
7c05f0ec40 (obj_elf_previous): New function.
(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".
1993-07-19 19:49:34 +00:00
Ian Lance Taylor
ce2ad89aca * config/tc-m68k.c (m68k_ip_op): Don't decrement strend when
calculating opP->isiz; this permits the expression size to be
	determined as well, later on.

Fixes PR 2911.
1993-07-19 19:13:30 +00:00
Ian Lance Taylor
ffffc8fb5c * expr.c (clean_up_expression): Don't cancel the subtraction of
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.
1993-07-19 18:46:39 +00:00
Ken Raeburn
9d4dfbf379 fix net-equip pr 2975: tm-m68k.c(m68k_ip): adjust for pc-rel offset before using value, not after 1993-07-19 16:49:01 +00:00
Ian Lance Taylor
becfe05e61 * config/tc-hppa.h (tc_frob_label): Define.
* 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.
1993-07-16 16:26:41 +00:00
Ian Lance Taylor
1e9cf56586 * read.c (float_cons): Simplified parsing logic. If
REPEAT_CONS_EXPRESSIONS is defined, accept a repeat count.

	* symbols.c (colon): Rather than a special case for TC_HPPA,
	use new macro tc_frob_label.
1993-07-16 16:26:03 +00:00
Ian Lance Taylor
04acd059ee * config/obj-ecoff.c (ecoff_build_symbols, ecoff_build_procs,
ecoff_frob_files): Consistently use S_GET_VALUE rather than
	bfd_asymbol_value.  Warn if taking difference of symbols in
	different segments.
1993-07-16 15:58:08 +00:00
Ian Lance Taylor
cb441b387e * config/tc-m88k.c (omagic): Removed unused variable. 1993-07-15 22:16:39 +00:00
Ian Lance Taylor
5276e361db * config/obj-ecoff.c (ecoff_frob_file): Discard all open scopes,
with a warning.
1993-07-15 22:01:27 +00:00
Ian Lance Taylor
2368ec638a * config/obj-coffbfd.c (fixup_segment): If TC_M88K, don't adjust
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.
1993-07-15 20:23:43 +00:00
Ian Lance Taylor
77a401e2e0 Add m88k-coff target Makefile fragment. 1993-07-15 16:35:23 +00:00
Ian Lance Taylor
c978e704a9 * Preliminary support for m88k-coff.
* 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.
1993-07-15 16:02:21 +00:00
Ian Lance Taylor
5868b1fe68 * Removed sy_forward and replaced it with an undefined expression
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.
1993-07-14 22:21:25 +00:00
Ian Lance Taylor
85051959f4 * Changes to keep a full expression as the value of a symbol, not
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.
1993-07-14 19:35:45 +00:00
David Edelsohn
18464ca231 * configure.in: Make sparc64-*-aout* use bfd gas. 1993-07-14 16:38:53 +00:00
David Edelsohn
b50401c93c * configure.in: Recognize h8300h. 1993-07-14 16:37:27 +00:00
David Edelsohn
07ef2075f5 Recognize h8300h.
Make sparc64-*-aout* use bfd gas.
1993-07-14 16:35:04 +00:00
Steve Chamberlain
1728686e66 cvs core dumps again... 1993-07-13 19:13:18 +00:00
Steve Chamberlain
489a93f3c3 * config/tc-h8500.c (line_comment_chars): Add hash.
(parse_exp, skip_colonthing, build_bytes): Add support for
	R_H8500_HIGH16 relocation type.
1993-07-13 19:12:10 +00:00
Mark Eichin
025b030243 fix definitions of md_create_long_jump, md_create_short_jump,
md_number_to_chars, and md_section_align to correctly use valueT and addressT
1993-07-12 19:42:32 +00:00
Mark Eichin
c463189d53 update use of valueT and addressT 1993-07-12 18:58:50 +00:00
Ken Raeburn
5d4ef2968b config/obj-elf.c (obj_elf_section): Allow `@' to introduce an attribute name.
Handle `execinstr' attribute.
1993-07-12 15:17:10 +00:00
Ian Lance Taylor
99c24539c5 * config/tc-mips.c (mips_ip): Don't warn on 'i' or 'j' mismatch if
there is another alternative for the instruction.
1993-07-12 14:24:20 +00:00
Roland Pesch
ec1c752b34 doc/as.texinfo 1993-07-10 00:32:18 +00:00
Roland Pesch
8d8ddccbe0 Updates for Hitachi H8/300H 1993-07-10 00:31:03 +00:00
Ian Lance Taylor
332fc09ff0 Clean up some of the obvious m88k bitrot.
It still doesn't actually compile, though.
1993-07-09 18:31:36 +00:00
David D. Zuhn
00a737d37c put CROSS definition into the Makefile 1993-07-08 19:19:31 +00:00
Ken Raeburn
b25654337a Oops, not all of the tc-sparc.c change was format-independent.
Still handles both syntaxes independent of format.
1993-07-08 19:09:19 +00:00
Mark Eichin
d358969d94 changelog for tc-i960 change 1993-07-08 18:50:43 +00:00
Mark Eichin
c47d388b75 Thu Jul 8 14:41:43 1993 Mark Eichin (eichin@cygnus.com)
* config/tc-i960.c (md_create_short_jump, md_create_long_jump,
	md_number_to_chars, md_section_align): Adjusted to use valueT,
	addressT, to match tc.h.
1993-07-08 18:44:32 +00:00
Ken Raeburn
ff4cac3854 config/tc-sparc.c (s_common): Revamp to handle both syntaxes, and not be
target-specific.
1993-07-08 18:40:50 +00:00
David Edelsohn
422069965b config/tc-h8300.h (TC_CONS_RELOC): Use R_RELLONG if h8/300h. 1993-07-08 14:26:17 +00:00
David D. Zuhn
8f4b91429e define CROSS is cross compilation 1993-07-08 03:15:36 +00:00
David D. Zuhn
e9baeb4606 define CROSS is cross compilation 1993-07-08 02:55:22 +00:00
Ian Lance Taylor
e154ecf4ab * symbols.c (fb_label_instance, fb_label_instance_inc): Don't dump
core just because somebody uses a label before it is defined.
1993-07-07 20:07:12 +00:00
Ian Lance Taylor
4e2e8744c5 This file was not removed last time. Why?? 1993-07-07 17:29:12 +00:00
Ian Lance Taylor
918692a5cc * config/mips-opcode.h: Moved to opcode/mips.h.
* 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.
1993-07-07 17:23:39 +00:00
Ian Lance Taylor
76c64db09f Various entries. 1993-07-07 17:22:56 +00:00
Ken Raeburn
e28e0b95ed Typedef changes. V9 work. 1993-07-07 17:16:02 +00:00
Ken Raeburn
125f0b0d84 (sparc_ip): Initialize `len' variable to make gcc shut up.
(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.
1993-07-07 16:58:29 +00:00
Ken Raeburn
3c8df4ba76 (md_create_short_jump, md_create_long_jump,
md_number_to_chars, md_section_align): Adjusted for new interface.
1993-07-07 16:56:24 +00:00
Ken Raeburn
6e3785155d Change various calls (e.g., to symbol_new, md_number_to_chars) to cast
valueT or addressT arguments to correct types.
1993-07-07 16:40:30 +00:00
Ken Raeburn
039d8f7350 (struct fix): Fields fx_offset and fx_addnumber are now type valueT.
(fix_new): Argument offset is now type offsetT.
1993-07-07 16:39:13 +00:00
Ken Raeburn
d536474829 (write_object_file): Locals from_addr, to_addr, table_addr are now addressT.
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.
1993-07-07 16:33:38 +00:00
Ken Raeburn
2b68b820a9 * symbols.c (symbol_new): Symbol value is type valueT.
(S_SET_VALUE, S_GET_VALUE): Likewise.
(S_IS_*): Specify int return type explicitly.
* symbols.h (symbol_new, S_GET_VALUE, S_SET_VALUE): Fixed prototypes.
1993-07-07 16:25:37 +00:00
Ken Raeburn
bd4d4b8aca (obj_elf_frob_symbol, elf_frob_file, elf_file_symbol): Declare.
(elf_symbol): For sparc v9, use 64-bit symbol type.
1993-07-07 16:22:12 +00:00
Ken Raeburn
dee576a0a7 clean v9 from obj-elf.h 1993-07-07 16:19:59 +00:00
Ken Raeburn
25c09bbf44 Define ENV64 for sparc v9. 1993-07-07 16:17:29 +00:00