Commit Graph

68 Commits

Author SHA1 Message Date
Stan Shebs
41b5ef0f76 Sat Feb 5 12:30:32 1994 Stan Shebs (shebs@andros.cygnus.com)
* config/obj-coffbfd.c (obj_coff_init_stab_section): Zero the
	initial stab symbol after allocating it.
	* config/obj-elf.c (obj_elf_init_stab_section): Ditto.

This fixes a critical bug observed in Q4 for Lynx.
1994-02-05 21:45:51 +00:00
Ian Lance Taylor
96a8876071 * config/obj-coffbfd.c (symbol_to_chars): bfd_coff_swap_aux_out
now takes more arguments.
1994-02-01 17:18:42 +00:00
Ken Raeburn
98c6bbbe43 * as.h: If __GNUC__ and inline are both undefined, define inline away.
* write.c (cvt_frag_to_fill): Don't assume that fr_var for rs_align or rs_org
frags will be 1.
(relax_segment): For rs_align, if fr_var is not 1, complain if
required padding is not a multiple of the size of the pad pattern.
(fixup_segment): Leave gp-relative relocations alone.  For pcrel relocations
referring to the same segment, clear fx_pcrel when clearing fx_addsy.
* as.h: Adjust comments on rs_align.

* write.c, config/obj-{aout,bout,coff*}.c, config/tc-sparc.c: Query the fx_done
field instead of fx_addsy to see if the fixup still needs to be applied.  Set
fx_done and clear fx_addsy both, for now.  If TC_HANDLES_FX_DONE isn't defined,
assume md_apply_fix will only clear fx_addsy, and set fx_done accordingly after
returning.
* config/tc-sparc.h (TC_HANDLES_FX_DONE): Define.

* config/obj-coff.c (dot_text_symbol, dot_data_symbol, dot_bss_symbol): Defined
here, static.

* config/obj-aout.c [BFD_ASSEMBLER]: Undef NO_RELOC before including aout/aout64.h.

* write.c (write_object_file): If EMIT_SECTION_SYMBOLS is false, don't write
out a section symbol even if it's used in a relocation; assume relocations will
handle section numbers somehow.  Rename "punt_it" label to "punt_it_if_unused"
to reflect it's true use.
(EMIT_SECTION_SYMBOLS): Default to 1.
(adjust_reloc_syms): Don't create a new symbol for an absolute
reference; just use the absolute section symbol.
(write_relocs): Make printout of reloc values dependent on flag DEBUG3, not
DEBUG2.
* config/obj-aout.h (EMIT_SECTION_SYMBOLS): Define as 0.
* config/obj-ecoff.h (EMIT_SECTION_SYMBOLS): Ditto.
1994-01-28 01:21:53 +00:00
Steve Chamberlain
ec0bcbbaa1 * config/obj-coffbfd.c (obj_coff_endef): For C_EFCN, C_BLOCK and
C_FCN assume .val has been set to .
1994-01-19 00:16:03 +00:00
Steve Chamberlain
03a372ed70 * config/obj-coffbfd.c (fill_section): Don't ever fill past the
end of a section. (write_object_file): Temporary fix - setup
	stdoutput.
1994-01-07 17:42:34 +00:00
Ken Raeburn
c999fd9fc2 * config/tc-vax.c (tc_aout_fix_to_chars): Local variable NBYTES_R_LENGTH now
const.

* config/obj-*.c, config/tc-*.c: Omit superfluous "return" statements at ends
of functions.  Don't check for null return from hash_new, since it won't return
at all if there's no memory available.  Also, check for null return from
hash_insert, rather than zero-length string, as success indicator.
1993-12-16 21:31:22 +00:00
Ian Lance Taylor
e0209756f8 * config/obj-coffbfd.c: Use PARAMS rather than EXFUN.
(yank_symbols): Don't call S_SET_EXTERNAL if the storage class is
	already set.  Fixes .def var; .val external_var; .scl 3; .endef.
	(adjust_stab_section): Make static.  Declare return type.  Remove
	unused variables.

	* config/tc-i386.h: Declare tc_coff_fix2rtype and
	tc_coff_sizemachdep.
1993-11-19 21:37:50 +00:00
Ian Lance Taylor
ca16b5e55a * write.h (fixS): Rename fx_callj field to fx_tcbit.
* write.c, config/obj-coff.c, config/obj-coffbfd.c,
	config/tc-i960.c: Corresponding changes.
1993-11-10 22:06:06 +00:00
Jeff Law
b89b288031 * config/obj-coffbfd.c (obj_coff_init_stab_section): Append "str"
to stab section name to get the stab string section name.  Pass
        the full name of the stab string section to get_stab_string_offset.
        * config/obj-elf.c (obj_elf_init_stab_section): Likewise.
1993-10-30 07:15:46 +00:00
Ian Lance Taylor
8efed14f10 * input-scrub.c (physical_input_file, logical_input_file,
physical_input_line, logical_input_line): Made static.
	(as_where): Return current file name and line number, don't print
	them out.
	* messages.c (as_show_where): New static function.  Other
	functions use it instead of as_where.
	(as_bad_internal): New static function.
	(as_bad): Use as_bad_internal.
	(as_bad_where): New function, like as_bad but taking a file name
	and line number.
	* as.h (as_bad_where): Declare.
	(as_where): Change prototype for new arguments.
	* write.h (fixS): Added fields fx_file and fx_line.
	* write.c (fix_new_internal): Save file and line number in fix.
	(fixup_segment): Use as_bad_where, not as_bad.
	* input-file.c (f_in, file_name): Made static.
	* cond.c (struct file_line): Just use file and line fields.
	(s_else): Use as_where and as_bad_where, not get_file_line and
	set_file_line.
	(get_file_line, set_file_line): Removed.
	* listing.c (listing_newline): Use as_where.
	* config/obj-coffbfd.c (obj_coff_init_stab_section): Use as_where.
	* config/obj-ecoff.c (add_file): Use as_where.
	* config/obj-elf.c (obj_elf_init_stab_section): Use as_where.
	* config/tc-m68k.c (md_apply_fix_2): Use as_bad_where.
	* config/tc-mips.c (tc_gen_reloc): Use as_bad_where, not assert.
1993-10-22 19:15:20 +00:00
Ken Raeburn
56f61233b2 * config/obj-coffbfd.c (fixup_segment) [DIFF_EXPR_OK]: If
sub_symbolP is in the current segment, convert to a PC-relative
	fixup and discard the symbol.
(Copied from write.c.)
1993-10-13 20:54:03 +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
eae7e03cac relax_align is now static 1993-09-23 17:20:29 +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
Stan Shebs
4064305ec0 Changes to support stabs-in-coff 1993-09-07 17:39:56 +00:00
K. Richard Pixley
56607c4e13 add an alias for data section type 1993-09-01 19:20:54 +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
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
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
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
Steve Chamberlain
115147fbb0 * config/obj-coffbfd.c (fill_section): Don't allow fills backwards.
* config/tc-sh (get_specific, md_convert_frag,
	md_estimate_size_before_relax): Add support for rest of opcodes.
1993-06-17 21:58:28 +00:00
Steve Chamberlain
ad86fa7047 * config/h8300.c: Support for H8/300-H opcodes.
* config/obj-coffbfd.c (w_strings): String table length is 4
	bytes, no matter what the host int size is.
1993-06-04 23:03:00 +00:00
Ian Lance Taylor
9a7d824a26 * app.c (do_scrub_begin): Let line_comment_chars override
comment_chars.
	(do_scrub_next_char): If a line comment character is not at the
	start of a line, treat it as a comment character if it is one.
	For a CPP line comment use pseudo-op .appline rather than .line.
	* input-scrub.c (logical_input_line): Make int rather than
	unsigned.
	(input_scrub_push, input_scrub_begin): Initialize
	logical_input_line to -1 rather than 0.
	(bump_line_counters): Increment logical_input_line.
	(new_logical_line): If line_number is -2, decrement
	logical_input_line.
	(as_where): Use logical_input_line even if it is 0.
	* read.h (s_app_file prototype): Now takes an int argument.
	* read.c (potable): Make .appfile call s_app_file with 1.  New
	.appline pseudo-op calls s_app_line.
	(s_app_file): If .appfile, call new_logical_line with -2 to
	account for newline inserted by do_scrub_next_char.  If listing,
	call listing_source_file.
	(s_app_line): New function to handle fake pseudo-op .appline.
	* config/obj-coff.c (obj_pseudo_table): Make .appline call
	obj_coff_ln.
	(obj_coff_ln): Added argument to indicate whether .appline.
	* config/obj-coffbfd.c (obj_pseudo_table): Make .appline call
	obj_coff_ln.
	(obj_coff_ln): Added argument to indicate whether .appline.
	* config/tc-mips.c (s_file): Pass argument to s_app_file.
1993-05-27 19:29:38 +00:00
Ken Raeburn
b27caf27c8 PR fix for debug symbols referring to other symbols, then same name defined
as common.
(crawl_symbols): Don't clear sy_forward field.
(yank_symbols): Merge symbols only if sy_forward is null.
1993-05-05 20:32:12 +00:00
Steve Chamberlain
4a1bbbe75b Support for Hitachi SH 1993-04-27 01:32:09 +00:00
Ken Raeburn
c0f1bbb6d0 build file symbol fwd pointers properly, don't deref symbol #s as pointers 1993-03-30 15:22:27 +00:00
Steve Chamberlain
e02eaa5943 * config/obj-coffbfd.c (do_relocs_for): Fix bug where nrelocs
wasn't being stored into scnhdr.
	* config/obj-coffbfd.h: Add prototype of s_get_segment.
	* read.c (TC_START_LABEL): Default definition.
	(read_a_source_file): Use TC_START_LABEL macro to work out
	if a label has been seen.
1993-03-29 21:56:49 +00:00
Ian Lance Taylor
543d88e4fd * config/obj-coffbfd.c (fill_section): Don't set NOLOAD bit for
a29k .bss section; the mondfe program doesn't like it.
1993-03-29 20:58:34 +00:00
Ian Lance Taylor
61001d969d * config/obj-coffbfd.c (do_relocs_for): Remove a29k special case.
(fixup_segment): Add a29k special case; the linker is not prepared
	to see a segment offset here.
1993-03-25 22:09:27 +00:00
Ken Raeburn
155e7bc479 (do_relocs_for): Don't allocate storage or process relocs if there aren't any
relocs to process.  Avoids malloc/free bug on SCO too.
1993-03-23 13:34:55 +00:00
Ian Lance Taylor
a36f6645fb * config/obj-coffbfd.c (obj_coff_endef): Correct test for .bf
symbol.
1993-03-15 20:21:13 +00:00
Ken Raeburn
2492e118e3 SUB_SEGMENT_ALIGN now takes an argument. 1993-03-03 19:47:15 +00:00
Ian Lance Taylor
e63164f988 Thu Feb 11 09:20:37 1993 Ian Lance Taylor (ian@cygnus.com)
* config/obj-coffbfd.c (fill_section): Don't set vaddr here.
	(write_object_file): Set it here instead, so that fixup_segment
	can see the correct value.
1993-02-11 17:22:42 +00:00
Steve Chamberlain
033400ec8d * config/{h8500.mt, tc-h8500.c, tc-h8500.h, obj-coffbfd.c,
obj-coffbfd.h}: support for the H8/500
1993-02-04 20:47:48 +00:00
Ken Raeburn
eeeaa7780b whitespace/comment changes 1993-01-20 22:22:21 +00:00
Ian Lance Taylor
9a75dc1f76 A bunch of changes to COFF support. See the ChangeLog. 1992-12-30 21:39:51 +00:00
Steve Chamberlain
2cb0bdc75b lints 1992-12-15 22:49:55 +00:00
Ian Lance Taylor
016e0d4207 Sat Dec 12 15:26:34 1992 Ian Lance Taylor (ian@cygnus.com)
* listing.c: Call xmalloc, not malloc; don't declare malloc.

	* Changes to support SCO 3.2v4:
	* read.c (s_align_bytes, s_align_ptwo): If not SEG_DATA or
	SEG_BSS, fill with NOP_OPCODE.
	* config/i386coff.mt: Add opcode/i386.h to TARG_CPU_DEPENDENTS.
	* config/obj-coffbfd.c (do_relocs_for): Increment addr even if not
	using ZERO_BASED_SEGMENTS.
	(fill_section): If ZERO_BASED_SEGMENTS, set segment addresses, but
	never set segment address for SEG_E2 (.bss) and don't write out
	SEG_E2 contents.  Set .init and .fini sections to STYP_TEXT.
	(obj_coff_endef): Don't merge labels or symbols awaiting forward
	definitions, and don't merge tags with non-tags.  Check for .bf
	rather than just checking whether the second character is b and
	the third character is f.
	(obj_coff_val): gcc can generate values which we don't handle
	correctly; discard information for now, since it only affects the
	debugging information.
	(tag_find_or_name): Don't insert tags in the symbol table.
	(yank_symbols): Don't merge labels.
	(write_object_file): Don't define SUB_SEGMENT_ALIGN if it is
	already defined.  Fill subsegments with NOP_OPCODE, not 0.  Don't
	set segment address if ZERO_BASED_SEGMENTS.
	(obj_coff_section): Accept and ignore a trailing quoted string, as
	used in AT&T i386 syntax.
	(fixup_segment): Take segment as argument.  On the i386, adjust PC
	relative addends by the segment vaddr.
	* tc-i386.h: Define SUB_SEGMENT_ALIGN.
	* tc-a29k.h: Define ZERO_BASED_SEGMENTS.
	* tc-i386.c: (i386_operand): If I386COFF, accept any segment type.
1992-12-13 00:56:14 +00:00
Ken Raeburn
30d9fb5730 obj-coffbfd.c: include libcoff.h 1992-12-08 08:48:16 +00:00
Ken Raeburn
355afbcd8b Ran "indent", for GNU coding style; some code & comments still need fixup.
Removed some unneeded files.

obj-coff.c (obj_coff_endef): Use as_warn, not fprintf.
tc-m68k.c (md_assemble): 68000+68881 is okay -- could be emulating.
1992-11-23 20:42:33 +00:00
Ian Lance Taylor
587c4264e0 These changes clean things up a bit, and improve Solaris cross
support when using /opt/SUNWspro/SC2.0/acc.

Tue Nov 10 09:50:25 1992  Ian Lance Taylor  (ian@cygnus.com)

	* obj-coffbfd.c (fill_section): set STYP_NOLOAD bit for .bss
	section.

	* atof-ieee.c, atof-ns32k.c, tc-*.c: made EXP_CHARS, FLT_CHARS,
	comment_chars, line_comment_chars and line_seperator_chars
	consistently const, and always initialized them.  Included read.h.
1992-11-10 18:17:00 +00:00
Ian Lance Taylor
1045c20b4d Fri Oct 23 14:40:38 1992 Ian Lance Taylor (ian@cygnus.com)
* obj-coffbfd.c (write_object_file): check return value of
	bfd_close_all_done.
1992-10-23 21:42:04 +00:00
Ian Lance Taylor
6142210d1d Tue Oct 20 13:02:25 1992 Ian Lance Taylor (ian@cygnus.com)
* Support for i386-sysv.
	obj-coffbfd.c (do_relocs_for, write_object_file): set segment
	addresses to reasonable sizes.  New define ZERO_BASED_SEGMENTS can
	be used to set them all to zero as was done before.
	(fill_section): segment addresses now set in write_object_file.
	(fill_section): Don't set STYP_NOLOAD for .bss section.
	(fixup_segment): 386 uses strange common symbol format.
	tc-i386.c (tc_coff_fix2rtype): use R_DIR32, not R_RELLONG, for
	compatibility with SVR3.2 linker.
1992-10-20 20:10:34 +00:00
Steve Chamberlain
2f68cb548c * obj-coffbfd.c (write_object_file): don't fixup for the z8k
* tc-z8k.[ch]: lots of bug fixes
1992-09-29 19:25:33 +00:00
Sean Eric Fagan
b066f445bb Tue Sep 22 13:02:07 1992 Sean Eric Fagan (sef@cygnus.com)
* obj-coffbfd.c (do_relocs_for,fill_section): now allocate all
	sections starting from zero, rather than making them consecutive.
	This makes subsequent reloc calculations easier, esp if the
	object format doesn't understand addends. (obj_coff_lcomm): (maybe
	temporarily) allocate lcomm in .data rather than in .bss.  It
	seems that some tools can't cope with a non-zero sized bss
	before linkage.
1992-09-22 20:07:55 +00:00