Commit Graph

106 Commits

Author SHA1 Message Date
Zack Weinberg a359509ed3 ld:
* ldlang.c (entry_symbol_default): New file-scope global.
	(lang_finish): Use it, not a hardwired "start".
	(lang_default_entry): Set it.
	* ldlang.h: Declare lang_default_entry.
	* emultempl/beos.em, emultempl/pe.em: Use lang_default_entry,
	not lang_add_entry, to override default entry point symbol.

ld/testsuite:
	* ld-scripts/align.exp: Mark align1 XFAIL on PECOFF targets.
	* ld-scripts/data.exp: Mark data UNSUPPORTED on a.out targets.
	* ld-scripts/provide.exp, ld-scripts/size.exp: Mark all tests
	UNSUPPORTED on a.out targets.  Tidy.
2005-06-01 04:04:19 +00:00
Nick Clifton 75be928bd2 Update FSF addresses 2005-05-12 07:32:09 +00:00
Alan Modra 8423293d34 bfd/
* section.c (struct bfd_section): Replace link_order_head and
	link_order_tail with map_head and map_tail union.
	(STD_SECTION): Update.
	(_bfd_strip_section_from_output): Delete.
	* aoutx.h: Update throughout for above changes.
	* coff-ppc.c: Likewise.
	* cofflink.c: Likewise.
	* ecoff.c: Likewise.
	* elf-eh-frame.c: Likewise.
	* elf-m10300.c: Likewise.
	* elf.c: Likewise.
	* elf32-arm.c: Likewise.
	* elf32-cris.c: Likewise.
	* elf32-hppa.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-m32r.c: Likewise.
	* elf32-m68hc1x.c: Likewise.
	* elf32-m68k.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-s390.c: Likewise.
	* elf32-sh.c: Likewise.
	* elf32-vax.c: Likewise.
	* elf32-xtensa.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-hppa.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-s390.c: Likewise.
	* elf64-sh64.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elflink.c: Likewise.
	* elfxx-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.
	* elfxx-sparc.c: Likewise.
	* linker.c: Likewise.
	* merge.c: Likewise.
	* pdp11.c: Likewise.
	* xcofflink.c: Likewise.
	* elflink.c (bfd_boolean bfd_elf_size_dynsym_hash_dynstr): Split
	out from bfd_elf_size_dynamic_sections.
	* bfd-in.h (bfd_boolean bfd_elf_size_dynsym_hash_dynstr): Declare.
	* bfd-in2.h: Regenerate.
ld/
	* ldemul.c: Include bfdlink.h.
	(ldemul_before_allocation): Assume before_allocation is non-zero.
	(before_allocation_default): Call strip_excluded_output_sections.
	* ldlang.c (stripped_excluded_sections): New variable.
	(lang_add_section): Build input section list for each output
	section, attached via map_head and map_tail pointers.
	(strip_excluded_output_sections): Make global.  Traverse the
	input section lists to find which output sections can go.  Clear
	link_order pointers and set stripped_excluded_sections.
	(lang_process): Call strip_excluded_output_sections.
	* ldlang.h (strip_excluded_output_sections): Declare.
	* ldwrite.c: Update throuhout for link_order_head -> map_head change.
	* emultempl/aix.em (before_allocation): Call
	strip_excluded_output_sections.
	* emultempl/armcoff.em (before_allocation): Likewise.
	* emultempl/beos.em (before_allocation): Likewise.
	* emultempl/linux.em (before_allocation): Likewise.
	* emultempl/pe.em (before_allocation): Likewise.
	* emultempl/sunos.em (before_allocation): Likewise.
	* emultempl/elf32.em (before_allocation): Likewise.  Call
	bfd_elf_size_dynsym_hash_dynstr too.
	* emultempl/lnk960.em (lnk960_before_allocation): Delete.
	(ld_lnk960): Use before_allocation_default.
2005-05-04 11:00:28 +00:00
Alan Modra aef6203bd6 update copyright dates 2005-03-03 11:52:12 +00:00
Ben Elliston 7a64f7b8d6 * ldlang.c (lang_reasonable_defaults): Remove.
(lang_process): Don't call lang_reasonable_defaults.

	* ldexp.c (exp_assop): Remove #if 0'd code.
	(exp_print_tree): Likewise.
	* ldlang.c (lang_memory_region_lookup): Likewise.
	(open_output): Likewise.
	(lang_do_assignments_1): Likewise.
	(lang_place_orphans): Likewise.
	(lang_enter_output_section_statement): Likewise.
	(lang_reasonable_defaults): Likewise.
	* ldlang.h (struct lang_input_statement_struct): Likewise.
	* mri.c (mri_draw_tree): Likewise.
	(mri_load): Likewise.
	* pe-dll.c (generate_reloc): Likewise.
	(make_import_fixup_entry): Likewise.
	(pe_as16): Likewise.
	* emultempl/beos.em (set_pe_subsystem): Likewise.
	* emultempl/hppaelf.em (hppaelf_after_parse): Likewise.
	* emultempl/pe.em: Likewise.
	* emultempl/xtensaelf.em (xtensa_colocate_literals): Likewise.
2005-01-21 04:15:59 +00:00
Danny Smith 2af59babed * emultempl/pe.em (set_pe_subsystem): Change second arg to
lang_add_entry to FALSE.
2004-12-29 05:59:29 +00:00
Nick Clifton 33f362e109 Add support for --subsystem:xbox as well as --subsystem:<number>. 2004-11-26 09:42:04 +00:00
Danny Smith 2a08daf3f5 * emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Simplify
comparison and replacement of filenames.
2004-10-19 20:07:32 +00:00
Alan Modra afd7a018c9 ld/
PR 63
	* ldlang.h (lang_output_section_statement_type): Make "next" a
	struct lang_output_section_statement_struct *.
	(struct orphan_save): Move from elf32.em.  Add "name" and "flags".
	(lang_output_section_find_by_flags, lang_insert_orphan): Declare.
	* ldlang.c (lang_output_section_find_1): Adjust for changed
	output_section_statement "next".
	(strip_excluded_output_sections): Likewise.
	(lang_record_phdrs): Likewise.
	(lang_output_section_find_by_flags): New function.
	(output_prev_sec_find): Move from pe.em.  Adjust iterator.
	(lang_insert_orphan): New function.  Tail end of elf32.em's
	place_orphan merged with that from pe.em.  Allow bfd_section to
	be placed first.  New heuristic for placing new output section
	statement in existing script, and accompanying split of __start
	symbol alignment into a separate assignment to dot.
	(lang_add_section): Consistently use output->bfd_section rather than
	an alias, section->output_section.
	(map_input_to_output_sections): Rename overly long arg.  Move
	initialization of data_statement output section to here..
	(lang_check_section_addresses): ..from here.
	(print_assignment): Correct printing of etree_assert.
	(print_all_symbols): Don't bomb if userdata is NULL.
	(IGNORE_SECTION): Rearrange.
	* emultempl/elf32.em (output_rel_find): Adjust interator.
	(output_prev_sec_find): Delete.
	(struct orphan_save): Delete.
	(gld${EMULATION_NAME}_place_orphan): Cater for zero bfd_section
	flags without creating a duplicate output section statement.
	Revise code holding history of various orphan section placements.
	Allow orphan sections to place before script specified output
	sections.  Call lang_output_section_find_by_flags when placement
	by name fails.  Use lang_insert_orphan.
	* emultempl/mmo.em (output_prev_sec_find): Delete.
	(struct orphan_save): Delete.
	(mmo_place_orphan): Revise code holding history of orphan placement.
	Allow orphans to place before existing output sections.  Use
	lang_insert_orphan.
	* emultempl/pe.em (output_prev_sec_find): Delete.
	(struct orphan_save): Delete.
	(gld_${EMULATION_NAME}_place_orphan): Revise to suit use of
	lang_insert_orphan.
ld/testsuite/
	* ld-scripts/overlay-size.d: Update for changed orphan section
	placement.
	* ld-mmix/bpo-18.d: Likewise.
2004-10-14 12:54:47 +00:00
Alan Modra 1af699f475 PR 44
* emultempl/pe.em (struct orphan_save): Add os_tail.
	(place_orphan): Backport assorted fixes from elf32.em.
2004-10-12 23:44:57 +00:00
Nick Clifton db8acf26ca emultempl/pe.em (gld_${EMULATION_NAME}_set_symbols): Generate correct base
address for position independant executables.
pe-dll.c (pe_dll_fill_sections): Don't mark position independant executables
  as DLLs.
2004-09-30 17:19:19 +00:00
Christopher Faylor f2d3750dc9 * emultempl/pe.em (gld_${EMULATION_NAME}_unrecognized_file): Allow
def_file_parse to handle pe_def_file if NULL and prevent crash with invalid
.def files.
2004-09-28 15:00:45 +00:00
Alan Modra f6e332e660 include/
* bfdlink.h (struct bfd_link_hash_entry): Move und_next into elements
	of union.
bfd/
	* ecoff.c: Update u.undef.next refs.
	* elf64-ppc.c: Likewise.
	* elflink.c: Likewise.
	* linker.c: Likewise.
	* xcofflink.c: Likewise.
ld/
	* ldexp.c (fold_name): Update u.undef.next refs.
	* emultempl/pe.em: Likewise.
	* emultempl/sunos.em: Likewise.

bfd/
	* elf-bfd.h (struct elf_link_hash_entry): Rearrange.  Add FIXME to
	dynamic_def.  Combine weakdef and elf_hash_value.  Move vtable
	fields to indirect struct.
	* elf-m10300.c: Update u.weakdef refs.
	* elf32-arm.h: Likewise.
	* elf32-cris.c: Likewise.
	* elf32-frv.c: Likewise.
	* elf32-hppa.c: Likewise.
	* elf32-i370.c: Likewise.
	* elf32-i386.c: Likewise.
	* elf32-m32r.c: Likewise.
	* elf32-m68k.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-s390.c: Likewise.
	* elf32-sh.c: Likewise.
	* elf32-sparc.c: Likewise.
	* elf32-vax.c: Likewise.
	* elf32-xtensa.c: Likewise.
	* elf64-alpha.c: Likewise.
	* elf64-hppa.c: Likewise.
	* elf64-ppc.c: Likewise.
	* elf64-s390.c: Likewise.
	* elf64-sh64.c: Likewise.
	* elf64-sparc.c: Likewise.
	* elf64-x86-64.c: Likewise.
	* elfxx-ia64.c: Likewise.
	* elfxx-mips.c: Likewise.
	* elflink.c: Likewise.  Also u.elf_hash_value.
	(elf_gc_propagate_vtable_entries_used): Update for h->vtable
	indirection.
	(elf_gc_smash_unused_vtentry_relocs): Likewise.
	(bfd_elf_gc_record_vtinherit): Alloc vtable.
	(bfd_elf_gc_record_vtentry): Likewise.
	* elf.c (_bfd_elf_link_hash_newfunc): Use memset.
2004-09-17 07:14:33 +00:00
Nick Clifton c034e3e0ec Do not assume that either bfd is an archive 2004-08-27 07:39:19 +00:00
Nick Clifton c99b813881 (make_import_fixup): Use bfd_get_32 to correct for endian-ness of extracted
addend.
2004-07-13 18:56:38 +00:00
Jakub Jelinek 0841712ea9 * ldgram.y (sect_constraint): New.
(ONLY_IF_RO, ONLY_IF_RW): New tokens.
	(section): Add sect_constraint.  Pass additional argument
	to lang_enter_output_section_statement.
	* mri.c (mri_draw_tree): Pass additional argument to
	lang_enter_output_section_statement.
	* emultempl/pe.em (place_orphan): Likewise.
	(output_prev_sec_find): Disregard output section statements with
	constraint == -1.
	* emultempl/mmo.em (output_prev_sec_find): Likewise.
	(mmo_place_orphan): Pass additional argument to
	lang_enter_output_section_statement.
	* emultempl/elf32.em (output_prev_sec_find): Disregard output section
	statements with constraint == -1.
	(place_orphan): Pass additional argument to
	lang_enter_output_section_statement.
	* ldlang.c (lang_enter_overlay_section): Likewise.
	(lang_output_section_find_1): New.
	(lang_output_section_find): Use it.
	(lang_output_section_statement_lookup_1): New.
	(lang_output_section_statement_lookup): Use it.
	(check_section_callback, check_input_sections): New.
	(map_input_to_output_sections): Check if all input sections
	are readonly if ONLY_IF_RO or ONLY_IF_RW was seen.
	(strip_excluded_output_sections): Disregard output section statements
	with constraint == -1.
	(lang_record_phdrs): Likewise.
	(lang_enter_output_section_statement): Add constraint argument.
	Use lang_output_section_statement_lookup_1.
	* ldlang.h (lang_output_section_statement_type): Add constraint
	and all_input_readonly fields.
	(lang_enter_output_section_statement): Adjust prototype.
	* ldlex.l (ONLY_IF_RO, ONLY_IF_RW): New tokens.
	* scripttempl/elf.sc (.eh_frame, .gcc_except_table): Move into text
	segment if all input sections are readonly.
2004-05-19 14:01:14 +00:00
Brian Ford 26d2d8a262 * emultempl/pe.em (real_flags): New static.
(OPTION_LARGE_ADDRESS_AWARE): New define.
(gld${EMULATION_NAME}_add_options): Add --large-address-aware option.
(gld_${EMULATION_NAME}_list_options): Likewise.
(gld${EMULATION_NAME}_handle_option): Likewise.
(gld_${EMULATION_NAME}_after_open): Pass real_flags to PE private data.
* ld.texinfo: Document it.
* NEWS: Mention it.
2004-05-07 15:17:58 +00:00
Nick Clifton ff71f4f7d0 Fix typo in previous delta 2004-02-05 11:41:51 +00:00
Nick Clifton 07a68a8066 Fix thinko checking for dlls in archives. 2004-02-04 09:13:28 +00:00
Alan Modra e5caa5e0ca * ldexp.c (align_n): Make static.
* ldexp.h (align_n): Delete declaration.
	* ldlang.h (lang_enter_output_section_statement): Remove
	block_value param.
	* ldlang.c (lang_enter_output_section_statement): Likewise.
	(TO_ADDR, TO_SIZE): Define.
	(opb): New var.
	(init_opb): New function.
	(print_input_section): Call init_opb and use TO_ADDR.
	(print_data_statement, print_reloc_statement): Likewise.
	(print_padding_statement): Likewise.
	(size_input_section): Use TO_SIZE and TO_ADDR, and global opb.
	(lang_check_section_addresses): Likewise.
	(lang_size_sections_1): Likewise.
	(lang_do_assignments_1): Likewise.
	(lang_set_startof): Likewise.
	(lang_one_common): Likewise.  Combine power_of_two and opb alignment.
	(lang_process): Call init_opb.
	(lang_abs_symbol_at_end_of): Use TO_ADDR and global opb.
	(lang_enter_overlay_section): Adjust
	lang_enter_output_section_statement call.
	* ldgram.y: Likewise.
	* mri.c (mri_draw_tree): Likewise.
	* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Likewise.
	* emultempl/mmo.em (mmo_place_orphan): Likewise.
	* emultempl/pe.em (gld${EMULATION_NAME}_place_orphan): Likewise.
2004-01-03 12:39:07 +00:00
Alan Modra 5e2f15758b * ldfile.c (ldfile_set_output_arch): Add defarch param.
* ldfile.h (ldfile_set_output_arch): Ditto.
	* emultempl/aix.em (gld${EMULATION_NAME}_before_parse): Use
	ldfile_set_output_arch.
	* emultempl/beos.em (gld${EMULATION_NAME}_before_parse): Ditto.
	* emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Ditto.
	* emultempl/linux.em (gld${EMULATION_NAME}_before_parse): Ditto.
	* emultempl/mipsecoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
	* emultempl/pe.em (gld${EMULATION_NAME}_before_parse): Ditto.
	* emultempl/sunos.em (gld${EMULATION_NAME}_before_parse): Ditto.
	* ldgram.y: Adjust ldfile_set_output_arch call.
	* emultempl/armcoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
	* emultempl/armelf.em (gld${EMULATION_NAME}_before_parse): Ditto.
	* emultempl/armelf_oabi.em (gld${EMULATION_NAME}_before_parse): Ditto.
	* emultempl/generic.em (gld${EMULATION_NAME}_before_parse): Ditto.
	* emultempl/gld960c.em (gld960_set_output_arch): Ditto.
	* emultempl/m68kcoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
	* emultempl/ticoff.em (gld${EMULATION_NAME}_before_parse): Ditto.
2004-01-03 11:09:07 +00:00
Nick Clifton 44dbf3639f When scanning MS import libraries allow for the possible presence of static
objects.
2003-12-18 14:56:44 +00:00
Alan Modra 6ad841a183 Rename bfd_link_hash_entry field "next" -> "und_next". 2003-12-02 23:00:00 +00:00
Alan Modra 4b83d61511 * emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Only do
pe_dll_extra_pe_debug stuff when DLL_SUPPORT defined.
	(pr_sym): Move inside #ifdef DLL_SUPPORT.
2003-11-04 23:36:21 +00:00
Andrew Cagney fc0a224429 Index: sim/frv/ChangeLog
2003-10-30  Andrew Cagney  <cagney@redhat.com>

	* traps.c: Replace "struct symbol_cache_entry" with "struct
	bfd_symbol".

Index: sim/d10v/ChangeLog
2003-10-30  Andrew Cagney  <cagney@redhat.com>

	* simops.c: Replace "struct symbol_cache_entry" with "struct
	bfd_symbol".

Index: sim/common/ChangeLog
2003-10-30  Andrew Cagney  <cagney@redhat.com>

	* sim-trace.c, sim-base.h: Replace "struct symbol_cache_entry"
	with "struct bfd_symbol".

Index: ld/ChangeLog
2003-10-30  Andrew Cagney  <cagney@redhat.com>

	* emultempl/pe.em, pe-dll.c: Replace "struct symbol_cache_entry"
	with "struct bfd_symbol".

Index: bfd/ChangeLog
2003-10-30  Andrew Cagney  <cagney@redhat.com>

	* syms.c: Replace "struct symbol_cache_entry" with "struct
	bfd_symbol".
	* vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto.
	* mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto.
	* cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto.
	* bfd-in2.h: Re-generate.
2003-10-31 05:32:46 +00:00
Danny Smith 1fa1d2cdfc * emultempl/pe.em (gld_${EMULATION_NAME}_before_parse):
Change second (cmdline) arg to lang_add_entry to FALSE.
	(set_pe_subsystem): Change second arg to lang_add_entry to TRUE.
2003-08-07 01:52:36 +00:00
Alan Modra 0c7a8e5acd * emultempl/aix.em: Convert to C90, remove unnecessary prototypes
and casts.  Replace PTR with void *.  Formatting.
	* emultempl/alphaelf.em: Likewise
	* emultempl/armcoff.em: Likewise
	* emultempl/armelf.em: Likewise
	* emultempl/armelf_oabi.em: Likewise
	* emultempl/beos.em: Likewise
	* emultempl/elf32.em: Likewise
	* emultempl/generic.em: Likewise
	* emultempl/gld960.em: Likewise
	* emultempl/gld960c.em: Likewise
	* emultempl/hppaelf.em: Likewise
	* emultempl/linux.em: Likewise
	* emultempl/lnk960.em: Likewise
	* emultempl/m68hc1xelf.em: Likewise
	* emultempl/m68kcoff.em: Likewise
	* emultempl/m68kelf.em: Likewise
	* emultempl/mipsecoff.em: Likewise
	* emultempl/mipself.em: Likewise
	* emultempl/mmix-elfnmmo.em: Likewise
	* emultempl/mmixelf.em: Likewise
	* emultempl/mmo.em: Likewise
	* emultempl/needrelax.em: Likewise
	* emultempl/netbsd.em: Likewise
	* emultempl/pe.em: Likewise
	* emultempl/sh64elf.em: Likewise
	* emultempl/sunos.em: Likewise
	* emultempl/ticoff.em: Likewise
	* emultempl/vanilla.em: Likewise
	* emultempl/xtensaelf.em: Likewise
	* Makefile.am: Correct dependencies.
	* Makefile.in: Regenerate.
2003-06-27 00:38:25 +00:00
Alan Modra 1049f94e8e Correct spelling of "relocatable". 2003-06-25 06:40:27 +00:00
Nick Clifton 29e1a6e4ca Replace <ctype.h> with "safe-ctype.h" 2003-05-29 15:05:41 +00:00
Nick Clifton 2b817be136 pe-dll.c (pe_detail_list): arm-pe targets use underscores.
(process_def_file): Don't create an export section if there are no exports and
  we're building an exe.
(pe_dll_build_sections): Ditto
(pe_dll_fill_sections): Conditionalize setting abfd->dll true on info->shared

emultempl/pe.em (gld_${EMULATION_NAME}_after_open): If i386pe or armpe, call
  pe_dll_build_section() for both exe's and dll's, not just dll's.  Don't call
  pe_dll_build_section() if link_info.relocateable.
(gld_${EMULATION_NAME}_finish): For all targets except shpe and mipspe, call
  pe_dll_fill_sections() for both exe's and dll's, not just dll's.  Don't call
  pe_dll_fill_sections() if link_info.relocateable.
2003-04-02 17:39:24 +00:00
Alan Modra 3bcf55573d * ldemul.c (ldemul_add_options, ldemul_handle_option): New functions.
(ldemul_parse_args): Return bfd_boolean.  Formatting.
	* ldemul.h (ldemul_add_options, ldemul_handle_option): Declare.
	(ldemul_parse_args): Adjust.
	(struct ld_emulation_xfer_struct): Add add_options and handle_option.
	Return bfd_boolean from parse_args.
	* lexsup.c (parse_args): Malloc shortopts, longopts and
	really_longopts.  Call ldemul_add_options and ldemul_handle_option.
	* emultempl/aix.em (gld${EMULATION_NAME}_add_options): Split out from
	gld${EMULATION_NAME}_parse_args.
	(gld${EMULATION_NAME}_handle_option): Likewise.
	(ld_${EMULATION_NAME}_emulation): Adjust initializer.
	* emultempl/armcoff.em: As for aix.em, but remove parse_args.
	* emultempl/beos.em: Likewise.
	* emultempl/pe.em: Likewise.
	* emultempl/ticoff.em: Likewise.
	* emultempl/elf32.em: Likewise.  Don't duplicate long options either.
	(gld${EMULATION_NAME}_add_sysroot): Prototype.
	* emultempl/armelf.em (PARSE_AND_LIST_LONGOPTS): Don't duplicate
	options.
	* emultempl/hppaelf.em (PARSE_AND_LIST_LONGOPTS): Likewise.
	* emultempl/ppc32elf.em (PARSE_AND_LIST_LONGOPTS): Likewise.
	* emultempl/ppc64elf.em (PARSE_AND_LIST_LONGOPTS): Likewise.
	* emultempl/armelf_oabi.em (ld_${EMULATION_NAME}_emulation): Adjust
	initializer.
	* emultempl/generic.em: Likewise.
	* emultempl/gld960.em: Likewise.
	* emultempl/gld960c.em: Likewise.
	* emultempl/linux.em: Likewise.
	* emultempl/lnk960.em: Likewise.
	* emultempl/m68kcoff.em: Likewise.
	* emultempl/mipsecoff.em: Likewise.
	* emultempl/sunos.em: Likewise.
	* emultempl/vanilla.em: Likewise.
	* emultempl/netbsd.em (gldnetbsd_before_parse): Prototype.
2003-02-28 01:32:31 +00:00
Nick Clifton 489d0400af Remove an extra "i" in --dll-search-prefix.
Move a cross-80th-column-margin "an" to the next line.
2003-01-23 09:30:44 +00:00
Nick Clifton 4cd898632a Don't search for data import when auto-import is disabled. 2002-12-17 12:16:38 +00:00
Nick Clifton 2a8ac465c4 Use LD_PATHMAX+1 to account for trailing '\0'. 2002-12-17 11:01:25 +00:00
Nick Clifton a08a0d635b Duplicate entry for --compact-implib so that it is not confused with -c. 2002-12-17 10:03:52 +00:00
Nick Clifton 939ba9d0fc Add support to skip import libraries for performance reasons and instead
use the direct auto-import of dll's
2002-12-16 18:02:16 +00:00
Alan Modra b34976b65a s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. Simplify
comparisons of bfd_boolean vars with TRUE/FALSE.  Formatting.
2002-11-30 08:39:46 +00:00
Nick Clifton 2fa9fc65a5 Add --enable-auto-import extension. 2002-11-14 18:03:17 +00:00
Nick Clifton c9e3887989 Adds support for fastcall symbols as used on Microsoft Windows platforms
(i386)
2002-11-06 19:36:20 +00:00
Daniel Jacobowitz df2a731323 * emultempl/aix.em: Use include <> for generated headers.
* emultempl/beos.em: Likewise.
	* emultempl/elf32.em: Likewise.
	* emultempl/pe.em: Likewise.
	* ldctor.c: Likewise.
	* ldexp.c: Likewise.
	* ldfile.c: Likewise.
	* ldlang.c: Likewise.
	* ldlex.c: Likewise.
	* ldlex.l: Likewise.
	* ldmain.c: Likewise.
	* ldmisc.c: Likewise.
	* ldwrite.c: Likewise.
	* lexsup.c: Likewise.
	* mri.c: Likewise.
	* pe-dll.c: Likewise.
2002-10-30 03:57:39 +00:00
Alan Modra 25844aaec2 * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
bomb on /DISCARD/ input section.
	* emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
	* emultempl/mmo.em (mmo_place_orphan): Likewise.
2002-07-20 13:41:11 +00:00
Alan Modra e3e942e990 * ldlang.h (entry_sym): Make it a struct bfd_sym_chain.
* ldlang.c (entry_sym): Likewise.
	(ldlang_undef_chain_list_type): Likewise.
	(lang_finish): Adjust references to entry_symbol.
	(lang_add_entry): Likewise.
	(lang_gc_sections): Use link_info.gc_sym_list.
	(lang_process): Set link_info.gc_sym_list.
	* ldlex.l: Include bfdlink.h.
	* ldmain.c (main): Init link_info.gc_sym_list.
	* emultempl/aix.em: Adjust references to entry_symbol.
	* emultempl/armcoff.em: Likewise.
	* emultempl/armelf.em: Likewise.
	* emultempl/pe.em: Likewise.
	* emultempl/ppc64elf.em (ppc_after_open): New function.
	(LDEMUL_AFTER_OPEN): Define.
	* emulparams/elf64ppc.sh: KEEP .opd sections.
2002-07-01 08:07:31 +00:00
Nick Clifton e0076ab314 Enable pei386_auto_import by default. Only print a info message about auto
imports being resilved if this feature was not requested via a command line
switch.
2002-06-07 14:56:01 +00:00
Richard Sandiford ee3cc2e2ee * ldlang.c (lang_size_sections_1): Move check for conflicting load
addresses and regions from here...
	(lang_get_regions): ...to this new function.
	(lang_leave_output_section_statement): Use lang_get_regions.
	(lang_leave_overlay): Likewise.
	* mri.c (mri_draw_tree): Pass null as last argument to
	lang_leave_output_section_statement.
	* emultempl/elf32.em (gld*_place_orphan): Likewise.
	* emultempl/mmo.em (mmo_place_orphan): Likewise.
	* emultempl/pe.em (gld*_place_orphan): Likewise.
2002-05-27 08:22:08 +00:00
Christopher Faylor 70b0be7903 * pe-dll.c (autofilter_liblist): Add more system libs excluded by default.
(autofilter_objlist): Add crtbegin.o, crtend.o.
* emultempl/pe.em (OPTION_EXCLUDE_LIBS): Add new define.
(longopts): Add new option --exclude-libs.
(gld_${EMULATION_NAME}_list_options): Give quick help about it.
(gld_${EMULATION_NAME}_parse_args): Use it.
* pe-dll.h (pe_dll_add_excludes): Add second param to prototype.
* pe-dll.c (exclude_list_struct): Add field type to distinguish symbols from
whole archives.
(pe_dll_add_excludes): Set excludes->type.
(auto_export): Add new variable libname and set to archive basename if abfd.
Use it when filtering default and user-specified libarary excludes.  Let string
"ALL" mean all libs when filtering user-specified libs.
* ld.texinfo: Document --exclude-libs.
2002-05-22 18:03:09 +00:00
Alan Modra fac1652d6b * ldemul.c (ldemul_new_vers_pattern): New function.
* ldemul.h (ldemul_new_vers_pattern): Declare.
	(struct ld_emulation_xfer_struct): Add new_vers_pattern.
	* ldlang.c (lang_new_vers_pattern): Call ldemul_new_vers_pattern.
	* emultempl/ppc64elf.em (dotsyms): New static var.
	(gld${EMULATION_NAME}_new_vers_pattern): New function.
	(LDEMUL_NEW_VERS_PATTERN): Define.
	(PARSE_AND_LIST_PROLOGUE): Add OPTION_DOTSYMS, OPTION_NO_DOTSYMS.
	(PARSE_AND_LIST_LONGOPTS): Likewise.
	(PARSE_AND_LIST_ARGS_CASES): Handle them.
	* emultempl/aix.em (ld_${EMULATION_NAME}_emulation): Update
	initialiser.
	* emultempl/armcoff.em: Likewise.
	* emultempl/armelf_oabi.em: Likewise.
	* emultempl/beos.em: Likewise.
	* emultempl/elf32.em: Likewise.
	* emultempl/generic.em: Likewise.
	* emultempl/gld960.em: Likewise.
	* emultempl/gld960c.em: Likewise.
	* emultempl/linux.em: Likewise.
	* emultempl/lnk960.em: Likewise.
	* emultempl/m68kcoff.em: Likewise.
	* emultempl/mipsecoff.em: Likewise.
	* emultempl/pe.em: Likewise.
	* emultempl/sunos.em: Likewise.
	* emultempl/ticoff.em: Likewise.
	* emultempl/vanilla.em: Likewise.
2002-05-22 09:04:48 +00:00
Alan Modra 54f24647c7 * emultempl/pe.em (set_pe_subsystem): Don't set "cmdline" when
calling lang_add_entry.
2002-05-22 08:21:27 +00:00
Alan Modra 2c382fb6f5 Support arbitrary length fill patterns.
* ldexp.h (etree_value_type): Add "str" field.
	(union etree_union): Add "str" to "value" struct.
	(exp_bigintop): Declare.
	(exp_get_fill): Declare.
	* ldexp.c: Include "safe-ctype.h".
	(exp_intop): Set value.str to NULL.
	(exp_bigintop): New function.
	(new_rel): Pass in "str", and set new.str from it.
	(new_rel_from_section): Set new.str to NULL.
	(fold_name): Adjust calls to new_rel.
	(exp_fold_tree): Likewise.
	(exp_get_fill): New function.
	* ldgram.y (struct big_int bigint, fill_type *fill): New.
	(INT): Returns a "bigint".  Adjust all code handling INTs.
	(fill_opt): Returns a "fill".
	(fill_exp): Split out of fill_opt, use for FILL.
	* ldlang.h (struct _fill_type): New.
	(fill_type): Move typedef to ldexp.h.
	(lang_output_section_statement_type): "fill" is now a pointer.
	(lang_fill_statement_type): Likewise.
	(lang_padding_statement_type): Likewise.
	(lang_add_fill): Now takes a "fill_type *" param.
	(lang_leave_output_section_statement): Likewise.
	(lang_do_assignments): Likewise.
	(lang_size_sections): Likewise.
	(lang_leave_overlay_section): Likewise.
	(lang_leave_overlay): Likewise.
	* ldlang.c: Include ldgram.h after ldexp.h.
	(lang_output_section_statement_lookup): Adjust for fill_type change.
	(print_fill_statement): Likewise.
	(print_padding_statement): Likewise.
	(insert_pad): Now takes a "fill_type *" arg.
	(size_input_section): Likewise.
	(lang_size_sections_1): Likewise.
	(lang_size_sections): Likewise.
	(lang_do_assignments): Likewise.
	(lang_add_fill): Likewise.
	(lang_leave_output_section_statement): Likewise.
	(lang_leave_overlay_section): Likewise.
	(lang_leave_overlay): Likewise.
	Adjust all callers of the above function.
	* ldlex.l: Include ldgram.h after ldexp.h.  Allow hex numbers
	starting with "0X" as well as "0x".  Return bigint.str for hex
	numbers starting with "0x" or "0X", zero bigint.str otherwise.
	Always use base 16 for numbers starting with "$".
	* ldmain.c: Include ldgram.h after ldexp.h.
	* ldwrite.c (build_link_order): Use bfd_data_link_order in place
	of bfd_fill_link_order.
	* pe-dll.c: Adjust lang_do_assignments calls.
	* emultempl/elf32.em: Likewise.
	* emultempl/hppaelf.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/beos.em: Include ldgram.h after ldexp.h, adjust
	lang_add_assignment call.
	* emultempl/pe.em: Likewise.
2002-02-15 02:11:05 +00:00
Alan Modra 3dfe7a8c3a * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Make use
of bfd_section_list_remove and bfd_section_list_insert macros.
	* emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
	* emultempl/mmo.em (mmo_place_orphan): Likewise.
2002-01-05 13:14:00 +00:00
Alan Modra 73e87d7038 hash bfd sections for fast lookup and create.
bfd/ChangeLog
	* bfd.c (struct _bfd): Add section_htab, section_tail.
	* libbfd-in.h (_bfd_delete_bfd): Declare.
	(bfd_section_hash_newfunc): Declare.
	* opncls.c (_bfd_new_bfd): Free memory on failure.  Init
	section_htab and section_tail.
	(_bfd_delete_bfd): New function.
	(bfd_openr): Use it.
	(bfd_fdopenr): Likewise.
	(bfd_openstreamr): Likewise.
	(bfd_openw): Likewise.
	(bfd_close): Likewise.
	(bfd_close_all_done): Likewise.
	(bfd_release): Comment.
	* section.c (struct section_hash_entry): New.
	(bfd_section_hash_newfunc): New function.
	(section_hash_lookup): Define.
	(bfd_section_init): New function, split out from
	bfd_make_section_anyway.
	(bfd_get_section_by_name): Lookup via hash table.
	(bfd_get_unique_section_name): Likewise.
	(bfd_make_section_old_way): Rewrite to use hash table.
	(bfd_make_section_anyway): Likewise.
	(bfd_make_section): Likewise.  Return NULL for attempts to make
	BFD_{ABS,COM,UND,IND}_SECTION_NAME.
	(_bfd_strip_section_from_output): Adjust section_tail if needed.
	* configure.in: Bump bfd version.
	* configure: Regenerate.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.

ld/ChangeLog
	* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Adjust
	section_tail when fiddling with section list.
	(gld${EMULATION_NAME}_list_options): Ensure sentences aren't
	broken into separate strings to make translation easier.
	* emultempl/mmo.em (mmo_place_orphan): Adjust section_tail when
	fiddling with section list.
	* emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
2001-12-17 00:40:53 +00:00