Commit Graph

24 Commits

Author SHA1 Message Date
Hans-Peter Nilsson 5110c57e8e * obj.h (struct format_ops): New members begin, app_file,
s_set_other, s_set_desc, s_get_type, s_set_type,
	separate_stab_sections, init_stab_section.

	* config/obj-multi.h: Update GPL notice to v2.
	(obj_begin): New.
	(obj_app_file): New.
	(S_SET_SIZE): Test s_set_size for NULL before calling.
	(S_SET_ALIGN): Similar for s_set_align.
	(S_SET_OTHER): New.
	(S_SET_DESC): New.
	(S_GET_TYPE): New.
	(S_SET_TYPE): New.
	(SEPARATE_STAB_SECTIONS): New.
	(INIT_STAB_SECTION): New.
	(EMIT_SECTION_SYMBOLS): New.
	(AOUT_STABS) [OBJ_MAYBE_AOUT]: Define.

	* config/obj-elf.h: Update GPL notice to v2.
	Mention that this file is included from obj-multi.h.
	(obj_begin): Wrap definition in ifndef.
	(elf_file_symbol): Constify declaration.
	(obj_app_file): Ditto.
	(SEPARATE_STAB_SECTIONS, INIT_STAB_SECTION, OBJ_PROCESS_STAB):
	Wrap in ifndef SEPARATE_STAB_SECTIONS.

	* config/obj-elf.c (elf_s_set_other): New.
	(elf_file_symbol): Constify argument.
	(elf_separate_stab_sections): New.
	(elf_init_stab_section): New.
	(elf_format_ops): Add new members.  Remove comma at end.

	* config/obj-ecoff.c (ecoff_separate_stab_sections): New.
	(ecoff_format_ops): Add new fields.  Remove comma at end.
	Mention inconsistency for emit_section_symbols.

	* config/obj-coff.h (c_dot_file_symbol): Constify declaration.

	* config/obj-coff.c (c_dot_file_symbol): Constify argument.
	(coff_separate_stab_sections): New.
	(coff_format_ops): Add new members.

	* config/obj-aout.c (obj_aout_sec_sym_ok_for_reloc): New.
	(obj_aout_s_set_other): New.
	(obj_aout_s_set_desc): New.
	(obj_aout_s_get_type): New.
	(obj_aout_s_set_type): New.
	(obj_aout_separate_stab_sections): New.
	(aout_format_ops): New members added.  Use obj_aout_process_stab,
	not 0.  Use obj_aout_sec_sym_ok_for_reloc, not 0.
	(obj_aout_frob_symbol): Add ATTRIBUTE_UNUSED to args as
	appropriate.
	(obj_aout_line, obj_aout_weak, obj_aout_type): Ditto.
2000-05-22 21:19:43 +00:00
Clinton Popetz 7f6d05e83e Add XCOFF64 support.
bfd:
	* Makefile.am (coff64-rs6000.lo): New rule.
	* Makefile.in: Regenerate.
	* coff-rs6000.c (xcoff_mkobject, xcoff_copy_private_bfd_data,
	xcoff_is_local_label_name, xcoff_rtype2howto,
	xcoff_reloc_type_lookup, xcoff_slurp_armap, xcoff_archive_p,
	xcoff_read_ar_hdr, xcoff_openr_next_archived_file, xcoff_write_armap,
	xcoff_write_archive_contents): No longer static, and prefix with _bfd_.
	(NO_COFF_SYMBOLS): Define.
	(xcoff64_swap_sym_in, xcoff64_swap_sym_out, xcoff64_swap_aux_in,
	xcoff64_swap_aux_out): New functions; handle xcoff symbol tables
	internally.
	(MINUS_ONE): New macro.
	(xcoff_howto_tabl, xcoff_reloc_type_lookup): Add 64 bit POS
	relocation.
	(coff_SWAP_sym_in, coff_SWAP_sym_out, coff_SWAP_aux_in,
	coff_SWAP_aux_out): Map to the new functions.
	* coff64-rs6000.c: New file.
	* libcoff.h (bfd_coff_backend_data): Add new fields
	_bfd_coff_force_symnames_in_strings and
	_bfd_coff_debug_string_prefix_length.
	(bfd_coff_force_symnames_in_strings,
	bfd_coff_debug_string_prefix_length): New macros for above fields.
	* coffcode.h (coff_set_arch_mach_hook): Handle XCOFF64 magic.
	Set machine to 620 for XCOFF64.  Use bfd_coff_swap_sym_in instead
	of using coff_swap_sym_in directly.
	(FORCE_SYMNAMES_IN_STRINGS): New macro, defined for XCOFF64.
	(coff_set_flags) Set magic for XCOFF64.
	(coff_compute_section_file_positions): Add symbol name length to
	string section length if bfd_coff_debug_string_prefix_length is
	true.
	(coff_write_object_contents): Don't do reloc overflow for XCOFF64.
	(coff_slurp_line_table): Use bfd_coff_swap_lineno_in instead of
	using coff_swap_lineno_in directly.
	(bfd_coff_backend_data): Add _bfd_coff_force_symnames_in_strings
	and _bfd_coff_debug_string_prefix_length fields.
	* coffgen.c (coff_fix_symbol_name, coff_write_symbols): Force
	symbol names into strings table when
	bfd_coff_force_symnames_in_strings is true.
	* coffswap.h (MAX_SCNHDR_NRELOC, MAX_SCNHDR_NLNNO, GET_RELOC_VADDR,
	SET_RELOC_VADDR): New macros.
	(coff_swap_reloc_in, coff_swap_reloc_out): Use above macros.
	(coff_swap_aux_in, coff_swap_aux_out): Remove RS6000COFF_C
	code.
	(coff_swap_aouthdr_in, coff_swap_aouthdr_out): Handle XCOFF64
	changes within RS6000COFF_C specific code.
	(coff_swap_scnhdr_out): Use PUT_SCNHDR_NLNNO, PUT_SCNHDR_NRELOC,
	MAX_SCNHDR_NRELOC, and MAX_SCNHDR_NLNNO.
	* reloc.c (bfd_perform_relocation, bfd_install_relocation):
	Extend existing hack on target name.
	* xcofflink.c (XCOFF_XVECP): Extend existing hack on
	target name.
	* coff-tic54x.c (ticof): Keep up to date with new fields
	in bfd_coff_backend_data.
	* config.bfd: Add bfd_powerpc_64_arch to targ_arch and define
	targ_selvecs to include rs6000coff64_vec for rs6000.
	* configure.in: Add rs6000coff64_vec case.
 	* cpu-powerpc.c: New bfd_arch_info_type.

	gas:
	* as.c (parse_args): Allow md_parse_option to override -a listing
	option.
	* config/obj-coff.c (add_lineno): Change type of offset parameter
	from "int" to "bfd_vma."
	* config/tc-ppc.c (md_pseudo_table): Add "llong" and "machine."
	(ppc_mach, ppc_subseg_align, ppc_target_format): New.
	(ppc_change_csect): Align correctly for XCOFF64.
	(ppc_machine): New function, which discards "ppc_machine" line.
	(ppc_tc): Cons for 8 when code is 64 bit.
	(md_apply_fix3): Don't check operand->insert.  Handle 64 bit
	relocations.
	(md_parse_option): Handle -a64 and -a32.
	(ppc_xcoff64): New.
	* config/tc-ppc.h (TARGET_MACH): Define.
	(TARGET_FORMAT): Move to function.
	(SUB_SEGMENT_ALIGN): Use ppc_subseg_align.

	include:
	* include/coff/rs6k64.h: New file.

	opcodes:
	* configure.in: Add bfd_powerpc_64_arch.
	* disassemble.c (disassembler): Use print_insn_big_powerpc for
	64 bit code.
2000-04-26 15:09:44 +00:00
Ian Lance Taylor b985eaa839 2000-02-22 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* config/obj-coff.c (add_lineno): Accept non-positive lineno with
	warning, and bump it to 1.
2000-02-22 07:50:13 +00:00
Timothy Wall bea9907b2a octets vs bytes changes for GAS 2000-02-03 18:20:23 +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
Ian Lance Taylor 945a1a6b98 * write.c (write_relocs): Call SET_SECTION_RELOCS if it is
defined.
	* config/obj-coff.h (SET_SECTION_RELOCS): Define.
	* doc/internals.texi (Object format backend): Document
	SET_SECTION_RELOCS.
1999-09-12 03:44:42 +00:00
Ian Lance Taylor 7a6284c477 1999-09-11 Donn Terry <donn@interix.com>
* config/obj-coff.c (obj_coff_ident): Add BFD_ASSEMBLER version.
	(obj_pseudo_table): Always handle ".ident" with obj-coff_ident.
1999-09-12 03:07:49 +00:00
Ian Lance Taylor 8828d86202 1999-09-11 Donn Terry <donn@interix.com>
* config/obj-coff.c (coff_frob_symbol): Prohibit weak common
	symbols.
1999-09-12 02:59:54 +00:00
Ian Lance Taylor 9690c54dda 1999-09-11 Donn Terry <donn@interix.com>
* config/obj-coff.c (obj_coff_endef): Don't merge labels, or
	symbols which do not have a constant value, or tags with
	non-tags.  Remove the symbol from the list before adding it at the
	end.
1999-09-12 02:55:58 +00:00
Ian Lance Taylor 23dab925ad 1999-09-11 Donn Terry <donn@interix.com>
* config/obj-coff.c (obj_coff_endef) [BFD_ASSEMBLER]: Handle .ef
	C_FCN symbol differently if TE_PE.
	(obj_coff_line) [BFD_ASSEMBLER]: Always use the line number which
	appears in the pseudo-op, rather coff_line_base which is only set
	for a .bf symbol.
1999-09-12 02:49:28 +00:00
Ian Lance Taylor 28428223eb 1999-09-11 Donn Terry <donn@interix.com>
* config/obj-coff.c (obj_coff_loc): New static function.
	(obj_pseudo_table): Add "loc".
1999-09-12 02:39:52 +00:00
Ian Lance Taylor e8a3ab752d 1999-09-11 Donn Terry <donn@interix.com>
* config/obj-coff.c (add_lineno): Check that the line number is
	positive.
1999-09-12 02:34:00 +00:00
Ian Lance Taylor 0561a208f8 1999-09-11 Donn Terry <donn@interix.com>
* expr.c (expr): Change first parameter to int.
	* config/obj-coff.c: Add declarations for static functions.
	(coff_frob_symbol): Use SYM_AUXENT.
	* config/tc-i386.h (flag_16bit_code): Don't declare.
1999-09-12 02:27:58 +00:00
Ian Lance Taylor 5881e4aab3 1999-09-11 Donn Terry <donn@interix.com>
* config/obj-coff.c (obj_coff_section): Default to setting
	SEC_LOAD.  Don't set SEC_DATA for 'w' modifier.
1999-09-12 02:08:55 +00:00
Ian Lance Taylor c4bf532f53 * config/obj-coff.c: Add ATTRIBUTE_UNUSED as needed for
BFD_ASSEMBLER code.
1999-09-07 03:26:58 +00:00
Alan Modra 4ca72d3829 Enable --emulation={i386coff,i386elf} for i386 gas. 1999-09-02 15:12:01 +00:00
Ian Lance Taylor 2dcc60be2b * doc/as.texinfo (Section): Document 's' flag for COFF version.
1999-08-08  Mumit Khan  <khan@xraylith.wisc.edu>

	* config/obj-coff.c (obj_coff_section): Handle 's' (shared)
	section flag.
1999-08-08 16:53:30 +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
Ian Lance Taylor 827c01493e 1999-06-26 Mumit Khan <khan@xraylith.wisc.edu>
* config/obj-coff.c (obj_coff_section): Mark writable sections as
	data.
1999-06-26 19:35:44 +00:00
Ian Lance Taylor 809ffe0deb * config/tc-ppc.c: Update for symbol handling changes.
* config/obj-coff.c: Likewise.
1999-06-19 14:04:45 +00:00
Ian Lance Taylor b9e57a387a * subsegs.c (subseg_text_p): New function.
* as.h (subseg_text_p): Declare.
	* read.c (do_align): Use subseg_text_p to set the default fill.
	* write.c (subsegs_finish): Likewise.
	* config/obj-coff.c (write_object_file): Likewise.
	* config/tc-i386.h (md_maybe_text): Don't define.
	(md_do_align): Use subseg_text_p to set the default fill.
	* config/tc-m32r.c (m32r_do_align): Likewise.
	* config/tc-sh.c (sh_do_align): Likewise.
	* config/tc-sparc.h (md_do_align): Likewise.
1999-06-12 16:49:51 +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 ec0f0840fc *** empty log message *** 1999-05-17 03:21:49 +00:00
Richard Henderson 252b5132c7 19990502 sourceware import 1999-05-03 07:29:11 +00:00