Commit Graph

59 Commits

Author SHA1 Message Date
Nick Clifton 7c8ca0e488 Chnage styp_flags_to_sec_flags() to a boolean function 2001-06-15 09:03:14 +00:00
Tom Rix beb1bf64d0 Support for xcoff64 2001-05-24 20:50:50 +00:00
Jakub Jelinek 8550eb6e64 * merge.c (struct sec_merge_hash_entry): Add u.entsize and u.suffix
fields, change sec into secinfo.
	(struct sec_merge_info): Add chain, remove last fields.
	(struct sec_merge_sec_info): Add next, sec, psecinfo fields.
	(sec_merge_hash_lookup): If lookup could not use a string only
	because it has bad alignment, mark the old string for deletion.
	(sec_merge_add): Add secinfo argument. Don't compute entry's
	position, instead record the section.
	(sec_merge_emit): Update for the sec into secinfo change in
	struct sec_merge_hash_entry.
	(_bfd_merge_section): Only record the section for merging, defer
	putting strings into the hash table.
	(cmplengthentry, last4_eq, last_eq, record_section, merge_strings,
	_bfd_merge_sections): New functions.
	(_bfd_merged_section_offset): Update for the sec_merge_hash_entry
	changes.
	* libbfd-in.h (_bfd_merge_sections): Add prototype.
	(_bfd_nolink_bfd_merge_sections): Define.
	* libbfd.h: Likewise.
	(bfd_generic_merge_sections): Add prototype.
	* targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_merge_sections.
	(struct bfd_target): Likewise.
	* bfd.c (bfd_merge_sections): Define.
	* bfd-in2.h: Rebuilt.
	* elf.c (_bfd_elf_merge_sections): New function.
	* elf-bfd.h (_bfd_elf_merge_sections): Add prototype.
	* elfxx-target.h (bfd_elfNN_bfd_merge_sections): Define.
	* reloc.c (bfd_generic_merge_sections): New function.
	* vms.c (vms_bfd_merge_sections): New function.
	* aout-adobe.c (aout_32_bfd_merge_sections): Define.
	* aout-target.h (MY_bfd_merge_sections): Define.
	* aout-tic30.c (MY_bfd_merge_sections): Define.
	* binary.c (binary_bfd_merge_sections): Define.
	* bout.c (b_out_bfd_merge_sections): Define.
	* coff-alpha.c (_bfd_ecoff_bfd_merge_sections): Define.
	* coffcode.c (coff_bfd_merge_sections): Define.
	* coff-mips.c (_bfd_ecoff_bfd_merge_sections): Define.
	* i386msdos.c (msdos_bfd_merge_sections): Define.
	* i386os9k.c (os9k_bfd_merge_sections): Define.
	* ieee.c (ieee_bfd_merge_sections): Define.
	* ihex.c (ihex_bfd_merge_sections): Define.
	* nlm-target.h (nlm_bfd_merge_sections): Define.
	* oasys.c (oasys_bfd_merge_sections): Define.
	* ppcboot.c (ppcboot_bfd_merge_sections): Define.
	* som.c (som_bfd_merge_sections): Define.
	* srec.c (srec_bfd_merge_sections): Define.
	* tekhex.c (tekhex_bfd_merge_sections): Define.
	* versados.c (versados_bfd_merge_sections): Define.
	* xcoff-target.h (_bfd_xcoff_bfd_merge_sections): Define.

	* ldlang.c (lang_process): Call bfd_merge_sections.
2001-05-11 12:23:48 +00:00
DJ Delorie 3ed30d29c6 * coffcode.h (coff_write_object_contents): Use
bfd_coff_swap_filehdr_out instead of coff_swap_filehdr_out.
2001-04-15 04:23:46 +00:00
Nick Clifton 7898dedac0 Update copyright notices 2001-03-08 21:04:02 +00:00
Nick Clifton 1276aefac0 BFD: Catch & report unhandled PE section flags.
LD: Catch BFD errors whilst loading symbols and do not produce an executable.
2001-02-27 01:38:06 +00:00
Nick Clifton b7ed8fad53 formatting fix 2001-01-13 19:45:52 +00:00
Nick Clifton 23ccc829e2 Fixes to allow sources to compile under Solaris 2.8 2000-12-21 18:40:21 +00:00
Nick Clifton 51db370890 Generalize DWARF2 and COFF support. 2000-12-08 22:50:07 +00:00
Kazu Hirata e60b52c622 2000-11-28 Kazu Hirata <kazu@hxi.com>
* aoutx.h: Fix formatting.
	* bfd-in.h: Likewise.
	* bfd-in2.h: Likewise.
	* cache.c: Likewise.
	* cisco-core.c: Likewise.
	* coff64-rs6000.c: Likewise.
	* coffcode.h: Likewise.
	* coffswap.h: Likewise.
	* corefile.c: Likewise.
2000-11-28 21:42:16 +00:00
Phil Blundell d71f672e69 2000-11-27 Philip Blundell <pb@futuretv.com>
* libcoff-in.h (coff_tdata): Add `strings_written' flag.
	(obj_coff_strings_written): New accessor macro for above.
	* libcoff.h: Regenerate.
	* cofflink.c (_bfd_coff_final_link): Say that we wrote the
	strings.
	* coffcode.h (coff_write_object_contents): No need to write out
	the string table if it's already been done.
2000-11-27 12:45:17 +00:00
Nick Clifton 077b8428ab Add ARM v5t, v5te and XScale support 2000-11-25 00:21:40 +00:00
DJ Delorie 3e4554a206 * peigen.c (_bfd_pei_swap_scnhdr_out): note extended relocs
* coffcode.h (coff_set_alignment_hook): read extended reloc count
(coff_write_relocs): write extended reloc count
(coff_write_object_contents): account for extended relocs
2000-10-06 19:47:51 +00:00
Nick Clifton 371e71b8de Fix bugs detecting w65 architecture. 2000-08-22 20:11:36 +00:00
Nick Clifton a022216bd4 Minor formatting fixes. 2000-07-31 18:49:56 +00:00
Nick Clifton 60bcf0fa8c Applied Stephane Carrez <Stephane.Carrez@worldnet.fr> patches to add support
for m68hc11 and m68hc12 processors.
2000-06-19 01:22:44 +00:00
Nicholas Duffek 87f33987cd * archures.c (enum bfd_architecture): #define constants for
PowerPc and RS6000 machine numbers.
	* bfd-in2.h: Regenerate.
	* coffcode.h (coff_set_arch_mach_hook): #ifdef XCOFF64, set arch
	to bfd_arch_powerpc instead of bfd_arch_rs6000.  Refer to PowerPc
	and RS6000 machine numbers using #defined constants from
	archures.c.
	* cpu-powerpc.c (arch_info_struct): Refer to PowerPc and RS6000
	machine numbers using #defined constants from archures.c.  Add
	entries for EC603e, 630, A35, RS64II, RS64III, 7400.  Specify
	64-bit words in 620 entry.
	* cpu-rs6000.c (arch_info_struct): Create with entries for RS1,
	RSC, and RS2.
	(bfd_rs6000_arch): Change default machine to 0 (bfd_mach_rs6k).
2000-06-16 20:45:33 +00:00
Nicholas Duffek a2fdf27064 * coffcode.h (coff_mkobject_hook): Set xcoff_tdata.xcoff64.
* libcoff-in.h (struct xcoff_tdata): Define xcoff64 field.
	* libcoff.h (struct xcoff_tdata): Define xcoff64 field.
2000-06-16 20:40:50 +00:00
Clinton Popetz c6664dfb26 bfd:
* coffcode.h (coff_set_arch_mach_hook, coff_set_flags):
	Change U802TOC64MAGIC to U803XTOCMAGIC.

include:
	* coff/rs6k64.h (U802TOC64MAGIC): Change to U803XTOCMAGIC.
2000-05-06 01:41:50 +00:00
Clinton Popetz 2243c419e9 * coffcode.h Copy changes mistakenly done to libcoff.h in
4/24/2000 patch.
2000-04-29 02:41:36 +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
Jim Wilson fac417805a Bfd support for generating IA-64 EFI binaries.
* Makefile.am (BFD64_BACKENDS): Mention coff-ia64.lo.
	(BFD64_BACKENDS_CFILES): Mention coff-ia64.c
	(coff-ia64.lo): Add dependency.
	* Makefile.in: Regenerate.
	* coff-ia64.c: New file.
	* efi-app-ia32.c: Ditto.
	* efi-app-ia64.c: Ditto.
	...
2000-04-18 04:03:16 +00:00
Timothy Wall b9af77f58f Clean up load page support for tic54x. 2000-04-18 02:21:27 +00:00
Timothy Wall 4af1d5f662 Mods to allow compilation of BFD all targets. 2000-04-11 04:11:03 +00:00
Timothy Wall 81635ce4f5 BFD and include/coff support for tic54x target. 2000-04-07 17:06:58 +00:00
Timothy Wall 34cbe64ecf SEC_BLOCK, SEC_CLINK, and C_STATLAB added (TI COFF support). 2000-04-07 00:58:07 +00:00
Nick Clifton 8603339400 Fix building with --enable-targets=all 2000-03-01 20:39:07 +00:00
Nick Clifton 17505c5cfa Add WinCE support. 2000-02-28 18:56:11 +00:00
Geoffrey Keating 2fca4467d0 * coffcode.h (coff_set_arch_mach_hook): Use free(), because there
is no bfd_free().  Revert bfd_free part of previous change.
2000-02-19 01:11:19 +00:00
Geoffrey Keating 5ea1af0d5d * coffcode.h (coff_set_arch_mach_hook): Don't use variable-size
arrays.
(coff_compute_section_file_positions): Use bfd_free to pair
bfd_malloc.
(coff_write_object_contents): Likewise.

* coff-rs6000.c (xcoff_howto_table_16): New variable.
(xcoff_rtype2howto): Handle 16-bit variants of 32-bit relocs.
2000-02-19 00:59:26 +00:00
Timothy Wall 6c784c9aab Add hooks to support TI COFF handling. 2000-02-10 21:21:55 +00:00
Nick Clifton b5f303f092 Remove use of a GCC extension when allocating local arrays. 2000-01-24 19:38:04 +00:00
Nick Clifton 6b3b007bde Applied Tim Wall's patch to replace RELSZ and friends with bfd_coff_relsz and
friends.
2000-01-13 23:55:21 +00:00
Ian Lance Taylor e5db213db2 1999-09-13 Donn Terry <donn@interix.com>
* coffcode.h (styp_to_sec_flags): Further refinement of COMDAT
	handling to support both GNU and MS objects.
1999-09-13 23:55:22 +00:00
Ian Lance Taylor 7920749071 1999-09-13 Donn Terry <donn@interix.com>
* coffcode.h (coff_write_object_contents): Don't check reloc_count
	when determining whether to set F_RELFLG.
1999-09-13 23:42:43 +00:00
Ian Lance Taylor 0717ebb780 1999-09-11 Donn Terry <donn@interix.com>
* config.bfd (i[3456]86-*-interix*): Set targ_cflags to
	-DSTRICT_PE_FORMAT.
	* coffcode.h (styp_to_sec_flags): Check STRICT_PE_FORMAT rather
	than __INTERIX.
	(coff_classify_symbol): Re-revert 1999-08-08 patch if
	STRICT_PE_FORMAT.
1999-09-11 23:46:09 +00:00
Ian Lance Taylor 1135238bd0 1999-09-11 Donn Terry <donn@interix.com>
* coffcode.h (coff_mkobject_hook): Set timestamp field in
	coff_data_type to f_timdat.
	* peicode.h (pe_mkobject_hook): Likewise.
1999-09-11 22:46:37 +00:00
Ian Lance Taylor 4cfec37b92 1999-09-11 Donn Terry <donn@interix.com>
* coffcode.h (coff_mkobject_hook): If COFF_WITH_PE, set HAS_DEBUG
	to the reverse of IMAGE_FILE_DEBUG_STRIPPED.
	(coff_write_object_contents): Set IMAGE_FILE_DEBUG_STRIPPED if
	there is no SEC_DEBUGGING section.
	* peicode.h (pe_mkobject_hook): Set HAS_DEBUG to the reverse of
	IMAGE_FILE_DEBUG_STRIPPED.
1999-09-11 22:33:45 +00:00
Ian Lance Taylor a50f8417d5 * coff-ppc.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
1999-09-11  Donn Terry  <donn@interix.com>

	* coffcode.h (coff_set_alignment_hook): Delete POWERPC_LE_PE
	special handling.
1999-09-11 21:39:03 +00:00
Ian Lance Taylor d510f9a69b 1999-09-11 Donn Terry <donn@interix.com>
* coffcode.h (coff_slurp_symbol_table): If PE, set BSF_DEBUGGING
	for C_FCN/C_EFCN symbols, and set BSF_DEBUGGING_RELOC for such
	symbols named .bf.
1999-09-11 21:04:09 +00:00
Ian Lance Taylor 692b7d62e8 * coffcode.h (bfd_coff_backend_data): Add _bfd_filnmlen field.
(bfd_coff_filnmlen): Define.
	(bfd_coff_std_swap_table): Initialize new field.
	* coffgen.c (coff_fix_symbol_name): Use bfd_coff_filnmlen rather
	than FILNMLEN.
	(coff_write_symbols): Likewise.
	(coff_get_normalized_symtab): Likewise.
	* coff-sh.c (bfd_coff_small_swap_table): Initialize new field.
	* libcoff.h: Rebuild.
1999-09-07 04:28:27 +00:00
Ian Lance Taylor 4c117b10b2 reformat for 80 column screen 1999-09-07 04:14:35 +00:00
Ian Lance Taylor 75cc718903 1999-09-06 Donn Terry <donn@interix.com>
* coffcode.h (sort_by_secaddr): New static function if
	COFF_IMAGE_WITH_PE.
	(coff_compute_section_file_positions): If COFF_IMAGE_WITH_PE, sort
	sections by VMA when assigning target_index values.  Always set
	virt_size.
1999-09-07 04:06:50 +00:00
Ian Lance Taylor fdfd89ab43 remove unneeded ifdefs 1999-09-07 03:42:53 +00:00
Ian Lance Taylor 8d3ad4e16f 1999-09-06 Donn Terry <donn@interix.com>
* libcoff-in.h (struct pei_section_tdata): Add pe_flags field.
	* coffcode.h (coff_set_alignment_hook): Set pe_flags field if
	COFF_WITH_PE.
	* libcoff.h: Rebuild.
1999-09-07 03:40:32 +00:00
Ian Lance Taylor 8a1ad8e793 1999-09-06 Donn Terry <donn@interix.com>
* coffcode.h (coff_set_custom_section_alignment): Add const to
	declaration to match definition.
	(coff_write_object_contents): Don't set F_AR32W(R)? if
	COFF_WITH_PE.
1999-09-07 03:00:32 +00:00
Ian Lance Taylor 417335159b 1999-09-06 Donn Terry <donn@interix.com>
* coffcode.h (sec_to_styp_flags): Write separate COFF_WITH_PE
	version.  Move COFF_WITH_PE specific code to new version.
	(stype_to_sec_flags): Likewise.  Add section parameter.
	* coffgen.c (make_a_section_from_file): Set target_index before
	calling styp_to_sec_flags.  Pass section to styp_to_sec_flags.
	* libcoff.h: Rebuild.
1999-09-07 02:11:54 +00:00
Ian Lance Taylor 00692651e0 1999-08-18 Donn Terry <donn@interix.com>
* coff-i386.c (coff_i386_reloc): Handle R_IMAGEBASE.
	(RTYPE2HOWTO): Return NULL if reloc type is out of range.
	(coff_i386_rtype_to_howto): Likewise.
	* coffcode.h (coff_slurp_symbol_table): Change a -2 to N_DEBUG.
	Completely ignore symbols which are all zero.
	(dummy_reloc16_estimate): Add return 0.
	* cofflink.c (_bfd_coff_link_input_bfd): Rename inner scope
	variable copy to name_copy to avoid shadowing outer scope
	variable.
	* libcoff-in.h (coff_data_type): Change raw_syment_count field
	from unsigned int to unsigned long.  Add timestamp field.
	* libcoff.h: Rebuild.

Also comment changes.
1999-08-18 06:00:13 +00:00
Ian Lance Taylor 5dccc1ddaa 1999-08-08 Mark Elbrecht <snowball3@bigfoot.com>
* libcoff-in.h (struct coff_section_alignment_entry): Define.
	* coffcode.h (coff_set_custom_section_alignment): New static
	function.
	(coff_section_alignment_table): New static array.
	(coff_new_section_hook): Use coff_set_customer_section_alignment.
	* coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
	* coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.
	* libcoff.h: Rebuild.
1999-08-09 02:56:16 +00:00
Ian Lance Taylor bd826630b1 1999-08-08 Mumit Khan <khan@xraylith.wisc.edu>
* section.c (SEC_SHARED): Define.
	* coffcode.h (sec_to_styp_flags): Handle SEC_SHARED.
	(styp_to_sec_flags): Likewise.
	* peicode.h (coff_swap_scnhdr_out): Likewise.
	* bfd-in2.h: Rebuild.

1999-08-08  Ian Lance Taylor  <ian@zembu.com>

	* coffcode.h (coff_classify_symbol): Comment out part of
	1999-08-05 change which breaks cygwin DLLs.
1999-08-08 16:50:27 +00:00