Commit Graph

39 Commits

Author SHA1 Message Date
Ken Raeburn a2a5a4fa41 fsf address update 1995-07-06 21:18:08 +00:00
Ian Lance Taylor 3f8416d5e1 * config/obj-coff.c (obj_coff_line): Call listing_source_line, in
both BFD_ASSEMBLER and non BFD_ASSEMBLER versions of the function.
PR 7006.
1995-07-05 20:31:31 +00:00
Steve Chamberlain e5c5ce23fd Support for long filenames non-bfd coff. bfd/7288
* 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.
1995-06-30 00:53:37 +00:00
Steve Chamberlain 30355216bd * config/obj-coff.c (fixup_segment): PE doens't use
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.
1995-06-29 00:41:02 +00:00
Stan Shebs d21041b3e2 * config/obj-coff.c: Don't use "bfd/" when including libbfd.h
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.
1995-06-16 00:07:45 +00:00
Ken Raeburn 0eb1f9cefa whitespace/comment formatting 1995-03-10 22:33:28 +00:00
Ian Lance Taylor 5fc2a6ecd2 * config/obj-coff.c (coff_header_append): Check return value of
bfd_coff_swap_scnhdr_out.
1995-03-09 23:02:43 +00:00
David Edelsohn df0f11ff33 Delete this patch, it breaks the h8300 assembler.
* config/obj-coff.c (write_object_file): Don't treat h8300 and z8k
	specially with regard to fixups.
1995-03-09 21:51:42 +00:00
Ian Lance Taylor 96d1566d78 gcc -Wall lint.
* 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.
1995-01-18 17:24:48 +00:00
Ken Raeburn 460a34e851 For COFF targets, make sure F_RELFLG is set exactly when no relocs are present,
instead of making it depend solely on the target CPU.
1995-01-12 00:36:23 +00:00
Ken Raeburn 7a55f46268 * config/obj-coff.c (write_object_file): Don't treat h8300 and z8k specially
with regard to fixups.
1995-01-10 18:42:28 +00:00
Ken Raeburn aac4d5a77f * config/obj-coff.c (size_section): Handle rs_space like rs_fill, but make sure
fr_symbol is null.
(fill_section): Ditto.
1995-01-10 01:41:54 +00:00
Ken Raeburn 87e4849501 * frags.c (frag_init): Call obstack_begin on `frags'.
* 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.
1994-12-20 22:42:03 +00:00
Ken Raeburn d675782a06 * config/obj-aout.h, config/obj-coff.c, config/obj-elf.h, config/obj-som.h,
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.
1994-12-20 20:07:41 +00:00
Ken Raeburn 4325bcb990 * config/obj-coff.c (do_relocs_for): Test only TC_KEEP_FX_OFFSET, rather than
both it and TC_M88K.
(coff_adjust_section_syms): New function.
(coff_frob_section): For non-empty sections, create aux entry for the section
symbol, indicating the size.
(n_line_nos): New variable.
(add_lineno): Increment it.
(coff_add_linesym): Increment n_line_nos, don't call add_lineno.
(coff_frob_file): New function; map coff_adjust_section_syms over sections.
(obj_coff_line): Only reset line_base for .bf symbols.
* config/obj-coff.h (coff_adjust_section_syms, coff_frob_file): Declare.
(obj_frob_file): New macro.

* config/obj-coff.h (OBJ_COPY_SYMBOL_ATTRIBUTES): Renamed from
obj_frob_forward_symbol, and rewritten for new parameter list.
1994-10-07 22:02:54 +00:00
Steve Chamberlain 6613462ec3 * config/obj-coff.c (do_relocs_for): If TC_KEEP_FX_OFFSET
is defined, put the tx_offset into the r_offset.
	* config/tc-sh.c (line_comment_chars): Add #
	(tc_reloc_mangle): Deleted.
	* config/tc-sh.h (TC_KEEP_FX_OFFSET): Define.
	(TC_RELOC_MANGLE): Delete.
1994-09-13 23:53:52 +00:00
Ken Raeburn 460531dad9 Use EXIT_SUCCESS and EXIT_FAILURE in all exit calls.
Use exit rather than returning from main, for consistency on VMS.
Call as_fatal instead of as_bad or as_warn followed by exit.
1994-09-13 23:07:48 +00:00
Ian Lance Taylor 430a399719 * config/obj-coff.c (fixup_segment): After handling the difference
of two symbols from the same segment, set fx_subsy to NULL, to
	satisfy existing TC_COUNT_RELOC macros.
1994-09-13 17:06:26 +00:00
Ian Lance Taylor eb4fd16f4d * config/obj-coff.c (size_section): Do an fprintf to stderr rather
than a printf.
	(fixup_segment): Use as_bad_where rather than as_bad.
1994-09-08 23:46:00 +00:00
David MacKenzie def66e248c * as.h: Replace flagseen with separate variables.
* as.c (parse_args): Set them.  Don't accept -1 option, or -v
	explicitly (it's a synonym for --version).
	* as.c, input-scrub.c, messages.c, read.c, symbols.c, write.c,
	config/obj-aout.c, config/obj-aout.h, config/obj-bout.c,
	config/obj-bout.h, config/obj-coff.c, config/obj-coff.h,
	config/obj-vms.c, config/tc-hppa.c, config/tc-i386.c,
	config/tc-i960.c, config/tc-m68k.c, config/tc-mips.c,
	config/tc-vax.c: Use the new flag variables instead of flagseen.
	* config/tc-vax.c [OBJ_VMS]: Recognize -+, -1, -v, and document in
	usage.
1994-06-03 20:59:20 +00:00
Ken Raeburn 2283f8a02a (fixup_segment) [!BFD_ASSEMBLER] [DIFF_EXPR_OK]: Do conversion to pc-relative
for difference, even if pcrel is already set.
1994-06-02 16:18:33 +00:00
Ken Raeburn 8fb85d50cd * obj-coff.h (TARGET_FORMAT) [TC_I960]: Select little endian version.
* obj-coffbfd.h (TARGET_FORMAT) [TC_I960]: Ditto.

* obj-coff.c (coff_frob_section): Round up the size of every section to a
multiple of the alignment, so that BFD doesn't surprise us.

Eliminate many simple differences between the two COFF back ends:

* obj-coffbfd.c: Removed all uses of DEFUN and DEFUN_VOID.  Made minor
stylistic changes, deleted some register declarations.
(stack_top): Deleted.
(symbol_to_chars): Use absolute_section and reg_section instead of the
corresponding SEG_* symbols.
(obj_coff_endef, tag_find_or_make, fixup_segment): Likewise.
(stack typedef, stack_init, stack_delete, stack_push, stack_pop): Moved to just
after pseudo-op table.  All functions now static.
(stack_delete): Removed declaration.
(tag_init, tag_insert, tag_find_or_make, tag_find): Moved to just after stack
functions.
* obj-coffbfd.h: Reordered some declarations and macros.
(stack_init, stack_delete, stack_push, stack_pop): Don't declare.
(stack typedef): Deleted.
(SYMBOLS_NEED_BACKPOINTERS): Always undef then define; don't test.
(SYM_AUXENT): New macro.
(SA_GET_*, SA_SET_*): Define in terms of SYM_AUXENT when feasible.
(SF_GET_*, SF_SET_*): Define in terms of SF_GET when feasible.
(SA_GET_SYM_TAGNDX, SA_GET_SYM_ENDNDX, SA_SET_SYM_TAGNDX, SA_SET_SYM_ENDNDX,
object_headers typedef, data_section_header, text_section_header): Delete
non-BFD_HEADERS versions, since we always define that symbol now.

* obj-coff.c (stack_top): Deleted.
(obj_coff_endef, obj_coff_dim, obj_coff_line, obj_coff_size, obj_coff_scl,
obj_coff_tag, obj_coff_type, obj_coff_val): Change argument name from "ignored"
to "ignore".
(obj_coff_val): Use frag_now_fix.
(obj_pseudo_table): Removed IGNORE_DEBUG version, since it doesn't get used.
(stack typedef, stack_init, stack_delete, stack_push, stack_pop): Moved to just
after pseudo-op table.  All functions now static.
(tag_init, tag_insert, tag_find_or_make, tag_find): Moved to just after stack
functions.
* obj-coff.h: Reordered some declarations and macros.  Protected against
multiple inclusions.
(stack_init, stack_delete, stack_push, stack_pop): Don't declare.
(stack typedef): Deleted.
(SYMBOLS_NEED_BACKPOINTERS): Always undef then define; don't test.
(stdoutput): Deleted declaration.
(TARGET_FORMAT) [TC_I386]: Don't define if already defined.
1994-05-04 06:19:26 +00:00
Ken Raeburn 988238d380 * config/obj-coff.c (obj_symbol_new_hook): Don't need to strip underscores,
since symbol_new will already have done it.
* config/obj-coffbfd.c (obj_symbol_new_hook): Ditto.
1994-04-22 20:39:01 +00:00
Ken Raeburn 71b4de6fb8 * config/obj-coff.h, config/obj-coff.c: Deleted all code used only when
BFD_ASSEMBLER is not defined, and all conditionals relating to such code.  No
such targets remain.

Fixes for stabs-in-coff:
* config/obj-coff.c: Include subsegs.h.
(coff_frob_section): New function.
(obj_coff_init_stab_section): New function.
* config/obj-coff.h (obj_coff_init_stab_section, coff_frob_section): Declare.
(obj_frob_section): New macro; uses coff_frob_section.
(INIT_STAB_SECTION): New macro; uses obj_coff_init_stab_section.
1994-04-20 23:01:40 +00:00
Ken Raeburn 055a75ef75 * config/obj-coff.c: Minor formatting/stylistic changes, plus:
(obj_coff_section): Declare.
(obj_pseudo_table): Make it available only if MANY_SECTIONS.
(obj_symbol_to_chars) [CROSS_COMPILE]: Some attemps to make this work.  It
still doesn't.  It now fails to compile, instead of silently compiling to do
nothing.
* config/obj-coff.h (SEPARATE_STAB_SECTIONS): Define only if MANY_SECTIONS.
(OBJ_PROCESS_STAB) [! MANY_SECTIONS]: New macro, just emits a warning.
1994-03-09 02:42:57 +00:00
Ian Lance Taylor 257df7914d * config/obj-coff.c (dot_text_symbol, dot_data_symbol,
dot_bss_symbol): Don't define if BFD_ASSEMBLER.
	(obj_symbol_to_chars): bfd_coff_swap_aux_out now takes more
	arguments.
	(coff_line_base): Renamed from line_base.  Changed all uses.
	(coff_add_linesym): Renamed from add_line_sym.  Made non-static.
	Changed all uses.
	* config/obj-coff.h: If TC_PPC, include coff/rs6000.h.
	(S_SET_STORAGE_CLASS, S_GET_STORAGE_CLASS): Declare if
	BFD_ASSEMBLER.
	(coff_line_base): Declare.
	(coff_add_linesym): Declare if BFD_ASSEMBLER.
1994-02-01 17:17:52 +00:00
Ian Lance Taylor 1f029792a2 * config/obj-coff.c (obj_coff_section_header_append): Do not
declare if BFD_ASSEMBLER.
	(stack_pop): Correct test for stack underflow.
	(obj_coff_endef, obj_coff_dim, obj_coff_line, obj_coff_size,
	obj_coff_scl, obj_coff_tag, obj_coff_type, obj_coff_val): Declare
	type of ignored argument to avoid gcc warning.
	(align): Removed unused function.
1994-01-28 16:30:29 +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
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
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
K. Richard Pixley 6d5460ab89 changes from Minh Tran-Le <TRANLE@INTELLICORP.COM> to support i386
coff as it appears to be used on aix386.
1992-02-21 11:04:51 +00:00
K. Richard Pixley a87b326934 White space and comment changes, and #ifdef __STDC__ becomes #if
__STDC__ == 1.
1992-02-15 21:09:34 +00:00
K. Richard Pixley 1d63ba3ba0 remove all rcs keywords 1992-02-13 08:39:15 +00:00
K. Richard Pixley a39116f1c9 White space and comments only. The devo tree prior to this delta is
tagged as "vanilla" for your convenience.

There are also some comment changes.
1992-02-13 08:33:54 +00:00
Steve Chamberlain 065114de7b Make sure that 29k relocs are done right. 1991-10-21 22:57:31 +00:00
Steve Chamberlain 5757497917 * configure.in: added ebmon entry.
* output-file.c (output_file_create, output_file_close) added
	stuff to use bfd.
	* write.c: more bfd support
	* config/obj-coff.c  config/obj-coff.h use bfd for swapping
	header info.
	* tc-a29k: added the reloc types we support now.
1991-10-21 16:31:47 +00:00
K. Richard Pixley d1a9e59485 Buying into ../include and ../libiberty. 1991-05-18 02:15:32 +00:00
K. Richard Pixley fecd2382e7 Initial revision 1991-04-04 18:19:53 +00:00