diff --git a/contrib/binutils/bfd/ChangeLog b/contrib/binutils/bfd/ChangeLog index 987bd681bc59..b0c0d9bd9d2c 100644 --- a/contrib/binutils/bfd/ChangeLog +++ b/contrib/binutils/bfd/ChangeLog @@ -1,1883 +1,1888 @@ +2002-07-20 Jason Thorpe + + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only insert + DT_PLTGOT into the dynamic section if there is a PLT. + 2002-05-14 Daniel Jacobowitz * configure.in: Set is_release=y for 2.12.1 release. * configure: Likewise. 2002-05-13 David Edelsohn * configure.in: Auto-configure HAVE_ST_C_IMPL. * configure: Regenerate. * config.in: Regenerate. * rs6000-core.c (CNEW_IMPL): Guard use of c_impl with HAVE_ST_C_IMPL or AIX_5_CORE. 2002-05-11 Daniel Jacobowitz Merge from mainline (to elf32-mips.c): 2002-05-03 H.J. Lu (hjl@gnu.org) * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local. (mips_elf_link_hash_newfunc): Initialize forced_local to false. (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol to hide a global symbol. (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set forced_local to true. 2002-05-11 Ralf Corsepius Daniel Jacobowitz * coff-sh.c (sh_reloc_map): Map to R_SH_IMM32 for non-PE. Don't map BFD_RELOC_RVA. 2002-05-09 Alan Modra * elf64-ppc.c (RA_REGISTER_MASK, RA_REGISTER_SHIFT): Delete. Merge from mainline 2002-05-08 Alan Modra * elf32-ppc.c (ppc_elf_create_got): New function. (ppc_elf_create_dynamic_sections): Call ppc_elf_create_got before _bfd_elf_create_dynamic_sections. Correct .plt flags. (ppc_elf_check_relocs): Use ppc_elf_create_got in place of _bfd_elf_create_got_section. 2002-05-07 Alan Modra * elf-bfd.h (struct elf_backend_data): Add rela_normal. * elfxx-target.h (elf_backend_rela_normal): Define. (elfNN_bed): Init rela_normal. * elflink.h (elf_link_input_bfd ): Handle adjustment for section symbols here if rela_normal. Simplify abs section test. * elf-m10200.c (mn10200_elf_relocate_section): If relocatable, return immediately. Remove code handling relocatable linking. * elf-m10300.c (mn10300_elf_relocate_section): Likewise. * elf32-fr30.c (fr30_elf_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-i860.c (elf32_i860_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-mcore.c (mcore_elf_relocate_section): Likewise. * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-s390.c (elf_s390_relocate_section): Likewise. * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. * elf64-s390.c (elf_s390_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. * elf32-arm.h (elf32_arm_relocate_section): Likewise #ifndef USE_REL. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. * elf-m10200.c (elf_backend_rela_normal): Define. * elf-m10300.c (elf_backend_rela_normal): Define. * elf32-fr30.c (elf_backend_rela_normal): Define. * elf32-i370.c (elf_backend_rela_normal): Define. * elf32-i860.c (elf_backend_rela_normal): Define. * elf32-m68k.c (elf_backend_rela_normal): Define. * elf32-mcore.c (elf_backend_rela_normal): Define. * elf32-openrisc.c (elf_backend_rela_normal): Define. * elf32-ppc.c (elf_backend_rela_normal): Define. * elf32-s390.c (elf_backend_rela_normal): Define. * elf32-xstormy16.c (elf_backend_rela_normal): Define. * elf64-ppc.c (elf_backend_rela_normal): Define. * elf64-s390.c (elf_backend_rela_normal): Define. * elf64-x86-64.c (elf_backend_rela_normal): Define. * elfxx-ia64.c (elf_backend_rela_normal): Define. * elf32-arm.h (elf_backend_rela_normal): Define #ifndef USE_REL. * elf32-m32r.c (elf_backend_rela_normal): Likewise. 2002-05-06 Alan Modra * elflink.h (elf_link_input_bfd ): Adjust r_offset when not relocatable. Fix reloc_emitter call for K&R. 2002-05-04 Alan Modra * dwarf2.c (struct line_head): Make prologue_length a bfd_vma. (read_abbrevs): Change "offset" param to bfd_vma. (parse_comp_unit): Change "version" and addr_size to unsigned ints. Change "abbrev_offset" to bfd_vma. (read_indirect_string): Use correct conversion chars in error message format string, cast bfd_vma's to unsigned long. (read_abbrevs): Likewise. (read_attribute_value): Likewise. (decode_line_info): Likewise. (scan_unit_for_functions): Likewise. (parse_comp_unit): Likewise. 2002-05-04 Bob Byrnes * opncls.c (_bfd_new_bfd_contained_in): Check return value of _bfd_new_bfd. 2002-05-02 Alan Modra * elf64-ppc.c (ppc64_elf_howto_raw ): Change to a 16 bit reloc. : Likewise. (ppc64_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to SECTOFF reloc. * elf32-ppc.c (ppc_elf_howto_raw ): Correct. (ppc_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to SECTOFF reloc. * elf64-ppc.c (ppc64_elf_addr16_ha_reloc): Delete. (ppc64_elf_ha_reloc): New function. (ppc64_elf_brtaken_reloc): New function. (ppc64_elf_sectoff_reloc): New function. (ppc64_elf_sectoff_ha_reloc): New function. (ppc64_elf_toc_reloc): New function. (ppc64_elf_toc_ha_reloc): New function. (ppc64_elf_toc64_reloc): New function. (ppc64_elf_unhandled_reloc): New function. (ppc64_elf_howto_raw): Use the above. : Mark pc_relative, pcrel_offset. : Not pc_relative or pcrel_offset. Fix dst_mask. : Likewise. (IS_ABSOLUTE_RELOC): Update. (struct ppc_link_hash_table): Add have_undefweak. (ppc64_elf_link_hash_table_create): Init. (func_desc_adjust): Set have_undefweak. (ppc64_elf_func_desc_adjust): Call func_desc_adjust earlier. Only add the .sfpr blr when have_undefweak. (ppc64_elf_set_toc): Rename to ppc64_elf_toc, remove info param and relocatable test. Return TOCstart and don't set elf_gp. (ppc64_elf_relocate_section): Correct BRTAKEN/BRNTAKEN branch offset calculation. Add assert on weak sym branch tweaks. * elf64-ppc.h (ppc64_elf_set_toc): Delete. (ppc64_elf_toc): Declare. 2002-05-01 Alan Modra * syms.c (_bfd_stab_section_find_nearest_line): Don't bomb on NULL file_name. 2002-05-01 Alan Modra * elf64-ppc.c (CROR_151515, CROR_313131): Define. (ppc64_elf_relocate_section): Use them. Don't look for plt calls on R_PPC64_ADDR24 relocs. Require a nop or no link reg on plt call branches. Correct undefined weak destination. (ppc64_elf_func_desc_adjust): Always create at least one blr in .sfpr, and correct case where either only savef* or restf* is needed. 2002-04-09 DJ Delorie * elfarm-nabi.c (elf32_arm_howto_table): Fix ABS16 masks. 2002-05-06 Nick Clifton * elf32-arm.h (elf32_arm_final_link_relocate): Convert 'reloc_signed_max' and 'reloc_signed_min' into half-word offsets. 2002-05-02 Richard Henderson * elf64-alpha.c (elf64_alpha_relocate_section): Force relative relocs vs SHN_UNDEF to zero. 2002-04-27 Alan Modra Merge from mainline 2002-04-12 Alan Modra * elf.c (prep_headers): Don't zero EI_OSABI, EI_ABIVERSION or header pad. 2002-02-21 Andreas Jaeger * elf64-x86-64.c: Major rework that introduces all recent changes to the x86-64 backend. Get a closer match to elf32-i386. (struct elf64_x86_64_dyn_relocs): Rename from elf64_x86_64_pcrel_relocs_copied, add additional fields. Change all users. (struct elf64_x86_64_link_hash_table): Add short cuts to some sections. (link_hash_newfunc): Rename from elf64_x86_64_link_hash_newfunc, remove casts, initialize new hash members. (create_got_section): New. (elf64_x86_64_create_dynamic_sections): New. (elf64_x86_64_copy_indirect_symbol): New. (elf64_x86_64_check_relocs): Don't allocate space for dynamic relocs, .got or .relgot here but do it in allocate_dynrelocs. Reference count possible .plt and .got entries. Don't test input section SEC_READONLY here to try to avoid copy relocs, and keep dyn_relocs regardless of ELF_LINK_NON_GOT_REF. Don't set DF_TEXTREL here. Delay setting of variables until needed. Cache pointer to "sreloc" section in elf_section_data. Tweak condition under which .got created. Report files with bad relocation section names. (elf64_x86_64_gc_sweep_hook): Sweep dyn_relocs and local_dynrel. Reference count possible .plt entries. Don't deallocate .got and .relgot space here. (elf64_x86_64_adjust_dynamic_symbol): Handle nocopyreloc. Don't do copy reloc processing for weakdefs. Remove redundant casts and aborts. Delay setting of vars until needed. Move creation of dynamic symbols and allocation of .plt and .rela.plt to allocate_dynrelocs. Replace BFD_ASSERT with abort. (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. (allocate_dynrelocs): New. (readonly_dynrelocs): New. (elf64_x86_64_size_dynamic_sections): Call readonly_dynrelocs. Allocate space for dyn relocs. Replace BFD_ASSERT with abort. Zero out the dynamic allocated content space. (elf64_x86_64_discard_copies): Removed. (elf64_x86_64_relocate_section): Make use of dynamic section short-cuts. Localise vars, and delay setting. Better error reporting, replace BFD_ASSERT with abort. Check ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined in the regular object file and tread the weak definition as the normal one. Don't discard relocs for undefweak or undefined symbols and check !DEF_REGULAR as well as DEF_DYNAMIC in test for avoided copy relocs. (elf64_x86_64_finish_dynamic_symbol): Don't copy relocs for symbols that have been forced local. Use same test to decide if we can use a relative reloc for got as relocate_section. Expand SHN_UNDEF comment. Move expressions out of function calls. Replace BFD_ASSERT with abort. (bfd_elf64_bfd_final_link): Removed. (elf_backend_copy_indirect_symbol): Define. * reloc.c: Move sh relocs to where they belong. * libbfd.h, bfd-in2.h: Regenerate. Merge from mainline 2002-04-26 Alan Modra * opncls.c (bfd_make_readable): Call bfd_section_list_clear. * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise. * elflink.h (elf_bfd_final_link): Ensure input bfd class is the same as the output before calling elf_link_input_bfd. * coffcode.h (coff_compute_section_file_positions): Set section_tail after shuffling section list. 2002-04-23 Alan Modra * elf32-hppa.c (hppa_type_of_stub): Correct and simplify condition under which a plt call stub is used. (final_link_relocate): Similarly. (allocate_plt_static): Clear h-plabel except when plt entry is exclusively used for a plabel. (allocate_dynrelocs): Use the above to simplify plt sizing. (struct elf32_hppa_link_hash_table): Add has_22bit_branch. (elf32_hppa_link_hash_table_create): Init. (BL22_RP): Define. (hppa_build_one_stub): Use BL22_RP if has_22bit_branch. (elf32_hppa_check_relocs): Set has_22bit_branch. * elf32-hppa.c (elf32_hppa_check_relocs): Remove debug message. (final_link_relocate): Likewise. 2002-04-20 Alan Modra * archures.c (bfd_arch_info): Add comment on list order. (bfd_default_set_arch_mach): Use bfd_lookup_arch. * cpu-powerpc.c (bfd_powerpc_archs): Re-order so that the default is always at head of list. * bfd-in2.h: Regenerate. 2002-04-16 Alan Modra * elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table type rather than just assuming entries are ELF. * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise. * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise. * elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise. * elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry rather than elf_link_hash_entry. 2002-04-15 Alan Modra * elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type. 2002-04-08 Randolph Chung * elf32-hppa.c (hppa_unwind_entry_compare): Move to elf-hppa.h. (elf32_hppa_final_link): Split out sorting logic to.. * elf-hppa.h (elf_hppa_sort_unwind): ..here. (elf_hppa_final_link): Call elf_hppa_sort_unwind. 2002-04-26 Richard Smith Jakub Jelinek * elf-eh-frame.c (struct eh_cie_fde): Add per_encoding_relative. (_bfd_elf_discard_section_eh_frame): Set it for CIEs with pcrel encoded personality. (_bfd_elf_write_section_eh_frame): Adjust pcrel encoded personality for CIE/FDE removal. 2002-04-26 Jakub Jelinek * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't build search table if some FDE is DW_EH_PE_aligned encoded either. (_bfd_elf_write_section_eh_frame): Handle terminating FDE specially. 2002-04-18 Nick Clifton * coff-arm.c (coff_thumb_pcrel_12, coff_thumb_pcrel_9, insert_thumb_branch, record_thumb_to_arm_glue): Suppress definition of these functions for ARM_WINCE builds as they are not used. (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET): Do not define for ARM_WINCE builds. 2002-04-16 Nick Clifton * ihex.c (ihex_write_object_contents): Fix check for records crossing 64K boundaries. 2002-04-06 Hans-Peter Nilsson * elf32-cris.c (cris_elf_howto_table) : Fix typo in name. (cris_elf_check_relocs): Always create .rela.got here when R_CRIS_16_GOTPLT or R_CRIS_32_GOTPLT is seen. (elf_cris_adjust_gotplt_to_got): Don't create .rela.got here; assume it's created. 2002-04-04 Alan Modra * configure.in: Bump version to 2.12.1 and comment out is_release. * configure: Regenerate. * dep-in.sed: Cope with absolute paths. * Makefile.am (dep.sed): Subst TOPDIR, and not INCDIR. Run "make dep-am". * Makefile.in: Regenerate. Merge from mainline 2002-04-04 Alan Modra * srec.c (MAXCHUNK, Chunk): Revise comments. (srec_write_record): Correct buffer size. (srec_write_header): Do without intermediate buffer. (srec_write_section): Validate Chunk. (srec_write_terminator): Pass NULL instead of dummy buffer. (srec_write_symbols): Pass file and symbol names directly to bfd_bwrite so sprintf won't overflow buffer. 2002-04-03 Jakub Jelinek * elf32-sparc.c (elf32_sparc_relocate_section): Don't emit dynamic PC relative relocs against hidden symbols. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. 2002-04-03 Alan Modra * elf.c (_bfd_elf_make_section_from_shdr): When setting section LMAs, loop over segments until p_vaddr and p_memsz specify an extent enclosing the section. 2002-04-02 Nick Clifton * ihex.c (ihex_write_object_contents): Do not allow records to cross a 64K boundary - wrap if necessary. 2002-03-28 Alan Modra * linker.c (link_action): Ignore duplicate warning syms. (_bfd_generic_link_write_global_symbol): Follow warning symbol link. * elflink.h (elf_adjust_dynstr_offsets): Likewise. (elf_adjust_dynamic_symbol): Likewise. (elf_export_symbol): Likewise. (elf_link_find_version_dependencies): Likewise. (elf_link_assign_sym_version): Likewise. (elf_link_sec_merge_syms): Likewise. (elf_link_output_extsym): Likewise. (elf_gc_sweep_symbol): Likewise. (elf_gc_propagate_vtable_entries_used): Likewise. (elf_gc_smash_unused_vtentry_relocs): Likewise. (elf_gc_allocate_got_offsets): Likewise. (elf_collect_hash_codes): Likewise. * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise. * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise. (elf_hppa_remark_useless_dynamic_symbols): Likewise. * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. * elf32-arm.h (elf32_arm_discard_copies): Likewise. * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise. (elf_cris_discard_excess_dso_dynamics): Likewise. * elf32-hppa.c (clobber_millicode_symbols): Likewise. (mark_PIC_calls): Likewise. (allocate_plt_static): Likewise. (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-i386.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. * elf32-m68k.c (elf_m68k_discard_copies): Likewise. * elf32-mips.c (mips_elf_output_extsym): Likewise. (mips_elf_sort_hash_table_f): Likewise. (mips_elf_check_mips16_stubs): Likewise. * elf32-s390.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf32-sh.c (sh_elf_discard_copies): Likewise. * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise. (xstormy16_relax_plt_realloc): Likewise. * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise. (elf64_alpha_output_extsym): Likewise. * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise. * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise. (mips_elf64_check_mips16_stubs): Likewise. (mips_elf64_output_extsym): Likewise. * elf64-ppc.c (func_desc_adjust): Likewise. (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf64-s390.c (allocate_dynrelocs): Likewise. (readonly_dynrelocs): Likewise. * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. * elf64-x86-64.c (elf64_x86_64_discard_copies): Likewise. * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise. * aoutx.h (aout_link_write_other_symbol): Likewise. * cofflink.c (_bfd_coff_write_task_globals): Likewise. (_bfd_coff_write_global_sym): Likewise. * i386linux.c (linux_tally_symbols): Likewise. * m68klinux.c (linux_tally_symbols): Likewise. * sparclinux.c (linux_tally_symbols): Likewise. * pdp11.c (aout_link_write_other_symbol): Likewise. * sunos.c (sunos_scan_dynamic_symbol): Likewise. * xcofflink.c (xcoff_build_ldsyms): Likewise. (xcoff_write_global_symbol): Likewise. * cofflink.c (_bfd_coff_final_link): Formatting. * elf32-i386.c (elf_i386_check_relocs): Formatting. * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. * elf64-alpha.c (elf64_alpha_output_extsym): Likewise. * elf64-mips.c (mips_elf64_sort_hash_table): Likewise. (mips_elf64_final_link): Likewise. * elflink.h (elf_link_find_version_dependencies): Remove duplicate prototype. 2002-03-21 Richard Earnshaw * elf32-arm.h (elf32_arm_final_link_relocate , ): Handle relocations to Thumb functions. 2002-03-19 Hans-Peter Nilsson * elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set STT_NOTYPE symbols to STT_OBJECT. 2002-03-13 Alan Modra * archures.c (bfd_default_compatible): Test bits_per_word. * cpu-i386.c (i386_compatible): Remove. Replace occurrences with bfd_default_compatible. * cpu-i370.c (i370_compatible): Likewise. * cpu-sparc.c (sparc_compatible): Likewise. * cpu-h8300.c (compatible): Test in->arch == out->arch. 2002-02-19 Martin Schwidefsky * archures.c (bfd_mach_s390_esa): Rename to bfd_mach_s390_31. (bfd_mach_s390_esame): Rename to bfd_mach_s390_64. * bfd-in2.h: Regenerate. * cpu-s390.c (arch_info_struct): Use renamed architecture defines. Replace architecture name "s390" with "s390:31-bit" and "s390:esame" with "s390:64-bit". * elf32-s390.c (elf_howto_table): Add 32 bit pc relative relocations. (elf_s390_reloc_type_lookup): Likewise. (elf_s390_check_relocs): Likewise. (elf_s390_gc_sweep_hook): Likewise. (elf_s390_relocate_section): Likewise. (elf_s390_object_p): Use renamed architecture define. * elf64-s390.c (elf_s390_object_p): Use renamed architecture define. 2002-04-03 Alan Modra Merge from mainline. 2002-03-28 Alan Modra * cpu-mips.c (mips_compatible): Make static, prototype. 2002-03-14 Alan Modra * cpu-mips.c (mips_compatible): New. Don't check bits_per_word. (N): Use the above. 2002-04-01 Nathan Williams * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error which caused the returned LWP ID to always be 0. 2002-04-01 Richard Henderson * elf32-sparc.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. (elf32_sparc_relocate_section): Use it to figure out when to initialize .got entries. * elf64-sparc.c: Similarly. 2002-03-28 Alan Modra * aclocal.m4: Regenerate. * config.in: Regenerate. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. Merge from mainline 2002-03-27 Gregory Steuck * elf.c (_bfd_elf_get_symtab_upper_bound): Leave space for terminating NULL if empty symbol table. (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise. 2002-03-26 Alan Modra * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections. 2002-03-23 Alan Modra * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on section file offset for !SEC_LOAD sections. 2002-03-20 Daniel Jacobowitz * dwarf2.c (struct funcinfo): Move up. (lookup_address_in_function_table): New argument function_ptr. Set it. (lookup_address_in_line_table): New argument function. If function is non-NULL, use it to handle ``addr'' before the first line note of the function. (comp_unit_find_nearest_line): Update and swap calls to lookup_address_in_function_table and lookup_address_in_line_table. * syms.c (_bfd_stab_section_find_nearest_line): Use the first N_SLINE encountered if we see an N_FUN before any N_SLINE. 2002-03-18 Alan Modra * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success. * libbfd.h: Regenerate. * archive.c (coff_write_armap): Pass on failures from bfd_write_bigendian_4byte_int. 2002-03-14 H.J. Lu * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD error to bfd_error_nonrepresentable_section for reinit_array section in DSO. 2002-03-14 Nick Clifton * coffcode.h (coff_slurp_symbol_table): When adding BSF_WEAK flag, OR it in rather than replacing previously selected flags. * elfxx-target.h (TARGET_BIG_SYM): Set ar_max_namelen to 15. (TARGET_LITTLE_SYM): Set ar_max_namelen to 15. 2002-03-14 Alan Modra * elflink.h (elf_bfd_final_link): Revert last change. Instead, ensure reloc size matches before calling elf_link_input_bfd. Add an assert to check reloc size when counting output relocs. 2002-03-14 Nick Clifton * mmo.c (mmo_get_loc): Return NULL rather than false. 2002-03-13 Alan Modra * elflink.h: Formatting fixes. (elf_link_output_extsym): Merge undefined and undef weak cases. * elflink.h (elf_bfd_final_link): Only call elf_link_input_bfd when word size of input matches output word size. 2002-03-07 H.J. Lu (hjl@gnu.org) * coff-sh.c (shcoff_reloc_map): Use bfd_reloc_code_real_type as the type for bfd_reloc_val. 2002-03-05 John David Anglin * elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function. (elf_hppa_relocate_section): Ignore undefined dynamic loader symbols. (elf_hppa_final_link_relocate): Correct relocations for indirect references to local data through the DLT. Fix .opd creation for local symbols using R_PARISC_LTOFF_FPTR32 and R_PARISC_FPTR64 relocations. Use e_lsel selector for R_PARISC_DLTIND21L, R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_TP21L as per "Processor-Specific ELF for PA_RISC, Version 1.43" document. Similarly, use e_rsel for DLT and LTOFF 'R' relocations. * elf32-hppa.c (final_link_relocate): Revise relocation selectors as per "Processor-Specific ELF for PA_RISC, Version 1.43" document. 2002-03-05 Jakub Jelinek * merge.c (_bfd_merge_sections): Don't segfault if there is nothing to merge due to GC. 2002-03-05 Alan Modra * elf32-hppa.c (clobber_millicode_symbols): Remove hack to keep symbols that have been forced local. * elflink.h (elf_bfd_final_link): Call elf_link_output_extsym to output forced local syms for non-shared link. (elf_link_output_extsym): Tweak condition for calling backend adjust_dynamic_symbol so that previous behaviour is kept. Whitespace changes throughout file. 2002-03-04 H.J. Lu * elf.c (bfd_section_from_shdr): Handle special sections, .init_array, .fini_array and .preinit_array. (elf_fake_sections): Likewise. * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the DT entry only if the section is in output for .init_array, .fini_array and .preinit_array. Complain about .preinit_array section in DSO. (elf_bfd_final_link): Warn zero size for .init_array, .fini_array and .preinit_array sections. * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY. (elfNN_ia64_fake_sections): Remove .init_array, .fini_array and .preinit_array. 2002-03-01 David Mosberger * elflink.h (size_dynamic_sections): If section named ".preinit_array" exists, create DT_PREINIT_ARRAY and DT_PREINIT_ARRAYSZ entries in dynamic table. Analogously for ".init_array" and ".fini_array". (elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ, DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and DT_FINI_ARRAY. 2002-02-19 Frank Ch. Eigler * syms.c (stt[]): Sorted. Added .init/.fini -> "t" mapping. 2002-02-13 Nick Clifton * elf.c (_bfd_elf_make_section_from_shdr): Do not insist on non-zero physical addresses when adjusting the LMAs of new sections. 2002-02-11 Michael Snyder * elf-bfd.h (elfcore_write_lwpstatus): Add prototype. * elf.c (elfcore_grok_pstatus): Add prototype. (elfcore_grok_lwpstatus): Add prototype. (elfcore_write_lwpstatus): New function. (elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy. 2002-03-20 Tom Rix * coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from _bfd_xcoff_generic_stat_arch_elt. Fix format check. * coff64-rs6000.c : Use _bfd_xcoff_stat_arch_elt. Mon Mar 18 18:06:54 CET 2002 Jan Hubicka * cpu-i386.c (bfd_x86_64_arch): Rename to "i386:x86-64" 2002-03-07 Daniel Jacobowitz * configure.in: Set is_release=y for 2.12 release. * configure: Likewise. 2002-03-07 Daniel Jacobowitz * configure.in: Bump version to 2.12. * configure: Likewise. 2002-03-05 Alan Modra * configure.in (WIN32LIBADD): Don't eval PICFLAG assignment. * configure: Regenerate. 2002-02-26 Andrew Macleod * elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local dynsyms. 2002-02-25 Alan Modra * elf64-ppc.c (ppc64_elf_check_relocs): Warning fix. (ppc64_elf_relocate_section): Don't generate power4 style branch hints for *_BRTAKEN and *_BRNTAKEN relocs. * elf64-ppc.c (STFD_FR0_0R1, LFD_FR0_0R1, BLR): Define. (struct ppc_link_hash_table): Add sfpr. (ppc64_elf_link_hash_table_create): Init it. (ppc64_elf_create_dynamic_sections): Split creation of .stub and .glink out to.. (create_linkage_sections): ..here. Make .sfpr too. (ppc64_elf_check_relocs): Call create_linkage_sections, and set dynobj early. (MIN_SAVE_FPR, MAX_SAVE_FPR): Define. (ppc64_elf_func_desc_adjust): Look for missing ._savef* and ._restf* functions, and create as needed. (func_desc_adjust): Only force_local for shared libs. 2002-02-22 Jakub Jelinek * elf64-sh64.c (sh_elf64_relocate_section): Fix a typo from my last patch. * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. 2002-02-20 Peter Schauer * osf-core.c (osf_core_vec): OSF/1 (Digital Unix) core files are little endian. 2002-02-19 Jakub Jelinek * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Enable absptr -> pcrel optimization for shared libs. Only create minimal .eh_frame_hdr if absptr FDE encoding in shared library cannot be converted to pcrel. (_bfd_elf_eh_frame_section_offset): Return -2 if making absptr relative. * elf32-i386.c (elf_i386_relocate_section): If _bfd_elf_section_offset returned -2, skip, but make sure the relocation is installed. * elf32-arm.h (elf32_arm_final_link_relocate): Likewise. * elf32-cris.c (cris_elf_relocate_section): Likewise. * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-m68k.c (elf_m68k_relocate_section): Likewise. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. * elf32-s390.c (elf_s390_relocate_section): Likewise. * elf32-sh.c (sh_elf_relocate_section): Likewise. * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. * elf64-s390.c (elf_s390_relocate_section): Likewise. * elf64-sh64.c (sh_elf64_relocate_section): Likewise. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Handle _bfd_elf_section_offset returning -2 the same way as -1. * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise. * elf32-mips.c (mips_elf_create_dynamic_relocation): Add FIXME and BFD_ASSERT. * elf64-mips.c (mips_elf64_create_dynamic_relocation): Likewise. 2002-02-18 John David Anglin * elf-hppa.h (elf_hppa_reloc_final_type): New function stripped from _bfd_elf_hppa_gen_reloc_type. (_bfd_elf_hppa_gen_reloc_type): Remove duplicate prototype. * elf32-hppa.h (elf32_hppa_reloc_final_type): Add protptype. * elf32-hppa.c: Include elf32-hppa.h before elf-hppa.h. * elf64-hppa.h (elf64_hppa_reloc_final_type): Add protptype. 2002-02-17 Hans-Peter Nilsson * mmo.c: Correct and improve comments. (mmo_write_chunk): Store trailing byte in bfd buffer; don't zero-pad. Use input to fill up non-empty bfd buffer. (mmo_flush_chunk): New function. (mmo_write_loc_chunk): Add parameter last_vmap, all callers changed. Don't emit location specifier if VMA is same as *LAST_VMAP after omitting leading zero contents. Call mmo_flush_chunk before emitting location specifier. (mmo_write_loc_chunk_list): Call mmo_flush_chunk when finished with mmo_write_loc_chunk calls. (mmo_internal_write_section): Call mmo_flush_chunk after mmo_write_chunk. (mmo_write_symbols_and_terminator): Move :Main to first position in symbol array. Add faked one if it does not exist if there are other symbols. Don't add it if there are no symbols at all. Move out test for value of :Main from symbol loop. Rename table fakemain to maintable and variable mainsym to fakemain. 2002-02-15 Richard Henderson * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target section with no got matches any got. Simplify error generaion. 2002-02-14 Alan Modra * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD. 2002-02-13 Hans-Peter Nilsson * config.bfd (sh-*-linux*, sh-*-elf* | sh-*-rtemself*): Add sh64 vectors. (sh-*-netbsdelf*): New, to trump sh*-*-netbsdelf* and add sh64 vectors. 2002-02-13 Matt Fredette * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Recognize EF_M68000. 2002-02-12 Alexandre Oliva * elf-m10300.c (mn10300_elf_relax_section): Skip section before loading its contents if there's nothing to do in it. 2002-02-12 Alan Modra * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing 64k boundary. * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Add dynamic DT_PPC64_OPD and DT_PPC64_OPDSZ tags. (ppc64_elf_finish_dynamic_sections): Set values for them. 2002-02-11 Alexandre Oliva * elf32-sh.c: Added missing prototypes. * elf32-sh64.c: Likewise. (sh_elf_align_loads): Mark unused args as such. * elf64-sh64.c: Added missing prototypes. (struct elf_sh64_link_hash_entry): Fix typo. (sh_elf64_relocate_section): Fix info argument passed to _bfd_elf_section_offset. 2002-02-10 Daniel Jacobowitz * coff-rs6000.c (xcoff_generate_rtinit): Silence uninitialized variable warnings. * elf32-sh.c (sh_elf_relax_section): Silence signed/unsigned comparison warning. * trad-core.c (trad_unix_core_file_p): Silence pointer/integer cast warnings for the common case. 2002-02-09 Richard Henderson * elf64-alpha.c (elf64_alpha_howto): Add R_ALPHA_BRSGP. (elf64_alpha_reloc_map, elf64_alpha_check_relocs): Likewise. (elf64_alpha_relocate_section): Likewise. * reloc.c (BFD_RELOC_ALPHA_BRSGP): New. * bfd-in2.h, libbfd.h: Rebuild. 2002-02-09 Hans-Peter Nilsson * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): Check that base-plus-offset reloc accounting is consistent. (mmix_elf_relax_section): Keep base-plus-offset reloc accounting up to date for undefined symbols. 2002-02-08 Eric Christopher From Rainer Orth * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela sections for the O32 ABI. 2002-02-08 Chris Demetriou * elf32-arm.h: Fix formatting of _("..."). * elf32-d10v.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mips.c: Likewise. 2002-02-08 Ivan Guzvinec * coff-or32.c: Fix compile time warning messages. 2002-02-08 Alexandre Oliva Contribute sh64-elf. 2002-01-23 Alexandre Oliva * reloc.c (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16, R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16, R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16, R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16, R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16, R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16, R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16, R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, R_SH_GOTPLT10BY8, R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, R_SH_RELATIVE64): New relocs. * libbfd.h, bfd-in2.h: Rebuilt. * elf32-sh.c (sh_elf_howto_table): Define new relocs. (sh_reloc_map): Map them. (PLT_ENTRY_SIZE, elf_sh_plt0_entry_be, elf_sh_plt0_entry_le, elf_sh_plt_entry_be, elf_sh_plt_entry_le, elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le, elf_sh_plt0_entry, elf_sh_plt_entry, elf_sh_pic_plt_entry, elf_sh_sizeof_plt, elf_sh_plt_plt0_offset, elf_sh_plt0_gotplt_offset, elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset, elf_sh_plt_reloc_offset, movi_shori_putval) [INCLUDE_SHMEDIA]: New. (elf_sh_link_hash_entry) [INCLUDE_SHMEDIA]: Add datalabel_got_offset. (sh_elf_link_hash_newfunc): Initialize it. (sh_elf_relocate_section): Augment the scope of seen_stt_datalabel. Introduce GOTPLT support. Extend GOTPC, PLT, GOT and GOTOFF handling to new SHmedia relocation types. Support GOT_BIAS. (sh_elf_check_relocs): Likewise. (sh_elf_finish_dynamic_symbol) [TARGET_SHMEDIA]: Set up values in PLT entries using movi_shori_putval. Support GOT_BIAS. (sh_elf_finish_dynamic_sections): Likewise. * elf32-sh64.c (shmedia_prepare_reloc): Do not add addend to relocation, it's now done by the caller. (GOT_BIAS): New. * elf64-sh64.c (GOT_BIAS, PLT_ENTRY_SIZE, elf_sh64_sizeof_plt, elf_sh64_plt_plt0_offset, elf_sh64_plt0_gotplt_offset, elf_sh64_plt_temp_offset, elf_sh64_plt_symbol_offset, elf_sh64_plt_reloc_offset, ELF_DYNAMIC_INTERPRETER, elf_sh64_pcrel_relocs_copied, elf_sh64_link_hash_entry, elf_sh64_link_hash_table, sh64_elf64_link_hash_traverse, sh64_elf64_hash_table): New. (sh_elf64_howto_table): Introduce new relocs. (sh_elf64_info_to_howto): Accept new PIC relocs. (sh_elf64_relocate_section): Augment the scope of seen_stt_datalabel. Support new PIC relocs. (sh_elf64_check_relocs): Support new PIC relocs. (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le, elf_sh64_plt_entry_be, elf_sh64_plt_entry_le, elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le, elf_sh64_plt0_entry, elf_sh64_plt_entry, elf_sh64_pic_plt_entry, sh64_elf64_link_hash_newfunc, sh64_elf64_link_hash_table_create, movi_shori_putval, movi_3shori_putval, sh64_elf64_create_dynamic_sections, sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections, sh64_elf64_finish_dynamic_symbol, sh64_elf64_finish_dynamic_sections): New. (elf_backend_create_dynamic-sections, bfd_elf64_bfd_link_hash_table_create, elf_backend_adjust_dynamic_symbol, elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol, elf_backend_finish_dynamic_sections, elf_backend_want_got_plt, elf_backend_plt_readonly, elf_backend_want_plt_sym, elf_backend_got_header_size, elf_backend_plt_header_size): Define. 2001-05-16 Alexandre Oliva * elf32-sh.c: Renumbered and renamed some SH5 relocations to match official numbers and names; moved unmaching ones to the range 0xf2-0xff. * elf32-sh64.c, elf64-sh64.c: Likewise. 2001-03-12 DJ Delorie * elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia sections. 2001-03-12 DJ Delorie * elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must be aligned. * elf64-sh64.c (sh_elf64_relocate_section): Ditto. 2001-01-14 Hans-Peter Nilsson * elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define. (sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a .cranges section with SEC_SORT_ENTRIES set. (sh64_backend_section_from_shdr): Set SEC_SORT_ENTRIES on an incoming sorted .cranges section. (sh64_bfd_elf_copy_private_section_data): New. (sh64_elf_final_write_processing): Only sort .cranges and modify start address if called by linker. 2001-01-08 Ben Elliston * elf32-sh64.c (sh64_elf_final_write_processing): Activate Hans-Peter Nilsson's set bit 0 patch from 2001-01-06. * elf64-sh64.c (sh64_elf64_final_write_processing): Ditto. 2001-01-06 Hans-Peter Nilsson * elf64-sh64.c (sh_elf64_howto_table): No open brace at start of line. Add comments before all entries. : Correct and clarify describing comment. (sh_elf64_reloc): Correct head comment. (sh_elf64_relocate_section): Correct spacing. : Do not honour STO_SH5_ISA32; instead call reloc_dangerous callback. : New case. (sh_elf64_gc_mark_hook): Correct spacing. (sh_elf64_check_relocs): Ditto. * elf32-sh64.c (shmedia_prepare_reloc) : New case. * elf32-sh.c: Correct #endif comments for #ifndef-wrapped functions. (sh_elf_howto_table) : Correct, clarify describing comment. Add comments before all entries. (sh_elf_relocate_section) : Do not honour STO_SH5_ISA32; instead call reloc_dangerous callback. 2001-01-06 Hans-Peter Nilsson Sort .cranges section in final link. Prepare to set bit 0 on entry address. * elf32-sh64.c (struct sh64_find_section_vma_data): New. (sh64_elf_link_output_symbol_hook): Fix typo in prototype. (sh64_elf_set_mach_from_flags): Set SEC_DEBUGGING on incoming .cranges section. (sh64_backend_section_from_shdr): New, to recognize SHT_SH5_CR_SORTED on incoming .cranges section. (elf_backend_section_from_shdr): Define. (sh64_elf_final_write_processing): Sort outgoing .cranges section. (New, temporarily disabled:) Set bit 0 on entry address according to ISA type. (sh64_find_section_for_address): New. (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb, crange_bsearch_cmpl): Move here from opcodes/sh64-dis.c. (sh64_address_in_cranges): Move here from opcodes/sh64-dis.c. Use bfd_malloc, not xmalloc. (sh64_get_contents_type): Move here from opcodes/sh64-dis.c. Make global. * elf32-sh64.c (sh64_elf64_final_write_processing): New, (but temporarily disabled) setting bit 0 on entry address. (elf_backend_final_write_processing): Define. 2001-01-05 Hans-Peter Nilsson * elf32-sh.c (sh_elf_howto_table) : Adjust fields to be a proper relocation for PTA and PTB rather than a marker. : Zero src_mask. * elf64-sh64.c: Ditto. (sh_elf64_relocate_section) : New case. * elf32-sh64.c: Include opcodes/sh64-opc.h (shmedia_prepare_reloc): Take a bfd_link_info pointer as first argument. Drop const qualifiers from "bfd *" and "bfd_byte *" parameters. No unused parameters. Caller changed. : New case. * Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h. * Makefile.in: Regenerate. 2000-12-30 Hans-Peter Nilsson * elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for all code sections. (sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5. (sh64_elf_merge_private_data): Ditto. * elf32-sh64.c (sh64_elf_fake_sections): Use sh64_elf_section_data to access stored section flags. (sh64_elf_final_write_processing): Return immediately unless called by linker. Use sh64_elf_section_data (cranges) to get size of linker-generated cranges entries. (sh64_elf_copy_private_data): Add missing "return true". (sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5. (sh_elf64_merge_private_data): Ditto. 2000-12-19 Hans-Peter Nilsson * elf64-sh64.c (sh64_elf64_fake_sections): New, copy of elf64-sh64.c:sh64_elf_fake_sections. (elf_backend_fake_sections): Define as sh64_elf64_fake_sections. 2000-12-18 Hans-Peter Nilsson * elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete. (sh64_elf_final_write_processing): New. (elf_backend_final_write_processing): Define. (sh64_elf_fake_sections): Get header flags from tdata field. (sh64_elf_copy_private_data): Do not call sh64_elf_copy_private_data_internal, just copy e_flags field. (sh64_elf_merge_private_data): Do not call sh64_elf_copy_private_data_internal. 2000-12-12 Hans-Peter Nilsson Remove EF_SH64_ABI64, let ELF size make difference. Remove SH64-specific BFD section flag. * elf32-sh64.c (sh64_elf_fake_sections): Recognize section as containing SHmedia through elf_section_data (asect)->tdata non-zero, not using a BFD section flag. (sh64_elf_set_mach_from_flags): Don't recognize EF_SH64_ABI64. (sh64_elf_merge_private_data): Similar. (elf_backend_section_flags): Don't define. (sh64_elf_backend_section_flags): Delete. * elf64-sh64.c (sh_elf64_set_mach_from_flags): Recognize EF_SH64, not EF_SH64_ABI64. (sh_elf64_merge_private_data): Similar. * section.c (Section flags definitions): Don't define SEC_SH_ISA_SHMEDIA. (bfd-in2.h): Regenerate. 2000-12-09 Hans-Peter Nilsson Make DataLabel references work with partial linking. * elf32-sh64.c: Fix formatting. (sh64_elf_link_output_symbol_hook): New. (elf_backend_link_output_symbol_hook): Define to sh64_elf_link_output_symbol_hook. (sh64_elf_add_symbol_hook): Make DataLabel symbol just global undefined if partial linking. Adjust sanity check. * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): New. (elf_backend_link_output_symbol_hook): Define to sh64_elf64_link_output_symbol_hook. (sh64_elf64_add_symbol_hook): Make DataLabel symbol just global undefined if partial linking. Adjust sanity check. 2000-12-07 Hans-Peter Nilsson Implement semantics for inter-file DataLabel references. * elf64-sh64.c (DATALABEL_SUFFIX): Define. (sh64_elf64_add_symbol_hook): New. (sh_elf64_relocate_section): If passing an indirect symbol with st_type STT_DATALABEL on the way to a symbol with st_other STO_SH5_ISA32, do not bitor 1 to the relocation. (elf_backend_add_symbol_hook): Define to sh64_elf64_add_symbol_hook. * elf64-sh32.c: Tweak comments. (DATALABEL_SUFFIX): Define. (sh64_elf_add_symbol_hook): New. (elf_backend_add_symbol_hook): Define to sh64_elf_add_symbol_hook. * elf32-sh.c (sh_elf_relocate_section): If passing an indirect symbol with st_type STT_DATALABEL on the way to a symbol with st_other STO_SH5_ISA32, do not bitor 1 to the relocation. 2000-12-05 Hans-Peter Nilsson Pass through STT_DATALABEL. * elf32-sh64.c (sh64_elf_get_symbol_type): New. (elf_backend_get_symbol_type): Define. * elf64-sh64.c (sh64_elf64_get_symbol_type): New. (elf_backend_get_symbol_type): Define. 2000-11-30 Hans-Peter Nilsson * elf32-sh64.c: Tweak comments. (sh64_elf_copy_private_data_internal): Add prototype. (bfd_elf32_bfd_set_private_flags): Define. (sh64_elf_copy_private_data_internal): Compare machine name, not textual BFD target name, to check whether to copy section flag SHF_SH5_ISA32. (sh64_elf_merge_private_data): Validize bfd_get_arch_size. Tweak section-contents-type-mismatch message. (shmedia_prepare_reloc): Add ATTRIBUTE_UNUSED markers. Validize reloc-types. * elf64-sh64.c: New file. * targets.c (bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec): Declare. * Makefile.am (BFD64_BACKENDS): Add elf64-sh64.lo. (BFD64_BACKENDS_CFILES): Add elf64-sh64.c. Regenerate dependencies. * Makefile.in: Regenerate. * config.bfd (sh64-*-elf*): Add bfd_elf64_sh64_vec and bfd_elf64_sh64l_vec. * configure.in: Handle bfd_elf64_sh64_vec and bfd_elf64_sh64l_vec. * configure: Regenerate. * po/POTFILES.in: Regenerate. * po/bfd.pot: Regenerate. 2000-11-29 Hans-Peter Nilsson * elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize anything else but EF_SH64 and EF_SH64_ABI64. (sh64_elf_merge_private_data): Emit error for anything else but EF_SH64 and EF_SH64_ABI64. * config.bfd: Remove bfd_elf32_shblin_vec and bfd_elf32_shlin_vec from targ_selvecs. * configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec as a temporary measure. * configure: Regenerate. 2000-11-27 Hans-Peter Nilsson * cpu-sh.c (arch_info_struct): Include sh5 item unconditionalized. * config.bfd (sh64-*-elf*): Do not set targ_cflags. Add targ_selvecs bfd_elf32_sh_vec, bfd_elf32_shl_vec, bfd_elf32_shblin_vec and bfd_elf32_shlin_vec. * elf32-sh64.c: Tweak comments. (sh64_elf_set_mach_from_flags): Recognize all machine flags that are proper subsets of SH64 as bfd_mach_sh5. Add EF_SH64_ABI64. (sh64_elf_copy_private_data_internal): Wrap long line. (sh64_elf_merge_private_data): Rewrite to allow objects from SH64 subsets to be linked together. (INCLUDE_SHMEDIA): Define. * elf32-sh.c (sh_elf_relocate_section) : Parenthesize plus-expression inside or-expression. : Ditto. (sh_elf_set_mach_from_flags): Remove code refusing deleted EF_SH64_32BIT_ABI flag. 2000-11-26 Hans-Peter Nilsson * elf32-sh.c (sh_elf_howto_table) : Set pcrel_offset to true. (sh_elf_relocate_section) : Or 1 in calculation of relocation if sym->st_other & STO_SH5_ISA32. : Ditto if h->other & STO_SH5_ISA32. * elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to relocation. 2000-11-24 Hans-Peter Nilsson * Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo. (BFD32_BACKENDS_CFILES): Add elf32-sh64.c. Regenerate dependencies. * Makefile.in: Regenerate. * archures.c: Add bfd_mach_sh5. * config.bfd: Map targ_cpu sh* to bfd_sh_arch. Handle sh64-*-elf*. Set targ_cflags to -DINCLUDE_SHMEDIA. * configure.in: Handle bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec. * configure: Regenerate. * reloc.c (BFD_RELOC_SH_SHMEDIA_CODE, BFD_RELOC_SH_IMMU5, BFD_RELOC_SH_IMMS6, BFD_RELOC_SH_IMMS6BY32, BFD_RELOC_SH_IMMU6, BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2, BFD_RELOC_SH_IMMS10BY4, BFD_RELOC_SH_IMMS10BY8, BFD_RELOC_SH_IMMS16, BFD_RELOC_SH_IMMU16, BFD_RELOC_SH_IMM_LOW16, BFD_RELOC_SH_IMM_LOW16_PCREL, BFD_RELOC_SH_IMM_MEDLOW16, BFD_RELOC_SH_IMM_MEDLOW16_PCREL, BFD_RELOC_SH_IMM_MEDHI16, BFD_RELOC_SH_IMM_MEDHI16_PCREL, BFD_RELOC_SH_IMM_HI16, BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16): New relocations. * cpu-sh.c [INCLUDE_SHMEDIA] (arch_info_struct): Define and link in item for SH5. * elf32-sh.c [INCLUDE_SHMEDIA] (sh_elf_howto_table): Add howto items for SHmedia relocs. [INCLUDE_SHMEDIA] (sh_rel): Add mappings for SHmedia relocs. [INCLUDE_SHMEDIA] (sh_elf_relocate_section) [default]: Call shmedia_prepare_reloc, goto final_link_relocate if it returns non-zero, else fail as before. (sh_elf_set_mach_from_flags): Provide function only if not defined as macro. Do not recognize objects with EF_SH64_32BIT_ABI set. (sh_elf_set_private_flags): Provide function only if not defined as a macro. (sh_elf_copy_private_data): Similar. (sh_elf_merge_private_data): Similar. * section.c (SEC_SH_ISA_SHMEDIA): New. * targets.c (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec): Declare. * elf32-sh64.c: New file. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. * po/POTFILES.in: Regenerate. * po/bfd.pot: Regenerate. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. 2002-02-07 Daniel Jacobowitz * bfd-in.h: Update check to only see if has been included, not drag it in. * bfd-in2.h: Regenerate. 2002-02-06 H.J. Lu (hjl@gnu.org) * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Update the mach and ISA fields if necessary. 2002-02-06 Nick Clifton * coffcode.h (coff_set_arch_mach_hook): Select the highest known ARM architecture when an F_ARM_5 flag is detected, since we cannot be sure exactly which architecture this represents. 2002-02-05 Nick Clifton * po/tr.po: Updated translation. 2002-02-05 Alan Modra From Jimi X * archures (bfd_mach_ppc64): Define. (bfd_powerpc_arch): Rename to bfd_powerpc_archs. (bfd_powerpc_arch): Define. * bfd-in2.h: Regenerate. * cpu-powerpc.c (arch_info_struct): Rename to bfd_powerpc_archs. (bfd_powerpc_arch): Move to tail of bfd_powerpc_archs. (bfd_powerpc_archs): Add default powerpc64 arch. 2002-02-05 Alan Modra * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs against section syms in readonly sections. Don't do the global sym check if we find one. * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. (elf_s390_grok_prstatus): Add missing prototype. 2002-02-04 Hans-Peter Nilsson * elf64-mmix.c (mmix_dump_bpo_gregs): New function. (mmix_elf_check_common_relocs) : Call bfd_get_section_by_name only once. Initialize bpodata->n_bpo_relocs_this_section. (_bfd_mmix_prepare_linker_allocated_gregs): Remove comment referring to DSOs. (bpo_reloc_request_sort_fn): Don't use difference of values as return-value. 2002-02-02 David O'Brien * configure.in: Tweak the FreeBSD 4.x recognition more. Only treat version 4.5 and later the same as 5-CURRENT. * configure: Re-generate. 2002-02-02 Jason Thorpe * config.bfd (hppa*-*-netbsd*): New target. 2002-01-31 Philipp Thomas * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR to front of message. Unify messages with elf32-arm.h. Use commas where neccessary. * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase ERROR in messages. Unify messages with coff-arm.c. Correct VFP/FPA error message. (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and APCS-32 for translation. 2002-02-01 Hans-Peter Nilsson Perform on-demand global register allocation from R_MMIX_BASE_PLUS_OFFSET relocs. * elf64-mmix.c (struct bpo_reloc_section_info, struct bpo_reloc_request, struct bpo_greg_section_info): New. (mmix_elf_check_common_relocs, mmix_elf_gc_sweep_hook, bpo_reloc_request_sort_fn, mmix_elf_relax_section, _bfd_mmix_check_all_relocs, _bfd_mmix_prepare_linker_allocated_gregs, _bfd_mmix_finalize_linker_allocated_gregs): New functions. (elf_mmix_howto_table): Correct src_mask for most relocs. (mmix_elf_perform_relocation) : New case. (mmix_final_link_relocate) : New case. Fix typo in comment. New label do_mmix_reloc. (mmix_elf_check_relocs): Abuse bfd_link_info member base_file to store first object file with a base-plus-offset reloc. Call mmix_elf_check_common_relocs for the part common with mmo. (mmix_elf_final_link): Write out linker-allocated register contents section. (elf_backend_gc_sweep_hook): Define. (bfd_elf64_bfd_relax_section): Define. * mmo.c: Don't include (mmo_init): Correct init-once logic. 2002-02-01 Tom Rix * config.bfd: Conditionally support for pre AIX 4.3. 2002-02-01 Alan Modra * Makefile.am: Run "make dep-am" * Makefile.in: Regenerate. 2002-01-31 David O'Brien * configure.in: Recognize the differences in core files from FreeBSD 4.{0,1} and later versions of 4.x. This treats 4.2+ the same as 5-CURRENT. * configure: Regenerate. 2002-01-31 Ivan Guzvinec * coff-or32.c: New file. * cpu-or32.c: New file. * elf32-or32.c: New file. * archures.c: Add support for or32. * targets.c: Add support for or32. * bfd-in2.h: Regenerate. * coffcode.h (coff_set_arch_mach_hook, coff_set_flags, coff_write_object_contents): Add support for or32. * config.bfd: Add target. * configure.in: Add support for or32. * configure: Regenerate. * Makefile.am: Add support for or32. * Makefile.in: Regenerate. * po/SRC-POTFILES.in: Add or32 files. * po/bfd.pot: Regenerate. 2002-01-31 Nick Clifton Don Lindsay * elf32-mips.c (mips_elf_calculate_relocation): Replace 'return false' with a return of a bfd_reloc_ error code. 2002-01-31 Hans-Peter Nilsson * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't unexport unreferenced symbols when --export-dynamic. Call _bfd_elf_strtab_delref when unexporting. 2002-01-30 Daniel Jacobowitz * bfd-in.h: Include if it is available. * bfd-in2.h: Regenerated. 2002-01-31 Alan Modra * elf64-ppc.c (func_desc_adjust): STV_PROTECTED functions should not go via the plt. 2002-01-30 Nick Clifton * archures.c: Tidy up formatting of embedded comments. * bfd.c: Tidy up formatting of embedded comments. * bfd-in.h: Fix formatting of comments. * reloc.c: Tidy up formatting of ordinary & embedded comments. * section.c: Tidy up formatting of embedded comments. * syms.c: Tidy up formatting of embedded comments. * targets.c: Tidy up formatting of embedded comments. * bfd-in2.h: Regenerate. 2002-01-30 Nick Clifton * vms-tir.c (cmd_name): New function. (tir_cmd_name): New function. (etir_sta, etir_sto, etir_opr, etir_stc): Use cmd_name(). (tir_opr, tir_ctl, tir_cmd): use tir_cmd_name(). Fix formatting. * peXXigen.c (pe_print_idata): Rearrange message to aid in translation. (pe_print_pdata): Rearrange message to aid in translation. * libbfd.c (warn_deprecated): Rearrange error message to aid in translation. * ihex.c (ihex_write_object_contents): Fix spelling typo. * ieee.c (ieee_slurp_external_symbols): Remove spurious space. * elf64-sparc.c (sparc64_elf_add_symbol_hook): Rearrange error message to aid in translation. * elf64-mmix.c (mmix_final_link_relocate): Rearrange error message to aid in translation. * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix typo. 2002-01-30 Philipp Thomas * coff-arm.c, elf32-elf.h: Unify messages. 2002-01-30 Nick Clifton * po/sv.po: Updated translation. 2002-01-30 Philipp Thomas * dwarf2.c (read_abbrev): Use full section name in error message. (decode_line_info): Likewise. * elf.c (_bfd_elf_symbol_from_bfd_symbol): Don't translate debugging message. 2002-01-30 Alan Modra * elf64-ppc.c (func_desc_adjust): Only provide missing function descriptor symbols for undefined function code syms. Clear ELF_LINK_NON_ELF so that they can stay weak. 2002-01-29 Chris Demetriou Mitch Lichtenberg * bfd-in.h (bfd_mips_elf32_create_embedded_relocs): New prototype. * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): New function to handle 32-bit ELF embedded reloc (ld --embedded-relocs) generation. * bfd-in2.h: Regenerate. 2002-01-29 Chris Demetriou * elf32-mips.c: Add additional comments about HI16 relocation processing. (_bfd_mips_elf_hi16_reloc): Don't subtract address here for pc-relative relocations. (Reverts change made on 2001-10-31.) (_bfd_mips_elf_lo16_reloc): Subtract address of LO16 part here for pc-relative relocations. (mips_elf_calculate_relocation): Add a comment about a kludge in the R_MIPS_GNU_REL_HI16 handling. (_bfd_mips_elf_relocate_section): Implement that kludge; adjust pc-relative HI16 relocation for difference in HI16 and LO16 addresses, since it can't easily be done in mips_elf_calculate_relocation. 2002-01-29 Martin Schwidefsky * elf32-i386 (elf_i386_adjust_dynamic_symbol): Do not replace PLT32 relocations with PC32 relocations for undefined or weak symbols. * elf32-s390 (elf_i386_adjust_dynamic_symbol): Likewise. * elf64-s390x (elf_i386_adjust_dynamic_symbol): Likewise. 2002-01-28 Jason Thorpe * elfcore.h (elf_core_file_p): Improve comment for last change. 2002-01-27 Daniel Jacobowitz * configure: Regenerated. 2002-01-27 Jason Thorpe * elfcore.h (elf_core_file_p): Set the machine architecture before processing the program headers. 2002-01-26 Hans-Peter Nilsson * configure.in <64-bit configuration>: If using gcc, check and emit error for egcs-1.1.2. * configure: Regenerate. 2002-01-26 Egor Duda * elf.c (elfcore_grok_win32pstatus): Copy only as much information as possible to avoid stack corruption. 2002-01-26 Richard Henderson * elf64-alpha.c (elf64_alpha_check_relocs): Don't set reltext for non-allocated sections. 2002-01-25 Mark Kettenis * elf.c (elfcore_write_prstatus): Make sure we pass the address of prstat.pr_reg even if it is a struct. 2002-01-25 Steve Ellcey * bfd/elfxx-ia64.c: Reset AIX vector function overrides for HP-UX. 2002-01-25 Philipp Thomas * coffgen.c (coff_print_symbol): Don't mark info message for translation. 2002-01-25 Nick Clifton * po/fr.po: Updated translation. * po/es.po: Updated translation. 2002-01-25 Philipp Thomas * coff-alpha.c (alpha_relocate_section): Unify warning message for GP relative relocations without GP defined. * coff-mips.c (mips_relocate_section): Likewise. 2002-01-25 Alan Modra * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid unsigned overflow when new_offset < old_offset. 2002-01-24 Philipp Thomas * bfd.c (_bfd_abort): Fix typo. 2002-01-23 Richard Henderson * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't suppress plt entries for undefweak symbols. 2002-01-23 Steve Ellcey * bfd/targets.c (bfd_elf32_ia64_hpux_big_vec): Add to DEFAULT_VECTOR. (bfd_elf64_ia64_hpux_big_vec): Ditto. (bfd_elf32_h8300_vec): Ditto. 2002-01-23 Alan Modra * elf64-ppc.c: Remove stale part of ABI comment. (NO_OPD_RELOCS): Define. (ppc64_elf_check_relocs): Use it. (ppc64_elf_relocate_section): Here too. (build_one_stub): Don't point function syms at the stub. Instead, hijack plt.offset. (ppc64_elf_relocate_section): Check whether REL24 relocs should really go to the stub. Make all dynamic relocs in opd against locals. (ppc64_elf_finish_dynamic_symbol): Allow for non-standard use of plt.offset. 2002-01-22 Richard Henderson * elf64-alpha.c (INSN_UNOP): Encode with RB as $sp. 2002-01-22 Alan Modra * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Correct sign of TOC_BASE_OFF adjustment. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. * po/SRC-POTFILES.in: Regenerate. 2002-01-22 John David Anglin * configure.host (hppa*64*-*-hpux*, hppa*64*-*-linux*): Add new host defines. 2002-01-21 Hans-Peter Nilsson * elf32-cris.c (cris_elf_relocate_section) : Check for and emit error if sgot is NULL at this point. 2002-01-21 Jason Thorpe * config.bfd (ia64*-*-netbsd*): New target. 2002-01-21 Thomas Klausner * som.c (som_write_space_strings): Comment typo fix. 2002-01-21 Alan Modra * elf64-ppc.c (struct ppc_link_hash_entry): Add is_func and is_func_descriptor fields. (link_hash_newfunc): Init them. (ppc64_elf_check_relocs): Only R_PPC24_REL24 syms starting with a dot are candidates for plt entries. When processing .opd relocs, set function descriptor strings to point inside function code string, and set new ppc_link_hash_entry fields. (ppc64_elf_gc_sweep_hook): Don't sweep R_PPC64_REL24 relocs. (ppc64_elf_adjust_dynamic_symbol): Remove most code dealing with function descriptors. It's now done in.. (func_desc_adjust): New. (ppc64_elf_func_desc_adjust): New. (define elf_backend_always_size_sections): Define. (ppc64_elf_hide_symbol): New. (define elf_backend_hide_symbol): Define. (allocate_dynrelocs): Remove code looking up function descriptors as that has been done earlier. (ppc64_elf_size_dynamic_sections): Use htab shortcut to elf hash table. (ppc64_elf_finish_dynamic_symbol): Likewise. Remove code looking up function descriptor. (build_one_stub): Look up the function code sym. Check for invalid plt offsets. (ppc64_elf_relocate_section): Tweak calls to undefined weak syms. Convert R_PPC64_TOC relocs to R_PPC64_RELATIVE in shared libs. * elf-bfd.h (elf_backend_data ): Add boolean param. (_bfd_elf_link_hash_hide_symbol): Likewise. * elflink.h (elf_link_add_object_symbols): Adjust call to elf_backend_hide_symbol. (elf_fix_symbol_flags): Likewise. (elf_link_assign_sym_version): Likewise. Use bfd_malloc rather than bfd_alloc. * elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param. Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref. * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. (clobber_millicode_symbols): Adjust to suit new hide_symbol. * elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param and adjust to suit. * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call _bfd_elf_link_hash_hide_symbol rather than duplicating code. * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise. 2002-01-18 Alan Modra * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a dynamic function descriptor symbol, not the associated function symbol. 2002-01-17 Eric Christopher * elf32-mips.c (mips_elf_calculate_relocation): Fix typo. 2002-01-17 Nick Clifton * po/bfd.pot: Regenerate. * po/fr.po: Regenerate. 2002-01-17 Alan Modra * elf-bfd.h (elf_backend_data ): Remove "Elf_Internal_Shdr *" param. (_bfd_mips_elf_section_from_bfd_section): Ditto. * elf32-mips.c (_bfd_mips_elf_section_from_bfd_section): Ditto. * elf32-m32r.c (_bfd_m32r_elf_section_from_bfd_section): Ditto. * elf32-v850.c (v850_elf_section_from_bfd_section): Ditto. * elf64-mmix.c (mmix_elf_section_from_bfd_section): Ditto. * elfxx-ia64.c (elfNN_hpux_backend_section_from_bfd_section): Ditto. * elf.c (_bfd_elf_section_from_bfd_section): Allow backend function to override special sections. Remove hdr arg from backend call, and don't loop. 2002-01-16 Eric Christopher * elf32-mips.c (mips_elf_calculate_relocation): Set require_jalxp on R_MIPS_26 and target is 16bit. Add R_MIPS16_GPREL to list of relocations requiring gp0 and gp. 2002-01-16 Richard Earnshaw * elf32-arm.h (elf32_arm_merge_private_bfd_data): Handle EF_ARM_VFP_FLOAT. (elf32_arm_print_private_bfd_data): Likewise. 2002-01-16 Nick Clifton * po/tr.po: Import new version. 2002-01-16 Alan Modra * elf64-ppc.c (ppc64_elf_howto_raw): Remove stale FIXMEs. (ppc64_elf_reloc_type_lookup): Use proper CTOR reloc. (ORI_R0_R0_0): Correct. 2002-01-16 Alan Modra * elflink.c (_bfd_elf_create_dynamic_sections): Don't set SEC_CODE when plt_not_loaded. * elf64-ppc.c (ppc64_elf_create_dynamic_sections): No need to clear .plt SEC_CODE here. Create .stub and correct .glink flags. (PLT_INITIAL_ENTRY_SIZE): Set to 24. (ppc64_elf_glink_code): Delete. (PPC64_ELF_GLINK_SIZE): Delete. (ADDIS_R12_R2, STD_R2_40R1, LD_R11_0R12, LD_R2_0R12, MTCTR_R11, BCTR, ADDIS_R12_R12_1, LD_R2_40R1, NOP, LI_R0_0, B_DOT, LIS_R0_0, ORI_R0_R0_0): Define. (PLT_CALL_STUB_SIZE, GLINK_CALL_STUB_SIZE): Define. (struct ppc_link_hash_table): Add sstub and plt_overflow. (ppc64_elf_link_hash_table_create): Init them. (ppc64_elf_check_relocs ): Refcount .plt entry. Don't copy to shared lib. (ppc64_elf_check_relocs): Call bfd_set_error on errors. (ppc64_elf_gc_sweep_hook ): Sweep plt refcount. (allocate_dynrelocs ): Don't change function sym here. Make room for .stub and .glink code. (ppc64_elf_size_dynamic_sections): Handle .stub. Make entry for DT_PPC64_GLINK. (ppc64_elf_final_link): Rename to ppc64_elf_set_toc. Don't call bfd_elf64_bfd_final_link. (bfd_elf64_bfd_final_link): Don't define. (ppc64_elf_size_stubs): New. (build_plt_stub): New. (build_one_stub): New. (ppc64_elf_build_stubs): New. (ppc64_elf_relocate_section ): Remove assert. (ppc64_elf_relocate_section): Don't copy R_PPC64_REL24 relocs. (ppc64_elf_finish_dynamic_symbol): Don't build stubs here. Set DT_PPC64_GLINK entry. Tweak DT_PLTGOT, DT_JMPREL, DT_PLTRELSZ in case output sections not separate. Adjust DT_RELASZ to not include plt relocs. Set reserved got entry. Set got and plt entry size. (elf_backend_got_header_size): Set to 8. * elf64-ppc.h: New file. 2002-01-16 Alan Modra * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing sections, use bfd_section_list_remove. * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. * elflink.h (elf_link_add_object_symbols): When removing all sections, use bfd_section_list_clear. 2002-01-15 Nick Clifton * po/sv.po: New file: Swedish translation. * configure.in (ALL_LINGUAS): Add sv. * configure: Regenerate. 2002-01-15 Jakub Jelinek * elflink.h (elf_link_input_bfd): Back out 2002-01-07 change. * elf.c (merge_sections_remove_hook): New function. (_bfd_elf_merge_sections): Pass it as 3rd argument to _bfd_merge_sections. * libbfd-in.h (_bfd_merge_sections): Add 3rd argument. * libbfd.h: Rebuilt. * merge.c (_bfd_merge_sections): Add remove_hook argument. Call remove_hook if a SEC_EXCLUDE section is encountered. 2002-01-15 Nick Clifton * elf32-xstormy16.c (xstormy16_reloc_map): Add new field 'table'. (xstormy16_reloc_map): Initialise new field with correct howto table. (xstormy16_reloc_type_lookup): Use 'table' field to locate correct howto entry. 2002-01-10 Michael Snyder * elf.c (elfcore_write_prstatus): Use long instead of pid_t; (elfcore_write_pstatus): Use long instead of pid_t; * elf-bfd.h: Change prototypes to use long instead of pid_t; 2002-01-09 Jason Thorpe * elf.c: Update copyright years. (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO and NT_NETBSDCORE_FIRSTMACH. Improve a comment. 2002-01-08 Michael Snyder Add capability to write corefile note sections, for gdb. * elf.c (elfcore_write_note): New function. (elfcore_write_prpsinfo): New function. (elfcore_write_prstatus): New function. (elfcore_write_pstatus): New function. (elfcore_write_prfpreg): New function. (elfcore_write_prxfpreg): New function. * elf-bfd.h: Add prototypes for above functions. 2002-01-08 Alexandre Oliva * elf.c (elf_fake_sections): Propagate errors from elf_backend_fake_section. 2002-01-07 Jason Thorpe * Makefile.am (BFD32_BACKENDS): Add elf32-sh-nbsd.lo. (BFD32_BACKENDS_CFILES): Add elf32-sh-nbsd.c. (elf32-sh-nbsd.lo): New rule. * Makefile.in: Regenerate. * config.bfd (sh*le-*-netbsdelf*): New target. (sh*-*-netbsdelf*): New target. * configure.in: Include netbsd-core.lo for native sh*-*-netbsd*. (bfd_elf32_shnbsd_vec): New vector. (bfd_elf32_shlnbsd_vec): New vector. * configure: Regenerate. * elf32-sh-nbsd.c: New file. * targets.c: Update copyright years. (_bfd_target_vector): Add bfd_elf32_shlnbsd_vec and bfd_elf32_shnbsd_vec. 2002-01-07 Aldy Hernandez * coff-rs6000.c (READ20): Use bfd_scan_vma. 2002-01-07 Geoffrey Keating * elflink.h (elf_link_input_bfd): Don't ask for the merged offset of a symbol in a section that will be deleted. 2002-01-07 Nick Clifton * po/es.po: New file: Spanish translation. * configure.in (ALL_LINGUAS): Add es. * configure: Regenerate. 2002-01-06 Steve Ellcey * elfxx-ia64.c (is_unwind_section_name): Add target vector as argument so we can handle HP-UX specially. (elfNN_ia64_hpux_vec): New for use in is_unwind_section_name. (elfNN_hpux_backend_section_from_bfd_section): New for support of SHN_IA_64_ANSI_COMMON. (elfNN_ia64_relax_section): Add support for SHN_IA_64_ANSI_COMMON. (is_unwind_section_name): Add special HP-UX support. (elfNN_ia64_section_from_shdr): Add support for more sections. (elfNN_ia64_fake_sections): Modify is_unwind_section_name call and add support for more sections. (elfNN_ia64_additional_program_headers): Modify is_unwind_section_name call. (elfNN_ia64_modify_segment_map): Remove assumption that there is only one unwind section in segment. 2002-01-06 Alan Modra * syms.c (_bfd_generic_make_empty_symbol): New function. * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as _bfd_generic_make_empty_symbol. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate. * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function. (hppabsd_core_get_symtab_upper_bound): Don't define. (hppabsd_core_get_symtab): Likewise. (hppabsd_core_print_symbol): Likewise. (hppabsd_core_get_symbol_info): Likewise. (hppabsd_core_bfd_is_local_label_name): Likewise. (hppabsd_core_get_lineno): Likewise. (hppabsd_core_find_nearest_line): Likewise. (hppabsd_core_bfd_make_debug_symbol): Likewise. (hppabsd_core_read_minisymbols): Likewise. (hppabsd_core_minisymbol_to_symbol): Likewise. (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols). Formatting fixes. * hpux-core.c: Similarly. * irix-core.c: Similarly. * osf-core.c: Similarly. * sco5-core.c: Similarly. * binary.c (binary_make_empty_symbol): Remove function, define as _bfd_generic_make_empty_symbol. * ihex.c (ihex_make_empty_symbol): Likewise. * mmo.c (mmo_make_empty_symbol): Likewise. * ppcboot.c (ppcboot_make_empty_symbol): Likewise. * srec.c (srec_make_empty_symbol): Likewise. * versados.c (versados_make_empty_symbol): Likewise. * vms.c (_bfd_vms_make_empty_symbol): Remove. (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol. * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol rather than _bfd_vms_make_empty_symbol. * vms-misc.c (new_symbol): Likewise. 2002-01-05 Alan Modra * section.c (bfd_section_init): Remove unnecessary initialisations. (bfd_section_list_clear): New function. (bfd_section_list_remove, bfd_section_list_insert): New macros. (_bfd_strip_section_from_output): Use them. * coffcode.h (coff_set_alignment_hook): Likewise. * elf32-mips.c (_bfd_mips_elf_final_link): Likewise. * elf64-mips.c (mips_elf64_final_link): Likewise. * elf64-mmix.c (mmix_elf_final_link): Likewise. * sunos.c (sunos_add_dynamic_symbols): Likewise. * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise. * bfd-in2.h: Regenerate. * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway rather than doing our own section handling. Clean up after errors with bfd_release and bfd_section_list_clear. Handle unexpected flags. * aoutf1.h (sunos4_core_file_p): Likewise. * aix386-core.c (aix386_core_file_p): Likewise. * cisco-core.c (cisco_core_file_validate): Likewise. * ptrace-core.c (ptrace_unix_core_file_p): Likewise. * trad-core.c (trad_unix_core_file_p): Likewise. * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors with bfd_release and bfd_section_list_clear. * hpux-core.c (hpux_core_core_file_p): Likewise. * irix-core.c (irix_core_core_file_p): Likewise. * lynx-core.c (lynx_core_file_p): Likewise. * osf-core.c (osf_core_core_file_p): Likewise. * rs6000-core.c (rs6000coff_core_p): Likewise. * sco5-core.c (sco5_core_file_p): Likewise. * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform sign extension adjustments without conditionals. 2002-01-04 Jakub Jelinek * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if CIE at .eh_frame start is removed due to no FDEs referencing it. 2002-01-04 Jason Thorpe * config.bfd (x86_64-*-netbsd*): New target. * configure.in (x86_64-*-netbsd*): Set COREFILE to netbsd-core.lo. * configure: Regenerated. 2002-01-03 Tom Rix * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering for recent bfd_make_section_anyway change. 2002-01-03 Nick Clifton * elf32-arm.h (elf32_arm_final_link_relocate): Handle R_ARM_THM_PC11 reloc. 2002-01-02 Nick Clifton * configure.in (LINGUAS): Add ja. * configure: Regenerate. * po/ja.po: Import from translation project's web site. 2002-01-02 Nick Clifton * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error messages to ease translation into other languages. For older changes see ChangeLog-0001 Local Variables: mode: change-log left-margin: 8 fill-column: 74 version-control: never End: diff --git a/contrib/binutils/bfd/version.h b/contrib/binutils/bfd/version.h index 600c6735495f..652aeb4390e9 100644 --- a/contrib/binutils/bfd/version.h +++ b/contrib/binutils/bfd/version.h @@ -1 +1 @@ -#define BFD_VERSION_DATE 20020622 +#define BFD_VERSION_DATE 20020720 diff --git a/contrib/binutils/binutils/configure.in b/contrib/binutils/binutils/configure.in index 4246185c25ae..03ed567d56d5 100644 --- a/contrib/binutils/binutils/configure.in +++ b/contrib/binutils/binutils/configure.in @@ -1,321 +1,321 @@ dnl Process this file with autoconf to produce a configure script. dnl AC_PREREQ(2.13) AC_INIT(ar.c) AC_CANONICAL_SYSTEM AC_ISC_POSIX changequote(,)dnl -BFD_VERSION_STRING=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` +BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` changequote([,])dnl AM_INIT_AUTOMAKE(binutils, ${BFD_VERSION}) AM_PROG_LIBTOOL AC_ARG_ENABLE(targets, [ --enable-targets alternative target configurations], [case "${enableval}" in yes | "") AC_ERROR(enable-targets option must specify target names or 'all') ;; no) enable_targets= ;; *) enable_targets=$enableval ;; esac])dnl AC_ARG_ENABLE(commonbfdlib, [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library], [case "${enableval}" in yes) commonbfdlib=true ;; no) commonbfdlib=false ;; *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;; esac])dnl build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in yes) ;; no) build_warnings="-w";; ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` build_warnings="${build_warnings} ${t}";; *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` build_warnings="${t} ${build_warnings}";; *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then echo "Setting warning flags = $build_warnings" 6>&1 fi])dnl WARN_CFLAGS="" if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then WARN_CFLAGS="${build_warnings}" fi AC_SUBST(WARN_CFLAGS) AM_CONFIG_HEADER(config.h:config.in) if test -z "$target" ; then AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) fi if test -z "$host" ; then AC_MSG_ERROR(Unrecognized host system type; please check config.sub.) fi AC_PROG_CC AC_PROG_YACC AM_PROG_LEX ALL_LINGUAS="fr tr ja es" CY_GNU_GETTEXT AM_MAINTAINER_MODE AC_EXEEXT if test -n "$EXEEXT"; then AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1, [Does the platform use an executable suffix?]) fi AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}", [Suffix used for executables, if any.]) # host-specific stuff: HDEFINES= . ${srcdir}/../bfd/configure.host AC_SUBST(HDEFINES) AR=${AR-ar} AC_SUBST(AR) AC_PROG_RANLIB AC_PROG_INSTALL BFD_CC_FOR_BUILD DEMANGLER_NAME=c++filt case "${host}" in *-*-go32* | *-*-msdos*) DEMANGLER_NAME=cxxfilt esac AC_SUBST(DEMANGLER_NAME) AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h) AC_HEADER_SYS_WAIT AC_FUNC_ALLOCA AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked) # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE # needs to be defined for it AC_MSG_CHECKING([for fopen64]) AC_CACHE_VAL(bu_cv_have_fopen64, [AC_TRY_LINK([#include ], [FILE *f = fopen64 ("/tmp/foo","r");], bu_cv_have_fopen64=yes, [saved_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" AC_TRY_LINK([#include ], [FILE *f = fopen64 ("/tmp/foo","r");], bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE", bu_cv_have_fopen64=no) CPPFLAGS=$saved_CPPFLAGS])]) AC_MSG_RESULT($bu_cv_have_fopen64) if test $bu_cv_have_fopen64 != no; then AC_DEFINE([HAVE_FOPEN64], 1, [Is fopen64 available?]) if test $bu_cv_have_fopen64 = "need -D_LARGEFILE64_SOURCE"; then AC_DEFINE([_LARGEFILE64_SOURCE], 1, [Enable LFS]) fi fi # Some systems have frexp only in -lm, not in -lc. AC_SEARCH_LIBS(frexp, m) AC_MSG_CHECKING(for time_t in time.h) AC_CACHE_VAL(bu_cv_decl_time_t_time_h, [AC_TRY_COMPILE([#include ], [time_t i;], bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)]) AC_MSG_RESULT($bu_cv_decl_time_t_time_h) if test $bu_cv_decl_time_t_time_h = yes; then AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1, [Is the type time_t defined in ?]) fi AC_MSG_CHECKING(for time_t in sys/types.h) AC_CACHE_VAL(bu_cv_decl_time_t_types_h, [AC_TRY_COMPILE([#include ], [time_t i;], bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)]) AC_MSG_RESULT($bu_cv_decl_time_t_types_h) if test $bu_cv_decl_time_t_types_h = yes; then AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1, [Is the type time_t defined in ?]) fi # Under Next 3.2 apparently does not define struct utimbuf # by default. AC_MSG_CHECKING([for utime.h]) AC_CACHE_VAL(bu_cv_header_utime_h, [AC_TRY_COMPILE([#include #ifdef HAVE_TIME_H #include #endif #include ], [struct utimbuf s;], bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)]) AC_MSG_RESULT($bu_cv_header_utime_h) if test $bu_cv_header_utime_h = yes; then AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does define struct utimbuf?]) fi BFD_NEED_DECLARATION(fprintf) BFD_NEED_DECLARATION(strstr) BFD_NEED_DECLARATION(sbrk) BFD_NEED_DECLARATION(getenv) BFD_NEED_DECLARATION(environ) BFD_BINARY_FOPEN # target-specific stuff: # Canonicalize the secondary target names. if test -n "$enable_targets"; then for targ in `echo $enable_targets | sed 's/,/ /g'` do result=`$ac_config_sub $targ 2>/dev/null` if test -n "$result"; then canon_targets="$canon_targets $result" else # Allow targets that config.sub doesn't recognize, like "all". canon_targets="$canon_targets $targ" fi done fi all_targets=false BUILD_NLMCONV= NLMCONV_DEFS= BUILD_SRCONV= BUILD_DLLTOOL= DLLTOOL_DEFS= BUILD_WINDRES= BUILD_DLLWRAP= BUILD_MISC= OBJDUMP_DEFS= for targ in $target $canon_targets do if test "x$targ" = "xall"; then all_targets=true BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' BUILD_SRCONV='$(SRCONV_PROG)' NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC" else case $targ in changequote(,)dnl i[3456]86*-*-netware*) changequote([,])dnl BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386" ;; alpha*-*-netware*) BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA" ;; powerpc*-*-netware*) BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC" ;; sparc*-*-netware*) BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC" ;; esac case $targ in *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;; esac case $targ in arm-epoc-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; arm-pe* | arm-*-wince) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; thumb-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; arm*-* | xscale-* | strongarm-* | d10v-*) OBJDUMP_DEFS="-DDISASSEMBLER_NEEDS_RELOCS" ;; changequote(,)dnl i[3-6]86-pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*) changequote([,])dnl BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; i[3-6]86-*-interix) BUILD_DLLTOOL='$(DLLTOOL_PROG)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" ;; powerpc*-*-pe* | powerpc*-*-cygwin*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; sh*-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; mips*-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; mcore-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; mcore-*elf) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF" ;; esac fi done if test "${with_windres+set}" = set; then BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' fi AC_SUBST(NLMCONV_DEFS) AC_SUBST(BUILD_NLMCONV) AC_SUBST(BUILD_SRCONV) AC_SUBST(BUILD_DLLTOOL) AC_SUBST(DLLTOOL_DEFS) AC_SUBST(BUILD_WINDRES) AC_SUBST(BUILD_DLLWRAP) AC_SUBST(BUILD_MISC) AC_SUBST(OBJDUMP_DEFS) AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.]) targ=$target . $srcdir/../bfd/config.bfd if test "x$targ_underscore" = "xyes"; then UNDERSCORE=1 else UNDERSCORE=0 fi AC_SUBST(UNDERSCORE) AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in, [ case "x$CONFIG_FILES" in *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; esac ]) diff --git a/contrib/binutils/etc/ChangeLog b/contrib/binutils/etc/ChangeLog index 0453a3e1339a..ffd021f53fa2 100644 --- a/contrib/binutils/etc/ChangeLog +++ b/contrib/binutils/etc/ChangeLog @@ -1,507 +1,515 @@ +2002-01-26 Hans-Peter Nilsson + + * Makefile.in (install): Depend on install-info. + +2001-03-25 Stephane Carrez + + * texi2pod.pl: New file (from gcc/contrib). + 1999-04-01 Jim Blandy * add-log.el, add-log.vi: New files. Wed Jan 20 01:33:50 1999 Angela Marie Thomas (angela@cygnus.com) * comp-tools-verify: Remove some checks that are no longer valid. 1998-12-03 Nick Clifton * targetdoc/fr30.texi: New document. Thu Oct 1 21:15:59 1998 Angela Marie Thomas (angela@cygnus.com) * comp-tools-fix, cross-tools-fix: Replace /usr/include with ${FIXINCDIR}. Tue Aug 11 19:22:11 1998 Doug Evans * make-rel-sym-tree (version): Update calculation. Fri Jun 12 21:34:01 1998 Ian Lance Taylor * configure.texi: Various additions. * Makefile.in (TEXI2HTML, DVIPS): New variables. (standards.ps): New target. (configure.dvi): Copy .tin files in as well. (configure.ps, configure.html): New targets. (clean): Remove configdev.jpg and configbuild.jpg. * configdev.fig: New file. * configdev.ein: New file (EPS version of configdev.fig). * configdev.jin: New file (JPEG version of configdev.fig). * configbuild.fig: New file. * configbuild.ein: New file (EPS version of configbuild.fig). * configbuild.jin: New file (JPEG version of configbuild.fig). Wed Jun 10 14:41:25 1998 Ian Lance Taylor * configure.texi: New file. * configdev.tin: New file. * configbuild.tin: New file. * Makefile.in (MAKEINFO): Use makeinfo from texinfo directory if it exists. (TEXI2DVI): Likewise for texi2dvi. (INFOFILES): Add configure.info. (DVIFILES): Add configure.dvi. (info): Only build info files if the source files exist. (install-info): Only install info files if they exist. (dvi): Only build DVI files if the sources files exist. (configure.info): New target. (configure.dvi): New target. (clean): Remove configdev and configbuild derived files. Remove obsolete documentation. * intro.texi: Remove. * install.texi: Remove. * config-names.texi: Remove. * screen1.eps: Remove. * screen1.obj: Remove. * screen2.eps: Remove. * screen2.obj: Remove. * Makefile.in: Remove references to the above. Thu May 21 14:34:51 1998 Nick Clifton * targetdoc/arm-interwork.texi: Add note about ignoring linker warning message when using --support-old-code. Mon May 18 14:27:37 1998 Angela Marie Thomas (angela@cygnus.com) * Install.in, comp-tools-fix, comp-tools-verify, cross-tools-fix: Use $GCCvn rather than substitute everywhere. Thu May 14 14:43:10 1998 Nick Clifton * targetdoc/arm-interwork.texi: Document dlltool support of interworking. Thu May 7 16:49:38 1998 Jason Molenda (crash@bugshack.cygnus.com) * Install.in: Remove references to TCL_LIBRARY, TK_LIBRARY, and GDBTK_FILENAME. Wed Apr 1 17:11:44 1998 Nick Clifton * targetdoc/arm-interwork.texi: Document ARM/thumb interworking. Tue Mar 31 15:28:20 1998 Ian Lance Taylor * standards.texi, make-stds.texi: Update to current FSF versions. * Makefile.in (standards.info): Depend upon make-std.texi. Tue Mar 24 16:13:26 1998 Stu Grossman * configure: Regenerate with autoconf 2.12.1 to fix shell issues for NT native builds. Mon Mar 9 16:41:04 1998 Doug Evans * make-rel-sym-tree (binprogs): Add objcopy. Tue Feb 24 18:11:58 1998 Doug Evans * make-rel-sym-tree: as.new -> as-new, ld.new -> ld-new nm.new -> nm-new. Make symlinks to crt*.o. Fri Nov 21 12:54:58 1997 Manfred Hollstein * Makefile.in: Add --no-split argument to avoid creating files with names longer than 14 characters. Thu Sep 25 13:13:11 1997 Jason Molenda (crash@pern.cygnus.com) * intro.texi: Add closing ifset. Mon Sep 1 10:31:32 1997 Angela Marie Thomas (angela@cygnus.com) * Install.in: Move setting HOST and TARGET to the beginning of the file for editing convenience. Mon Sep 1 10:28:37 1997 Angela Marie Thomas (angela@cygnus.com) * Install.in.: More friendly options/messages when extracting from a file instead of a tape device. Tue Jun 17 15:50:23 1997 Angela Marie Thomas (angela@cygnus.com) * Install.in: Add /usr/bsd to PATH for Irix (home of compress) Thu Jun 12 13:47:00 1997 Angela Marie Thomas (angela@cygnus.com) * Install.in (show_exec_prefix_msg): fix quoting Wed Jun 4 15:31:43 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) * rebuilding.texi: Removed. Sat May 24 18:02:20 1997 Angela Marie Thomas (angela@cygnus.com) * cross-tools-fix: Remove host check since it doesn't matter for this case. * Install.in (guess_system): clean up more unused hosts. * Install.in, cross-tools-fix, comp-tools-fix, comp-tools-verify: Hack for host check to not warn the user for certain cases. Fri May 23 23:46:10 1997 Angela Marie Thomas (angela@cygnus.com) * subst-strings: Remove a lot of unused code * Install.in: Remove reference to TAPEdflt, use variables instead of string substitution when able. Fri Apr 11 17:25:52 1997 Ian Lance Taylor * configure.in: Change file named in AC_INIT to Makefile.in. * configure: Rebuild. Fri Apr 11 18:12:42 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) * Install.in (guess_system): Back out change to INSTALLHOST to call all IRIX systems "mips-sgi-irix4" * Makefile.in: Remove references to configure.texi and cfg-paper.texi. Thu Apr 10 23:26:45 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) * srctree.texi, emacs-relnotes.texi, cfg-paper.texi: Remove. * Install.in: Remove Ultrix-specific hacks. Update Cygnus phone numbers. (guess_system): Remove some old systems (Ultrix, OSF1 v1 & 2, m68k-HPUX, m68k SunOS, etc.) (show_gnu_root_msg): Remove. Removed all the remove option code. Thu Apr 10 23:23:33 1997 Jason Molenda (crash@godzilla.cygnus.co.jp) * configure.man, configure.texi: Remote. Mon Apr 7 18:15:00 1997 Brendan Kehoe * Fix the version string for OSF1 4.0 to recognize either V4.* or X4.* Mon Apr 7 15:34:47 1997 Ian Lance Taylor * standards.texi, make-stds.texi: Update to current FSF versions. Tue Nov 19 15:36:14 1996 Doug Evans * make-rel-sym-tree: New file. Wed Oct 23 00:34:07 1996 Angela Marie Thomas (angela@cygnus.com) * Lots of patches from progressive... * Install.in: restore DDOPTS for AIX 4.x * Install.in, subst-strings: add case for DG Aviion * subst-strings: fix typo in INSTALLdir var setting * comp-tools-verify: set SHLIB_PATH for shared libs * Install.in, subst-strings: add case for solaris2.5 * Install.in: fix regression for hppa1.1 check * comp-tools-fix: set LD_LIBRARY_PATH * comp-tools-fix: If fixincludes fixes /usr/include/limits.h, install it as syslimits.h. Wed Oct 16 19:20:42 1996 Michael Meissner * Install.in (guess_system): Treat powerpc-ibm-aix4.1 the same as rs6000-ibm-aix4.1, since the compiler now uses common mode by default. Wed Oct 2 15:39:07 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) * configure.in (AC_PROG_INSTALL): Added. * Makefile.in (distclean): Remove config.cache. Wed Oct 2 14:33:58 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) * configure.in: Switch to autoconf configure.in. * configure: New. * Makefile.in: Use autoconf-substituted values. Tue Jun 25 18:56:08 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) * Makefile.in (datadir): Changed to $(prefix)/share. Fri Mar 29 11:38:01 1996 J.T. Conklin (jtc@lisa.cygnus.com) * configure.man: Changed to be recognized by catman -w on Solaris. Wed Dec 6 15:40:28 1995 Doug Evans * comp-tools-fix (fixincludes): Define FIXPROTO_DEFINES from .../install-tools/fixproto-defines. Sun Nov 12 19:31:27 1995 Jason Molenda (crash@phydeaux.cygnus.com) * comp-tools-verify (verify_cxx_initializers): delete argv, argc declarations, add -static to compile line. (verify_cxx_hello_world): delete argv, argc declarations, add -static to compile line. Wed Sep 20 13:21:52 1995 Ian Lance Taylor * Makefile.in (maintainer-clean): New target, synonym for realclean. Mon Aug 28 17:25:49 1995 Jason Molenda (crash@phydeaux.cygnus.com) * Install.in (PATH): add /usr/ucb to $PATH (for SunOS 4.1.x). Tue Aug 15 21:51:58 1995 Jason Molenda (crash@phydeaux.cygnus.com) * Install.in (guess_system): Match OSF/1 v3.x as the same as v2.x--v2.x binaries are upward compatible. Tue Aug 15 21:46:54 1995 Jason Molenda (crash@phydeaux.cygnus.com) * Install.in (guess_system): recognize HP 9000/800 systems as the same as HP 9000/700 systems. Tue Aug 8 13:11:56 1995 Brendan Kehoe * Install.in: For emacs, run show_emacs_alternate_msg and exit. (show_emacs_alternate_msg): New message saying how emacs can't be installed in an alternate prefix. Thu Jun 8 00:42:56 1995 Angela Marie Thomas * subst-strings: change du commands to $BINDIR/. & $SRCDIR/. just in case they are symlinks. Tue Apr 18 14:23:10 1995 J.T. Conklin * cdk-fix: Extracted table of targets that don't need their headers fixed from gcc's configure script. * cdk-fix, cdk-verify: Use ${HOST} instead of ||HOSTstr|| * cdk-fix, cdk-verify: New files, install script fragments used for Cygnus Developer's Kit. * Install.in (do_mkdir): New function. * Install.in: Added support for --with and --without options. Changed so that tape commands are not run when extracting from a file. (do_mt): Changed to take only one argument. Wed Mar 29 11:16:38 1995 Jason Molenda (crash@phydeaux.cygnus.com) * Install.in: catch UNAME==alpha-dec-osf2.x and correct entry for alpha-dec-osf1.x Fri Jan 27 12:04:29 1995 J.T. Conklin * subst-strings (mips-sgi-irix5): New entry in table. Thu Jan 19 12:15:44 1995 J.T. Conklin * Install.in: Major rewrite, bundle dependent code (for example, fixincludes for comp-tools) will be inserted into the Install script when it is generated. Tue Jan 17 16:51:32 1995 Ian Lance Taylor * Makefile.in (Makefile): Rebuild using $(SHELL). Thu Nov 3 19:30:33 1994 Ken Raeburn * Makefile.in (install-info): Depend on info. Fri Aug 19 16:16:38 1994 Jason Molenda (crash@phydeaux.cygnus.com) * Install.in: set $FIX_HEADER so fixproto can find fix-header. Fri May 6 16:18:58 1994 Jason Molenda (crash@sendai.cygnus.com) * Makefile.in (install-info): add a semicolon in the if statement. Fri Apr 29 16:56:07 1994 David J. Mackenzie (djm@rtl.cygnus.com) * cfg-paper.texi: Update some outdated information. * Makefile.in (install-info): Pass file, not directory, as last arg to INSTALL_DATA. (uninstall): New target. Thu Apr 28 14:42:22 1994 David J. Mackenzie (djm@rtl.cygnus.com) * configure.texi: Comment out @smallbook. * Makefile.in: Define TEXI2DVI and TEXIDIR, and use the latter. Remove info files in realclean, not clean, per coding standards. Remove TeX output in clean. Tue Apr 26 17:18:03 1994 Jason Molenda (crash@sendai.cygnus.com) * Install.in: fixincludes output is actually put in fixincludes.log, but echo'ed messages claim it is fixinc.log. This is the same messages as I logged in March 4 1994, but for some reason we found the change hadn't been done. I'll have to dig through the logs and find out what I really did do that day. :) Mon Apr 25 20:28:19 1994 Jason Molenda (crash@sendai.cygnus.com) * Install.in: use eval to call do_mt() for Ultrix brokenness. Mon Apr 25 20:00:00 1994 Jason Molenda (crash@sendai.cygnus.com) * Install.in(do_mt): exit with error status 1 if # of parameters != 3. Mon Apr 25 19:42:36 1994 Jason Molenda (crash@sendai.cygnus.com) * Install.in: lose TAPE_FORWARD and TAPE_REWIND, add do_mt() to do all tape movement operations. Currently untested. Addresses PR # 4886 from bull. * Install.in: add 1994 to the copyright thing. Fri Apr 22 19:05:13 1994 David J. Mackenzie (djm@rtl.cygnus.com) * standards.texi: Update from FSF. Fri Apr 22 15:46:10 1994 Jason Molenda (crash@cygnus.com) * Install.in: Add $DDOPTS, has ``bs=124b'' for all systems except AIX (some versions of AIX don't understand bs=124b. Silly OS). Mon Apr 4 22:55:05 1994 Jason Molenda (crash@sendai.cygnus.com) * Install.in: null out $TOOLS before adding stuff to it non-destructively. Wed Mar 30 21:45:35 1994 David J. Mackenzie (djm@rtl.cygnus.com) * standards.texi: Fix typo. * configure.texi, configure.man: Document --disable-. Mon Mar 28 13:22:15 1994 David J. Mackenzie (djm@rtl.cygnus.com) * standards.texi: Update from FSF. Sat Mar 26 09:21:44 1994 David J. Mackenzie (djm@rtl.cygnus.com) * standards.texi, make-stds.texi: Update from FSF. Fri Mar 25 22:59:45 1994 David J. Mackenzie (djm@rtl.cygnus.com) * configure.texi, configure.man: Document --enable-* options. Wed Mar 23 23:38:24 1994 Jason Molenda (crash@sendai.cygnus.com) * Install.in: set CPP to be gcc -E for fixincludes. Wed Mar 23 13:42:48 1994 Jason Molenda (crash@sendai.cygnus.com) * Install.in: set PATH to $PATH:/bin:/usr/bin so we can pick up native tools even if the user doesn't have them in his path. * Install.in: ``hppa-1.1-hp-hpux'' -> ``hppa1.1-hp-hpux''. Tue Mar 15 22:09:20 1994 Jason Molenda (crash@sendai.cygnus.com) * Install.in: TAPE_REWIND and TAPE_FORWARD variables for Unixunaware, added switch statement to detect if system is Unixunaware. Fri Mar 4 12:10:30 1994 Jason Molenda (crash@sendai.cygnus.com) * Install.in: fixincludes output is actually put in fixincludes.log, but echo'ed messages claim it is fixinc.log. Wed Nov 3 02:58:02 1993 Jeffrey Osier (jeffrey@thepub.cygnus.com) * subst-strings: output TEXBUNDLE for more install notes matching * install-texi.in: PRMS info now exists Tue Oct 26 16:57:12 1993 K. Richard Pixley (rich@sendai.cygnus.com) * subst-strings: match solaris*. Also, add default case to catch and error out for unrecognized systems. Thu Aug 19 18:21:31 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) * Install.in: handle the new fixproto work Mon Jul 19 12:05:41 1993 david d `zoo' zuhn (zoo@cirdan.cygnus.com) * Install.in: remove "MT=tctl" for AIX (not needed, and barely worked anyway) Mon Jun 14 19:09:22 1993 Jeffrey Osier (jeffrey@cygnus.com) * subst-strings: changed HOST to recognize Solaris for install notes Thu Jun 10 16:01:25 1993 Jeffrey Osier (jeffrey@cygnus.com) * dos-inst.texi: new file. Wed Jun 9 19:23:59 1993 Jeffrey Osier (jeffrey@rtl.cygnus.com) * install-texi.in: added conditionals (nearly complete) cleaned up added support for other releases (not done) Wed Jun 9 15:53:58 1993 Jim Kingdon (kingdon@cygnus.com) * Makefile.in (install-info): Use INSTALL_DATA. ({dist,real}clean): Also delete Makefile and config.status. Fri Jun 4 17:09:56 1993 Jeffrey Osier (jeffrey@cygnus.com) * subst-strings: added data for OS_STRING * subst-strings: added support for OS_STRING Thu Jun 3 00:37:01 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * Install.in: pull COPYING and COPYING.LIB off of the tape Tue Jun 1 16:52:08 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * subst-strings: replace RELEASE_DIR too Mon Mar 22 23:55:27 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * Makefile.in: add installcheck target Wed Mar 17 02:21:15 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * Install.in: fix 'source only' extraction bug where it looked for the src dir under H-/src instead of src; also remove stray reference to EMACSHIBIN Mon Mar 15 01:25:45 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * make-stds.texi: added 'installcheck' to the standard targets Tue Mar 9 19:48:28 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * standards.texi: added INFO-DIR-ENTRY, updated version from the FSF Tue Feb 9 12:40:23 1993 Ian Lance Taylor (ian@cygnus.com) * Makefile.in (standards.info): Added -I$(srcdir) to find make-stds.texi. Mon Feb 1 16:32:56 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * standards.texi: updated to latest FSF version, which includes: * make-stds.texi: new file Mon Nov 30 01:31:40 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * install-texi.in, relnotes.texi, intro.texi: changed Cygnus phone numbers from the old Palo Alto ones to the new Mtn. View numbers Mon Nov 16 16:50:43 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * Makefile.in: define $(RM) to "rm -f" Sun Oct 11 16:05:48 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * intro.texi: added INFO-DIR-ENTRY diff --git a/contrib/binutils/etc/Makefile.in b/contrib/binutils/etc/Makefile.in index eedc8c9c1ac2..2bc34574540e 100644 --- a/contrib/binutils/etc/Makefile.in +++ b/contrib/binutils/etc/Makefile.in @@ -1,156 +1,157 @@ # # Makefile.in for etc # prefix = @prefix@ exec_prefix = @exec_prefix@ srcdir = @srcdir@ VPATH = @srcdir@ bindir = @bindir@ libdir = @libdir@ tooldir = $(libdir) datadir = @datadir@ mandir = @mandir@ man1dir = $(mandir)/man1 man2dir = $(mandir)/man2 man3dir = $(mandir)/man3 man4dir = $(mandir)/man4 man5dir = $(mandir)/man5 man6dir = $(mandir)/man6 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 man9dir = $(mandir)/man9 infodir = @infodir@ SHELL = /bin/sh INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ MAKEINFO = `if [ -f ../texinfo/makeinfo/makeinfo ]; \ then echo ../texinfo/makeinfo/makeinfo; \ else echo makeinfo; fi` TEXI2DVI = `if [ -f ../texinfo/util/texi2dvi ]; \ then echo ../texinfo/util/texi2dvi; \ else echo texi2dvi; fi` TEXI2HTML = texi2html DVIPS = dvips # Where to find texinfo.tex to format documentation with TeX. TEXIDIR = $(srcdir)/../texinfo #### Host, target, and site specific Makefile fragments come in here. ### INFOFILES = standards.info configure.info DVIFILES = standards.dvi configure.dvi all: -install: +# We want install to imply install-info as per GNU standards. +install: install-info uninstall: info: for f in $(INFOFILES); do \ if test -f $(srcdir)/`echo $$f | sed -e 's/.info$$/.texi/'`; then \ if $(MAKE) "MAKEINFO=$(MAKEINFO)" $$f; then \ true; \ else \ exit 1; \ fi; \ fi; \ done install-info: info $(SHELL) $(srcdir)/../mkinstalldirs $(infodir) if test ! -f standards.info; then cd $(srcdir); fi; \ if test -f standards.info; then \ for i in standards.info*; do \ $(INSTALL_DATA) $$i $(infodir)/$$i; \ done; \ fi if test ! -f configure.info; then cd $(srcdir); fi; \ if test -f configure.info; then \ for i in configure.info*; do \ $(INSTALL_DATA) $$i $(infodir)/$$i; \ done; \ fi dvi: for f in $(DVIFILES); do \ if test -f $(srcdir)/`echo $$f | sed -e 's/.dvi$$/.texi/'`; then \ if $(MAKE) "TEXI2DVI=$(TEXI2DVI)" $$f; then \ true; \ else \ exit 1; \ fi; \ fi; \ done standards.info: $(srcdir)/standards.texi $(srcdir)/make-stds.texi $(MAKEINFO) --no-split -I$(srcdir) -o standards.info $(srcdir)/standards.texi standards.dvi: $(srcdir)/standards.texi TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/standards.texi standards.ps: standards.dvi $(DVIPS) standards.dvi -o standards.ps # makeinfo requires images to be in the current directory. configure.info: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin rm -f configdev.txt configbuild.txt cp $(srcdir)/configdev.tin configdev.txt cp $(srcdir)/configbuild.tin configbuild.txt $(MAKEINFO) -I$(srcdir) -o configure.info $(srcdir)/configure.texi rm -f configdev.txt configbuild.txt # texi2dvi wants both the .txt and the .eps files. configure.dvi: $(srcdir)/configure.texi $(srcdir)/configdev.tin $(srcdir)/configbuild.tin $(srcdir)/configdev.ein $(srcdir)/configbuild.ein rm -f configdev.txt configbuild.txt cp $(srcdir)/configdev.tin configdev.txt cp $(srcdir)/configbuild.tin configbuild.txt rm -f configdev.eps configbuild.eps cp $(srcdir)/configdev.ein configdev.eps cp $(srcdir)/configbuild.ein configbuild.eps TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/configure.texi rm -f configdev.txt configbuild.txt rm -f configdev.eps configbuild.eps # dvips requires images to be in the current directory configure.ps: configure.dvi $(srcdir)/configdev.ein $(srcdir)/configbuild.ein rm -f configdev.eps configbuild.eps cp $(srcdir)/configdev.ein configdev.eps cp $(srcdir)/configbuild.ein configbuild.eps $(DVIPS) configure.dvi -o configure.ps rm -f configdev.eps configbuild.eps configure.html: $(srcdir)/configure.texi $(TEXI2HTML) -split_chapter $(srcdir)/configure.texi clean: rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs rm -f configdev.txt configbuild.txt configdev.eps configbuild.eps rm -f configdev.jpg configbuild.jpg mostlyclean: clean distclean: clean rm -f Makefile config.status config.cache maintainer-clean realclean: distclean rm -f *.info* Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) $(SHELL) ./config.status ## these last targets are for standards.texi conformance dist: check: installcheck: TAGS: diff --git a/contrib/binutils/gprof/po/Make-in b/contrib/binutils/gprof/po/Make-in new file mode 100644 index 000000000000..0552db1feef3 --- /dev/null +++ b/contrib/binutils/gprof/po/Make-in @@ -0,0 +1,251 @@ +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = $(prefix)/@DATADIRNAME@ +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext/po +subdir = po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +MKINSTALLDIRS = @MKINSTALLDIRS@ + +CC = @CC@ +GENCAT = @GENCAT@ +GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ +MSGMERGE = PATH=../src:$$PATH msgmerge + +DEFS = @DEFS@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ + +INCLUDES = -I.. -I$(top_srcdir)/intl + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +SOURCES = cat-id-tbl.c +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) + +POTFILES = \ + +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +INSTOBJEXT = @INSTOBJEXT@ + +.SUFFIXES: +.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat + +.c.o: + $(COMPILE) $< + +.po.pox: + $(MAKE) $(PACKAGE).pot + $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && $(GENCAT) $@ $*.msg + + +all: all-@USE_NLS@ + +all-yes: $(CATALOGS) @MAINT@ $(PACKAGE).pot +all-no: + +$(srcdir)/$(PACKAGE).pot: $(POTFILES) + $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=$(srcdir)/POTFILES.in + rm -f $(srcdir)/$(PACKAGE).pot + mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot + +$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: +$(srcdir)/stamp-cat-id: $(PACKAGE).pot + rm -f cat-id-tbl.tmp + sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ + | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp + if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ + rm cat-id-tbl.tmp; \ + else \ + echo cat-id-tbl.c changed; \ + rm -f $(srcdir)/cat-id-tbl.c; \ + mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ + fi + cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id + + +install: install-exec install-data +install-exec: +install-info: +install-data: install-data-@USE_NLS@ +install-data-no: all +install-data-yes: all + if test -r $(MKINSTALLDIRS); then \ + $(MKINSTALLDIRS) $(datadir); \ + else \ + $(top_srcdir)/mkinstalldirs $(datadir); \ + fi + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + case "$$cat" in \ + *.gmo) destdir=$(gnulocaledir);; \ + *) destdir=$(localedir);; \ + esac; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + dir=$$destdir/$$lang/LC_MESSAGES; \ + if test -r $(MKINSTALLDIRS); then \ + $(MKINSTALLDIRS) $$dir; \ + else \ + $(top_srcdir)/mkinstalldirs $$dir; \ + fi; \ + if test -r $$cat; then \ + $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + else \ + $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + fi; \ + if test -r $$cat.m; then \ + $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + if test -r $(srcdir)/$$cat.m ; then \ + $(INSTALL_DATA) $(srcdir)/$$cat.m \ + $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + true; \ + fi; \ + fi; \ + done + if test "$(PACKAGE)" = "gettext"; then \ + if test -r $(MKINSTALLDIRS); then \ + $(MKINSTALLDIRS) $(gettextsrcdir); \ + else \ + $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ + fi; \ + $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ + $(gettextsrcdir)/Makefile.in.in; \ + else \ + : ; \ + fi + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + done + rm -f $(gettextsrcdir)/po-Makefile.in.in + +check: all + +cat-id-tbl.o: ../intl/libgettext.h + +dvi info tags TAGS ID: + +mostlyclean: + rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f $(GMOFILES) + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: update-po $(DISTFILES) + dists="$(DISTFILES)"; \ + for file in $$dists; do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(PACKAGE).pot + PATH=`pwd`/../src:$$PATH; \ + cd $(srcdir); \ + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + mv $$lang.po $$lang.old.po; \ + echo "$$lang:"; \ + if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ + rm -f $$lang.old.po; \ + else \ + echo "msgmerge for $$cat failed!"; \ + rm -f $$lang.po; \ + mv $$lang.old.po $$lang.po; \ + fi; \ + done + +POTFILES: POTFILES.in + ( if test 'x$(srcdir)' != 'x.'; then \ + posrcprefix='$(top_srcdir)/'; \ + else \ + posrcprefix="../"; \ + fi; \ + rm -f $@-t $@ \ + && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ + -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ + | sed -e '$$s/\\$$//') > $@-t \ + && chmod a-w $@-t \ + && mv $@-t $@ ) + +POTFILES.in: @MAINT@ ../Makefile + cd .. && $(MAKE) po/POTFILES.in + +Makefile: Make-in ../config.status POTFILES + cd .. \ + && CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \ + CONFIG_HEADERS= $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/contrib/binutils/gprof/po/POTFILES.in b/contrib/binutils/gprof/po/POTFILES.in new file mode 100644 index 000000000000..6ea40f18244c --- /dev/null +++ b/contrib/binutils/gprof/po/POTFILES.in @@ -0,0 +1,38 @@ +alpha.c +basic_blocks.c +basic_blocks.h +call_graph.c +call_graph.h +cg_arcs.c +cg_arcs.h +cg_dfn.c +cg_dfn.h +cg_print.c +cg_print.h +corefile.c +corefile.h +gmon.h +gmon_io.c +gmon_io.h +gmon_out.h +gprof.c +gprof.h +hertz.c +hertz.h +hist.c +hist.h +i386.c +mips.c +search_list.c +search_list.h +source.c +source.h +sparc.c +sym_ids.c +sym_ids.h +symtab.c +symtab.h +tahoe.c +utils.c +utils.h +vax.c diff --git a/contrib/binutils/gprof/po/gprof.pot b/contrib/binutils/gprof/po/gprof.pot new file mode 100644 index 000000000000..f586066b1fcc --- /dev/null +++ b/contrib/binutils/gprof/po/gprof.pot @@ -0,0 +1,505 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2002-01-31 18:32+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: alpha.c:93 mips.c:47 +msgid "" +msgstr "" + +#: alpha.c:110 mips.c:64 +#, c-format +msgid "[find_call] %s: 0x%lx to 0x%lx\n" +msgstr "" + +#: alpha.c:132 +#, c-format +msgid "[find_call] 0x%lx: jsr%s \n" +msgstr "" + +#: alpha.c:142 +#, c-format +msgid "[find_call] 0x%lx: bsr" +msgstr "" + +#: basic_blocks.c:122 call_graph.c:90 hist.c:93 +#, c-format +msgid "%s: %s: unexpected end of file\n" +msgstr "" + +#: basic_blocks.c:190 +#, c-format +msgid "%s: warning: ignoring basic-block exec counts (use -l or --line)\n" +msgstr "" + +#. FIXME: This only works if bfd_vma is unsigned long. +#: basic_blocks.c:281 basic_blocks.c:291 +#, c-format +msgid "%s:%d: (%s:0x%lx) %lu executions\n" +msgstr "" + +#: basic_blocks.c:282 basic_blocks.c:292 +msgid "" +msgstr "" + +#: basic_blocks.c:536 +#, c-format +msgid "" +"\n" +"\n" +"Top %d Lines:\n" +"\n" +" Line Count\n" +"\n" +msgstr "" + +#: basic_blocks.c:560 +msgid "" +"\n" +"Execution Summary:\n" +"\n" +msgstr "" + +#: basic_blocks.c:561 +#, c-format +msgid "%9ld Executable lines in this file\n" +msgstr "" + +#: basic_blocks.c:563 +#, c-format +msgid "%9ld Lines executed\n" +msgstr "" + +#: basic_blocks.c:564 +#, c-format +msgid "%9.2f Percent of the file executed\n" +msgstr "" + +#: basic_blocks.c:568 +#, c-format +msgid "" +"\n" +"%9lu Total number of line executions\n" +msgstr "" + +#: basic_blocks.c:570 +#, c-format +msgid "%9.2f Average executions per line\n" +msgstr "" + +#: call_graph.c:69 +#, c-format +msgid "[cg_tally] arc from %s to %s traversed %lu times\n" +msgstr "" + +#: cg_print.c:58 +msgid "" +"\t\t Call graph (explanation follows)\n" +"\n" +msgstr "" + +#: cg_print.c:60 +msgid "" +"\t\t\tCall graph\n" +"\n" +msgstr "" + +#: cg_print.c:63 hist.c:355 +#, c-format +msgid "" +"\n" +"granularity: each sample hit covers %ld byte(s)" +msgstr "" + +#: cg_print.c:67 +#, c-format +msgid "" +" for %.2f%% of %.2f seconds\n" +"\n" +msgstr "" + +#: cg_print.c:71 +msgid "" +" no time propagated\n" +"\n" +msgstr "" + +#: cg_print.c:80 cg_print.c:83 cg_print.c:85 +msgid "called" +msgstr "" + +#: cg_print.c:80 cg_print.c:85 +msgid "total" +msgstr "" + +#: cg_print.c:80 +msgid "parents" +msgstr "" + +#: cg_print.c:82 cg_print.c:83 +msgid "index" +msgstr "" + +#: cg_print.c:82 +msgid "%time" +msgstr "" + +#: cg_print.c:82 cg_print.c:83 +msgid "self" +msgstr "" + +#: cg_print.c:82 +msgid "descendants" +msgstr "" + +#: cg_print.c:83 hist.c:381 +msgid "name" +msgstr "" + +#: cg_print.c:85 +msgid "children" +msgstr "" + +#: cg_print.c:90 +#, c-format +msgid "index %% time self children called name\n" +msgstr "" + +#: cg_print.c:113 +#, c-format +msgid " [%d]\n" +msgstr "" + +#: cg_print.c:339 +#, c-format +msgid "%6.6s %5.5s %7.7s %11.11s %7.7s %7.7s \n" +msgstr "" + +#: cg_print.c:340 +#, c-format +msgid "%6.6s %5.5s %7.7s %7.7s %7.7s %7.7s \n" +msgstr "" + +#: cg_print.c:574 +msgid "" +"Index by function name\n" +"\n" +msgstr "" + +#: cg_print.c:631 cg_print.c:640 +#, c-format +msgid "" +msgstr "" + +#: corefile.c:64 +#, c-format +msgid "%s: could not open %s.\n" +msgstr "" + +#: corefile.c:78 corefile.c:112 +#, c-format +msgid "%s: unable to parse mapping file %s.\n" +msgstr "" + +#: corefile.c:154 +#, c-format +msgid "%s: %s: not in a.out format\n" +msgstr "" + +#: corefile.c:165 +#, c-format +msgid "%s: can't find .text section in %s\n" +msgstr "" + +#: corefile.c:223 +#, c-format +msgid "%s: ran out room for %lu bytes of text space\n" +msgstr "" + +#: corefile.c:237 +#, c-format +msgid "%s: can't do -c\n" +msgstr "" + +#: corefile.c:272 +#, c-format +msgid "%s: -c not supported on architecture %s\n" +msgstr "" + +#: corefile.c:439 +#, c-format +msgid "%s: file `%s' has no symbols\n" +msgstr "" + +#: corefile.c:739 +#, c-format +msgid "%s: somebody miscounted: ltab.len=%d instead of %ld\n" +msgstr "" + +#: gmon_io.c:83 gmon_io.c:137 gmon_io.c:188 gmon_io.c:216 gmon_io.c:386 +#: gmon_io.c:413 gmon_io.c:609 gmon_io.c:634 +#, c-format +msgid "%s: bits per address has unexpected value of %u\n" +msgstr "" + +#: gmon_io.c:252 gmon_io.c:347 +#, c-format +msgid "%s: file too short to be a gmon file\n" +msgstr "" + +#: gmon_io.c:262 gmon_io.c:396 +#, c-format +msgid "%s: file `%s' has bad magic cookie\n" +msgstr "" + +#: gmon_io.c:273 +#, c-format +msgid "%s: file `%s' has unsupported version %d\n" +msgstr "" + +#: gmon_io.c:303 +#, c-format +msgid "%s: %s: found bad tag %d (file corrupted?)\n" +msgstr "" + +#: gmon_io.c:369 +#, c-format +msgid "%s: profiling rate incompatible with first gmon file\n" +msgstr "" + +#: gmon_io.c:429 +#, c-format +msgid "%s: incompatible with first gmon file\n" +msgstr "" + +#: gmon_io.c:457 +#, c-format +msgid "%s: file '%s' does not appear to be in gmon.out format\n" +msgstr "" + +#: gmon_io.c:478 +#, c-format +msgid "%s: unexpected EOF after reading %d/%d bins\n" +msgstr "" + +#: gmon_io.c:511 +msgid "time is in ticks, not seconds\n" +msgstr "" + +#: gmon_io.c:517 gmon_io.c:704 +#, c-format +msgid "%s: don't know how to deal with file format %d\n" +msgstr "" + +#: gmon_io.c:524 +#, c-format +msgid "File `%s' (version %d) contains:\n" +msgstr "" + +#: gmon_io.c:527 +#, c-format +msgid "\t%d histogram record\n" +msgstr "" + +#: gmon_io.c:528 +#, c-format +msgid "\t%d histogram records\n" +msgstr "" + +#: gmon_io.c:530 +#, c-format +msgid "\t%d call-graph record\n" +msgstr "" + +#: gmon_io.c:531 +#, c-format +msgid "\t%d call-graph records\n" +msgstr "" + +#: gmon_io.c:533 +#, c-format +msgid "\t%d basic-block count record\n" +msgstr "" + +#: gmon_io.c:534 +#, c-format +msgid "\t%d basic-block count records\n" +msgstr "" + +#: gprof.c:147 +#, c-format +msgid "" +"Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n" +"\t[-d[num]] [-k from/to] [-m min-count] [-t table-length]\n" +"\t[--[no-]annotated-source[=name]] [--[no-]exec-counts[=name]]\n" +"\t[--[no-]flat-profile[=name]] [--[no-]graph[=name]]\n" +"\t[--[no-]time=name] [--all-lines] [--brief] [--debug[=level]]\n" +"\t[--function-ordering] [--file-ordering]\n" +"\t[--directory-path=dirs] [--display-unused-functions]\n" +"\t[--file-format=name] [--file-info] [--help] [--line] [--min-count=n]\n" +"\t[--no-static] [--print-path] [--separate-files]\n" +"\t[--static-call-graph] [--sum] [--table-length=len] [--traditional]\n" +"\t[--version] [--width=n] [--ignore-non-functions]\n" +"\t[--demangle[=STYLE]] [--no-demangle]\n" +"\t[image-file] [profile-file...]\n" +msgstr "" + +#: gprof.c:163 +#, c-format +msgid "Report bugs to %s\n" +msgstr "" + +#: gprof.c:235 +#, c-format +msgid "%s: debugging not supported; -d ignored\n" +msgstr "" + +#: gprof.c:315 +#, c-format +msgid "%s: unknown file format %s\n" +msgstr "" + +#. This output is intended to follow the GNU standards document. +#: gprof.c:399 +#, c-format +msgid "GNU gprof %s\n" +msgstr "" + +#: gprof.c:400 +msgid "" +"Based on BSD gprof, copyright 1983 Regents of the University of California.\n" +msgstr "" + +#: gprof.c:401 +msgid "" +"This program is free software. This program has absolutely no warranty.\n" +msgstr "" + +#: gprof.c:442 +#, c-format +msgid "%s: unknown demangling style `%s'\n" +msgstr "" + +#: gprof.c:462 +#, c-format +msgid "" +"%s: Only one of --function-ordering and --file-ordering may be specified.\n" +msgstr "" + +#: gprof.c:562 +#, c-format +msgid "%s: sorry, file format `prof' is not yet supported\n" +msgstr "" + +#: gprof.c:623 +#, c-format +msgid "%s: gmon.out file is missing histogram\n" +msgstr "" + +#: gprof.c:630 +#, c-format +msgid "%s: gmon.out file is missing call-graph data\n" +msgstr "" + +#: hist.c:122 +#, c-format +msgid "%s: `%s' is incompatible with first gmon file\n" +msgstr "" + +#: hist.c:138 +#, c-format +msgid "%s: %s: unexpected EOF after reading %d of %d samples\n" +msgstr "" + +#: hist.c:351 +#, c-format +msgid "%c%c/call" +msgstr "" + +#: hist.c:359 +#, c-format +msgid "" +" for %.2f%% of %.2f %s\n" +"\n" +msgstr "" + +#: hist.c:365 +#, c-format +msgid "" +"\n" +"Each sample counts as %g %s.\n" +msgstr "" + +#: hist.c:370 +msgid "" +" no time accumulated\n" +"\n" +msgstr "" + +#: hist.c:377 +msgid "cumulative" +msgstr "" + +#: hist.c:377 +msgid "self " +msgstr "" + +#: hist.c:377 +msgid "total " +msgstr "" + +#: hist.c:380 +msgid "time" +msgstr "" + +#: hist.c:380 +msgid "calls" +msgstr "" + +#: hist.c:469 +msgid "" +"\n" +"\n" +"\n" +"flat profile:\n" +msgstr "" + +#: hist.c:475 +msgid "Flat profile:\n" +msgstr "" + +#: mips.c:75 +#, c-format +msgid "[find_call] 0x%lx: jal" +msgstr "" + +#: mips.c:100 +#, c-format +msgid "[find_call] 0x%lx: jalr\n" +msgstr "" + +#: source.c:163 +#, c-format +msgid "%s: could not locate `%s'\n" +msgstr "" + +#: source.c:238 +#, c-format +msgid "*** File %s:\n" +msgstr "" + +#: utils.c:96 +#, c-format +msgid " " +msgstr "" diff --git a/contrib/binutils/ld/ChangeLog b/contrib/binutils/ld/ChangeLog index 6f6e0d3f9e4b..21fbd4b8cd70 100644 --- a/contrib/binutils/ld/ChangeLog +++ b/contrib/binutils/ld/ChangeLog @@ -1,3851 +1,3857 @@ +2002-07-07 Alan Modra + + Merge from mainline. + 2002-07-05 Alan Modra + * ldlang.c (print_wild_statement): Fix output formatting. + 2002-05-09 Alan Modra Merge from mainline. 2002-05-02 Alan Modra * emultempl/ppc64elf.em (gld${EMULATION_NAME}_after_allocation): Adjust for ppc64_elf_set_toc change. #include libbfd.h. 2002-04-28 Alan Modra * Makefile.am (mpw): New maintainer mode rule to make mpw-*.c files. * Makefile.in: Regenerate. * mpw-elfmips.c: Delete. * mpw-eppcmac.c: Delete. * mpw-esh.c: Delete. * mpw-idtmips.c: Delete. 2002-04-27 Alan Modra Merge from mainline 2002-04-08 Alan Modra * ldlang.c (lang_size_sections): Don't complain about SEC_NEVER_LOAD sections having no memory region specified. * ld.texinfo (Format Commands ): Typo fix. 2002-04-07 matthew green * ld/configure.host (*-*-netbsd*): Add support for NetBSD/ELF. 2002-02-19 Martin Schwidefsky * emulparams/elf64_s390.sh (ARCH): Change to "s390:64-bit". * emulparams/elf_s390.sh (ARCH): Change to "s390:31-bit". 2002-04-11 Nick Clifton * emultempl/armelf.em (PARSE_AND_LIST_SHORTOPTS): Add 'n' in order to prevent "-n" from being taken as an abbreviation for "--no-pipeline-knowledge". 2002-04-04 Alan Modra * dep-in.sed: Cope with absolute paths. * Makefile.am (dep.sed): Subst TOPDIR and BFDDIR. Run "make dep-am". * Makefile.in: Regenerate. Merge from mainline. 2002-03-28 Alan Modra * configure.host: Set up for generic hosts first, then tweak as necessary in more specific targets. (HOSTING_LIBS): Include libgcc_eh.a if found. 2002-03-28 Alan Modra Merge from mainline. 2002-03-21 Albert Chin-A-Young * genscripts.sh (LIB_SEARCH_DIRS): Quote path. 2002-03-20 Alan Modra * ldlang.c (ldlang_add_undef): If the output bfd has been opened, add the symbol to the linker hash table immediately. (lang_place_undefineds): Split symbol creation out.. (insert_undefined): ..to here. 2002-03-18 Alan Modra * ldmain.c (main): Move .text readonly flag fudges from here.. * ldlang.c (lang_process): ..to here. 2002-03-14 Alan Modra * ldlang.c (lang_check): Remove the word size check added in last change. Treat emitrelocations case as for relocatable links. 2002-03-13 Alan Modra * ldlang.c (lang_check): Do relocatable link checks first, so that warn_mismatch can't override. Check compatible and word size too. 2002-03-04 H.J. Lu * scripttempl/elf.sc: Put .preinit_array, .init_array and .fini_array in the data segment. 2002-03-04 Alan Modra * scripttempl/elf.sc: Correct syntax errors in 2002-03-01 commit. 2002-03-01 David Mosberger * scripttempl/elf.sc (SECTIONS): Add entries for .preinit_array, .init_array, and .fini_array. 2002-03-18 David O'Brien * emultempl/elf32.em: Use lbasename vs. basename to fix problem where the contents of the buffer returned from basename function will are getting overwritten while still being used. Mon Mar 18 18:07:20 CET 2002 Jan Hubicka Andreas Jaeger Andreas Schwab * configure.tgt (x86_64-*-linux-gnu*): Configure i386 as native. * elf_x86_64.sh (ARCH): Set to i386:x86-64 set libraries to default to lib64 paths. 2002-03-07 Daniel Jacobowitz * ld.texinfo: Wrap @menu in @ifnottex, not @ifinfo. 2002-03-07 Daniel Jacobowitz * NEWS: Mark version 2.12. 2002-02-20 Andreas Schwab * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Don't fold .IA64_unwind* in a relocatable link. 2002-02-19 David O'Brien * Makefile.am: Add new files earmelf_fbsd, eelf32ppc_fbsd, eelf_i386_fbsd, eelf64_ia64_fbsd, eelf_x86_64_fbsd, eelf64_sparc_fbsd, and eelf64alpha_fbsd. * Makefile.in: Regenerate. * configure.tgt(sparc64-*-freebsd, ia64-*-freebsd, i[3456]86-*-freebsd, x86_64-*-freebsd, arm-*-freebsd, alpha*-*-freebsd, powerpc-*-freebsd): use a FreeBSD-specific emulation rather than the psABI one. * emulparams/elf_fbsd.sh (ELF_INTERPRETER_NAME): Set appropriate value for all FreeBSD ELF systems. * emulparams/armelf_fbsd.sh: Bridge elf_fbsd.sh and the "native" psABI emulation. * emulparams/elf32ppc_fbsd.sh: Likewise. * emulparams/elf64_ia64_fbsd.sh: Likewise. * emulparams/elf64_sparc_fbsd.sh: Likewise. * emulparams/elf64alpha_fbsd.sh: Likewise. * emulparams/elf_i386_fbsd.sh: Likewise. * emulparams/elf_x86_64_fbsd.sh: Likewise. 2002-02-15 Richard Henderson * emulparams/elf64alpha.sh (NOP): Adjust for little-endian definition. 2002-02-15 Hans-Peter Nilsson * NEWS: Mention support for MMIX. 2002-02-14 Phil Edwards * ld.texinfo (VERSION scripts): Symbol names are globbing patterns. * ldgram.y (lang_new_vers_regex): Rename to lang_new_vers_pattern; the pattern in question is not a regexp. * ldlang.c: Likewise. * ldlang.h: Likewise. * ldlex.l (V_IDENTIFIER): Allow '[', ']', '-', '!', and '^' also. 2002-02-10 Daniel Jacobowitz * lexsup.c: Remove strtoul declaration. 2002-02-11 Alan Modra * ldlang.c (entry_section): New initialised variable. (lang_finish): Use it. * ldlang.h (entry_section): Declare. * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Set entry_section to ".opd". 2002-02-10 Daniel Jacobowitz * ldmain.c: Add prototype for main (). * lexsup.c: Guard declaration of strtoul with HAVE_STDLIB_H. * emultempl/lnk960.em (lnk960_choose_target): Function should take two arguments. 2002-02-09 Chris Demetriou * ld.texinfo (Options): Add back in -nostdlib documentation, which had been inadvertently removed. 2002-02-09 Hans-Peter Nilsson * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Adjust register section vma to a sane value after emitting error. Make fatal conditions cause program exit when emitting message. 2002-02-08 Ivan Guzvinec * configure.tgt: Add or32-*-rtems target. 2002-02-08 Alexandre Oliva Contribute sh64-elf. 2002-01-24 Alexandre Oliva * emulparams/shelf32.sh (STACK_ADDR): Define as formerly defined in OTHER_RELOCATABLE_SECTIONS. 2002-01-18 Alexandre Oliva * emulparams/shelf32.sh (STACK_ADDR): Define. (OTHER_RELOCATABLE_SECTIONS): Renamed to... (OTHER_SECTIONS): this. Removed stack settings. * emulparams/shelf64.sh (OTHER_RELOCATABLE_SECTIONS): Do not set. (OTHER_SECTIONS): Reset after sourcing shelf32.sh. 2001-03-12 DJ Delorie * emultempl/sh64elf.em (sh64_elf_$_before_allocation): Disable relaxing if any shmedia or mixed sections are found. 2001-03-07 DJ Delorie * emultempl/sh64elf.em (sh64_elf_before_allocation): Pass f to einfo. Gracefully decline to output to non-elf formats. 2001-03-06 Hans-Peter Nilsson * emulparams/shelf64.sh (OTHER_RELOCATING_SECTIONS) <.stack>: Default to _end aligned to next multiple of 0x40000, plus 0x40000. * emulparams/shelf32.sh: Ditto. 2001-01-14 Hans-Peter Nilsson * emulparams/shelf32.sh (OTHER_RELOCATING_SECTIONS): Tweak comment. 2001-01-10 Ben Elliston * emulparams/shelf32.sh (OTHER_RELOCATING_SECTIONS): Avoid non-portable shell constructs. From Hans-Peter Nilsson. 2001-01-09 Hans-Peter Nilsson * emulparams/shelf64.sh (EXTRA_EM_FILE): Define empty. * Makefile.am (eshelf64.c, eshlelf64.c, eshlelf32.c): Adjust dependencies to the shell script include chain. * Makefile.in: Regenerate. 2001-01-06 Hans-Peter Nilsson * emultempl/sh64elf.em: Update and tweak comments. (sh64_elf_${EMULATION_NAME}_after_allocation): Always allocate and make a .cranges section SEC_IN_MEMORY. 2000-12-30 Hans-Peter Nilsson * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation): Don't stop when .cranges section found to be necessary; continue and set stored section contents flags for sections with non-mixed contents. Use a struct sh64_section_data container and sh64_elf_section_data to store contents-type flags. Remove unused update of "isec". (sh64_elf_${EMULATION_NAME}_after_allocation): Only process sections marked SHF_SH5_ISA32_MIXED. Use sh64_elf_section_data to access contents-type flags. Assert that the associated container is initialized. Use that container, not elf_gp_size, to hold size of linker-generated cranges contents. 2000-12-18 Hans-Peter Nilsson * emultempl/sh64elf.em (sh64_elf_${EMULATION_NAME}_before_allocation): Exit early if there's already a .cranges section. When section flag difference is found, don't NULL-check cranges a second time. Tweak comments. (sh64_elf_${EMULATION_NAME}_after_allocation): Use size after merging, not max size, as size of ld-generated .cranges contents. Don't set ELF section flags in output section. When checking for needed .cranges descriptors, don't use a variable; compare incoming ELF section flags directly to SHF_SH5_ISA32_MIXED. Tweak comments. 2000-12-18 Hans-Peter Nilsson * emultempl/sh64elf.em: New file. * Makefile.am (eshelf32.c, eshlelf32.c): Adjust dependencies. * Makefile.in: Regenerate. * emulparams/shelf32.sh (OUTPUT_FORMAT): Only set if not set. (OTHER_RELOCATING_SECTIONS): Ditto. (EXTRA_EM_FILE): New, set to sh64elf if not set. * emulparams/shlelf32.sh: Stub out all settings except OUTPUT_FORMAT. Source shelf32.sh. * emulparams/shelf64.sh: Similar, but also keep ELF_SIZE and OTHER_RELOCATING_SECTIONS. (OTHER_RELOCATING_SECTIONS): Remove .cranges. * emulparams/shlelf64.sh: Stub out all settings except OUTPUT_FORMAT. Source shelf64.sh. 2000-12-15 Hans-Peter Nilsson * emulparams/shelf64.sh (OTHER_RELOCATING_SECTIONS): Include .cranges section. (DATA_START_SYMBOLS): Define, provide ___data. (OTHER_READONLY_SYMBOLS): Define, provide ___rodata and align to 8 for consecutive .data section. (OTHER_GOT_SECTIONS): Define, align to 8 for consecutive .bss section after .data section. * emulparams/shlelf64.sh: Ditto. * emulparams/shelf32.sh: Ditto. (ALIGNMENT): Define to 8. * emulparams/shelf32.sh: Ditto. 2000-12-12 Hans-Peter Nilsson * configure.tgt (sh64-*-elf*): Assign targ_extra_libpath to get built-in linker scripts. 2000-11-30 Hans-Peter Nilsson * emulparams/shlelf64.sh: New. * emulparams/shelf64.sh: New. * configure.tgt (sh64-*-elf*): Add shelf64 and shlelf64 to targ_extra_emuls. * Makefile.am: Add support for shlelf64 and shelf64. * Makefile.in: Regenerate. 2000-11-29 Hans-Peter Nilsson * configure.tgt (sh64-*-elf*): Add shelf as default. Add shlelf to targ_extra_emuls. 2000-11-24 Hans-Peter Nilsson * emulparams/shelf32.sh: New file. * emulparams/shlelf32.sh: New file. * Makefile.am: Add support for shlelf32 and shelf32. * configure.tgt: Map sh64-*-elf* to shlelf32 and shelf32. * Makefile.in: Regenerate. 2002-02-05 Hans-Peter Nilsson * ldlang.c (lang_reset_memory_regions): Rename from reset_memory_regions. Change all callers. Make public. * ldlang.h (lang_reset_memory_regions): Prototype. * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Call lang_reset_memory_regions before lang_size_sections. * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise. * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Likewise. 2002-02-04 Hans-Peter Nilsson * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Use signed arithmetic when checking for too many global registers. 2002-02-02 Jason Thorpe * Makefile.am (ALL_EMULATIONS): Add ehppanbsd.o. (ehppanbsd.c): New rule. * Makefile.in: Regenerate. * configure.tgt (hppa*-*-netbsd*): New target. * emulparams/hppalinux.sh: Add comment to check other files that source this file it is modified, and list which files that do. * emulparams/hppanbsd.sh: New file. 2002-02-01 Geoffrey Keating * scripttempl/xstormy16.sc: Don't allocate extra space for the stack. 2002-02-01 Hans-Peter Nilsson Support on-demand global register allocation from R_MMIX_BASE_PLUS_OFFSET relocs. * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Rename from mmix_set_reg_section_vma. Call _bfd_mmix_finalize_linker_allocated_gregs. (mmix_before_allocation): New function. (LDEMUL_AFTER_ALLOCATION): Set to mmix_after_allocation. (LDEMUL_BEFORE_ALLOCATION): Define to mmix_before_allocation. * scripttempl/mmo.sc (.text): Mark .init, .fini as KEEP. (.MMIX.reg_contents): Add .MMIX.reg_contents.linker_allocated before .MMIX.reg_contents. * emultempl/mmo.em (gldmmo_before_allocation): Define to default. (mmo_after_open): New function. (LDEMUL_AFTER_OPEN): Define to mmo_after_open. * emulparams/elf64mmix.sh (OTHER_SECTIONS): Tweak formatting. Add .MMIX.reg_contents.linker_allocated before .MMIX.reg_contents. 2002-01-31 Ivan Guzvinec * emulparams/or32.sh: New file. * emulparams/or32elf.sh: New file. * scripttempl/or32.sc: New file. * configure.tgt : Add support for or32. * configure: Regenerate * Makefile.am: Add support for or32. * Makefile.in: Regenerate. * NEWS: Mention support for or32. * po/ld.pot: Regenerate. 2002-01-29 Chris Demetriou Mitch Lichtenberg * emulparams/elf32bmip.sh (EXTRA_EM_FILE): Define to be mipself. * emultempl/mipself.em: New file to handle MIPS ELF embedded reloc creation (ld --embedded-relocs). 2002-01-27 Daniel Jacobowitz * configure: Regenerated. 2002-01-26 Hans-Peter Nilsson * Makefile.am (install): Depend on install-info. * Makefile.in: Regenerate. 2002-01-26 Christian Rose * ldmain.c (main): Use full sentences to ease translation. 2002-01-26 Nick Clifton * po/fr.po: Updated version. 2002-01-25 Nick Clifton * po/es.po: Updated version. 2002-01-25 Andreas Jaeger * ldlex.l (yy_input): Correct error check. 2002-01-25 Alan Modra * ldmisc.c (demangle): Put back dots when string not demangled. 2002-01-22 Richard Henderson * emulparams/elf64alpha.sh (NOP): Use unop. 2002-01-21 Andreas Jaeger * ldlex.l: Use fread instead of read. 2002-01-21 Jason Thorpe * configure.tgt (ia64-*-netbsd*): New target. 2002-01-21 H.J. Lu * emulparams/elf32btsmip.sh (SHLIB_TEXT_START_ADDR): Change to 0. * emulparams/elf64btsmip.sh (SHLIB_TEXT_START_ADDR): Likewise. 2002-01-18 Andreas Jaeger * ldver.c (ldversion): Update year. 2002-01-17 Nick Clifton * po/ld.pot: Regenerate. 2002-01-16 Alan Modra * Makefile.am (eelf64ppc.c, eelf64lppc.c): Depend on ppc64elf.em. * Makefile.in: Regenerate. * emulparams/elf64ppc.sh (EXTRA_EM_FILE): Define. * emultempl/ppc64elf.em: New file. 2002-01-15 DJ Delorie * scripttempl/pe.sc: Add support for constructor priorities. 2002-01-07 Marek Michalkiewicz * emulparams/avr1200.sh (DATA_START): Define as 0x60. * emulparams/avr23xx.sh: Likewise. * emulparams/avr4433.sh: Likewise. * emulparams/avr44x4.sh: Likewise. * emulparams/avr85xx.sh: Likewise. * emulparams/avrmega103.sh: Likewise. * emulparams/avrmega161.sh: Likewise. * emulparams/avrmega603.sh: Likewise. * scripttempl/elf32avr.sc: Use DATA_START instead of 0x60. 2002-01-08 Alexandre Oliva * ldlang.c (walk_wild_section): Exclude object file if enclosing archive is excluded. 2002-01-07 Jason Thorpe * Makefile.am (ALL_EMULATIONS): Add eshelf_nbsd.o and eshlelf_nbsd.o. (eshelf_nbsd.c): New rule. (eshlelf_nbsd.c): New rule. * Makefile.in: Regenerate. * configure.tgt (sh*le-*-netbsdelf*): New target. (sh*-*-netbsdelf*): New target. * emulparams/shelf.sh: Document that shelf_nbsd.sh sources this file. * ld/emulparams/shelf_nbsd.sh: New emulation. * ld/emulparams/shlelf_nbsd.sh: New emulation. 2002-01-07 Nick Clifton * po/es.po: New file: Spanish translation. * configure.in (ALL_LINGUAS): Add es. * configure: Regenerate. 2002-01-06 John Marshall * ld.texinfo: Note that --emit-relocs is currently only implemented for ELF. 2002-01-05 Alan Modra * 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-04 Jason Thorpe * configure.tgt (x86_64-*-netbsd*): New target. 2001-12-21 Tom Rix (gld*_create_output_section_statements): New function. For -binitfini support. * emultempl/aix.em (gld*_before_parse): Fix comment. * emultempl/aix.em (gld*_parse_args): Fix comment. 2001-12-20 Jason Thorpe * configure.tgt (mips*-dec-netbsd*): Delete alias for mips*el-*-netbsd*. (sparc64-*-netbsd*): Add elf32_sparc to targ_extra_emuls. * configure.tgt (arm-*-netbsdelf*): Add target. (arm-*-netbsd*): Add armelf and armelf_nbsd to targ_extra_emuls. * emulparams/armelf_nbsd.sh: Added. * Makefile.am: Add rules for earmelf_nbsd. * Makefile.in: Regenerate. 2001-12-19 Andreas Jaeger , Susanne Oberhauser * configure.host: Add rules for x86_64-*linux-gnu. Change s390x-linux entry to use gcc to report configuration, replace gcc with $CC in s390-linux 2001-12-19 Andreas Jaeger * ld.texinfo (VERSION): Fix markup. 2001-12-18 matthew green * Makefile.am (ALL_EMULATIONS): Add m68kelfnbsd.o. (m68kelfnbsd.c): New rule. * Makefile.in: Regenerate. * configure.tgt (m68*-hp-netbsd*): Renamed to .. (m68*-*-netbsd*4k*): .. this. (m68*-*-netbsdelf*): New target. (m68*-*-netbsd*): Also include ELF support. (m68*-*-netbsdaout*): New alias for m68*-*-netbsd*. * emulparams/m68kelfnbsd.sh: New emulation. 2001-12-18 Jakub Jelinek * ldgram.y (vers_node): Support anonymous version tags. * ldlang.c (lang_register_vers_node): Ensure anonymous version tag is not defined together with non-anonymous versions. * ld.texinfo: Document it. 2001-12-18 Nick Clifton * po/tr.po: New file: Turkish translation. * configure.in (ALL_LINGUAS): Add tr. * configure: Regenerate. 2001-12-17 Jason Thorpe * Makefile.am: Add rules for eelf64alpha_nbsd. * Makefile.in: Regenerate. * configure.tgt (alpha*-*-netbsd*): Set targ_emul to elf64alpha_nbsd. * emulparams/elf64alpha_nbsd.sh: Added. 2001-12-17 Alan Modra * 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-16 Hans-Peter Nilsson * scripttempl/mmo.sc: Add .debug_ranges to listed sections. 2001-12-15 Alan Modra * ldmain.c (main): Initialise link_info.eh_frame_hdr. 2001-12-13 Jakub Jelinek * emultempl/elf32.em (finish): Supply output_bfd to bfd_elf*_discard_info. (OPTION_EH_FRAME_HDR): Define. (longopts): Add --eh-frame-hdr. (parse_args): Handle it. (list_options): Add --eh-frame-hdr to help. * emultempl/hppaelf.em (finish): Supply output_bfd to bfd_elf*_discard_info. * scripttempl/elf.sc (.eh_frame_hdr): Add. 2001-12-13 Alan Modra * lexsup.c (parse_args): Don't pass shortopts to second call to getopt functions. Restore optind rather than decrementing before second call. Remove errind as it now duplicates last_optind. 2001-12-11 Christopher Faylor * emultempl/pe.em (gld_${EMULATION_NAME}_list_options): Fix typo. 2001-12-07 Geoffrey Keating Richard Henderson * Makefile.am: Add support for xstormy16. * configure.tgt: Add support for xstormy16. * Makefile.in: Regenerate. * emulparams/elf32xstormy16.sh: New file. * scripttempl/xstormy16.sc: New file. 2001-10-01 Christopher Faylor * Makefile.in (LIB_PATH): Make configurable. (GENSCRIPTS): Set LIB_PATH in environment. * configure.in: Substitute LIB_PATH. * configure: Regenerate. * configure.tgt (*cygwin): Set LIB_PATH for cross build. * configure.host (*cygwin): Add /usr/lib/w32api to NATIVE_LIB_DIRS. 2001-12-07 Nick Clifton * lexsup.c (ld_options): Insert 'PROGRAM' into the text string describing the -N option so that it is easier to translate into foreign languages. 2001-12-05 Nick Clifton * emultempl/pe.em (..._list_options): Replace multiple fprintf statements describing a single option with a single, newline escaped fprintf. This allows better translation into other languages. * ldmain.c (add_archive_element): Combine multiple strings into a single string to permit better translation into other languages. 2001-12-05 Tom Rix * Makefile.am: Remove eaixppc64. * Makefile.in: Regenerate. 2001-12-04 Tom Rix * emultempl/aix.em (choose_target): Change default target to OUTPUT_FORMAT for ppcmacos. Add braces to remove compiler warning. (gld*_read_file): Fix typo. (change_symbol_mode): Add prototype. (is_syscall): Same. * emulparams/aixppc.sh (SYSCALL_MASK, SYMBOL_MODE_MASK): Delete. * emulparams/aixrs6.sh : Same. * emulparams/ppcmacos.sh : Same. * emulparams/aixppc64.sh : Delete file. * emultempl/aix.em : Formatting changes. 2001-12-04 Hans-Peter Nilsson * emulparams/criself.sh (NO_SMALL_DATA): Set, to yes. (OTHER_BSS_END_SYMBOLS): Don't refer to .sbss when setting __Sbss. (OTHER_END_SYMBOLS): Fix formatting. * emulparams/crislinux.sh (NO_SMALL_DATA): Set, to yes. (OTHER_END_SYMBOLS): Fix formatting. 2001-12-04 Alan Modra * ldexp.c (exp_print_token): Correct "table" entry for RSHIFT. 2001-12-02 Tom Rix * configure.tgt : Remove eaixppc64 emulations. * Makefile.in : Remove eaixppc64.c * ldemul.c (ldemul_choose_target): New parameters argc, argv. (ldemul_default_target): Same. * emultempl/gld960.em (gld960_choose_target): Same. * emultempl/gld960c.em (gld960_choose_target): Same. * scripttempl/aix.sc: Remove OUTPUT_FORMAT. * emultempl/aix.em (is_syscall): syscall_mask now a variable. * emultempl/aix.em (gld*_read_file): symbol_mode_mask now a variable. * emultempl/aix.em (gld*_parse_args): Handle -b32 -b64 emulation. * emultempl/aix.em (choose_target): New function. Handle emulation of -b32 and -b64. 2001-11-27 H.J. Lu * emulparams/elf_i386.sh (NO_SMALL_DATA): Set to yes. * emulparams/elf_i386_be.sh (NO_SMALL_DATA): Likewise. * emulparams/elf_i386_chaos.sh (NO_SMALL_DATA): Likewise. * emulparams/elf_i386_ldso.sh (NO_SMALL_DATA): Likewise. * emulparams/elf_x86_64.sh (NO_SMALL_DATA): Likewise. * emulparams/m68kelf.sh (NO_SMALL_DATA): Likewise. * emulparams/elf32_sparc.sh (NO_SMALL_DATA): Likewise. * emulparams/elf64_sparc.sh (NO_SMALL_DATA): Likewise. * scripttempl/elf.sc (SBSS): New. Define if ${NO_SMALL_DATA} is not empty. (SDATA): Likewise. (REL_SDATA): Likewise. (REL_SBSS): Likewise. (REL_SDATA2): Likewise. (REL_SBSS2): Likewise. (SBSS2): Define if ${NO_SMALL_DATA} is not empty. (SDATA2): Likewise. 2001-11-25 Stephane Carrez * scripttempl/elfm68hc11.sc (CTOR, DTOR): Put constructor and destructor in rom. * scripttempl/elfm68hc12.sc (CTOR, DTOR): Likewise. 2001-11-22 H.J. Lu * Makefile.in: Regenerated with automake based on automake 1.4-8 in RedHat 7.1. 2001-11-22 Alan Modra * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Define. (config.status): Delete rule. Add extra dependencies to cover sourced emulparams files. * Makefile.in: Regenerate. * scripttempl/elf.sc: Order
,
.* and corresponding linkonce sections as seen in input files. Formatting fixes. Zero vma of all sections if not relocating. (STACK): Define and insert if STACK_ADDR defined. (OTHER_RELOCATING_SECTIONS): Delete. (OTHER_END_SYMBOLS): Define. (OTHER_READONLY_SECTIONS): Always insert, not just when relocating. (OTHER_READWRITE_SECTIONS): Likewise. (OTHER_GOT_SECTIONS): Likewise. (OTHER_SDATA_SECTIONS): Likewise. (OTHER_BSS_SECTIONS): Likewise. * scripttempl/elfi370.sc (OTHER_READONLY_SECTIONS): Likewise. (OTHER_READWRITE_SECTIONS): Likewise. * scripttempl/nw.sc (OTHER_READONLY_SECTIONS): Likewise. (OTHER_READWRITE_SECTIONS): Likewise * emulparams/armelf.sh (OTHER_RELOCATING_SECTIONS): Delete. (STACK_ADDR): Define. * emulparams/armelf_oabi.sh: As for armelf.sh. * emulparams/elf32mcore.sh: As for armelf.sh. * emulparams/h8300elf.sh: As for armelf.sh. * emulparams/mn10200.sh: As for armelf.sh. * emulparams/shelf.sh: As for armelf.sh. * emulparams/elf32fr30.sh (OTHER_RELOCATING_SECTIONS): Delete. (OTHER_END_SYMBOLS): Define. * emulparams/m32relf.sh: As for elf32fr30.sh. * emulparams/h8300helf.sh: As for elf32fr30.sh. * emulparams/h8300self.sh: As for elf32fr30.sh. * emulparams/criself.sh (OTHER_READONLY_SECTIONS): Protect symbol defines with RELOCATING test. (OTHER_SDATA_SECTIONS): Likewise. (OTHER_RELOCATING_SECTIONS): Delete, replacing with.. (OTHER_END_SYMBOLS): ..this. * emulparams/crislinux.sh: As for criself.sh. * emulparams/elf32bmipn32.sh (OTHER_SDATA_SECTIONS): Zero vma if not relocating. (OTHER_RELOCATING_SECTIONS): Delete, replacing with.. (OTHER_SECTIONS): ..this. Zero vma if not relocating. Order normal and linkonce sections as seen in input files. * emulparams/elf32bmip.sh (DATA_ADDR): Don't define if EMBEDDED. (TEXT_DYNAMIC): Likewise. (INITIAL_READONLY_SECTIONS): Zero vma if not relocating. (OTHER_SDATA_SECTIONS): Likewise. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Likewise. * emulparams/shlelf_linux.sh (OTHER_READWRITE_SECTIONS): Likewise. * emulparams/elf64alpha.sh (OTHER_READONLY_SECTIONS): Likewise. * emulparams/hppalinux.sh (OTHER_READONLY_SECTIONS): Likewise. * emulparams/elf64_aix.sh (OTHER_GOT_SECTIONS): Likewise. (OTHER_PLT_RELOC_SECTIONS): Likewise. (OTHER_READONLY_SECTIONS): Likewise. Order normal and linkonce sections as seen in input files. * emulparams/elf64_ia64.sh: As for emulparams/elf64_aix.sh. * emulparams/hppa64linux.sh (OTHER_READONLY_SECTIONS): Zero vma if not relocating. (OTHER_READWRITE_SECTIONS, OTHER_BSS_SECTIONS): Likewise. (OTHER_BSS_END_SYMBOLS): Merge from elf64hppa.sh. * emulparams/elf64mmix.sh (OTHER_RELOCATING_SECTIONS): Delete. (OTHER_SECTIONS): Instead, use this.. (OTHER_END_SYMBOLS): ..and this. * emulparams/elf32b4300.sh: Source elf32bmip.sh, remove duplicates. * emulparams/elf32bsmip.sh: Likewise. * emulparams/elf32btsmip.sh: Likewise. * emulparams/elf32ebmip.sh: Likewise. * emulparams/elf32lmip.sh: Likewise. * emulparams/elf32elmip.sh: Source elf32lmip.sh, remove duplicates. * emulparams/elf32lsmip.sh: Likewise. * emulparams/elf32ltsmip.sh: Source elf32btsmip.sh, remove duplicates. * emulparams/elf32l4300.sh: Source elf32b4300.sh, remove duplicates. * emulparams/elf64bmip.sh: Source elf32bmipn32.sh, remove duplicates. * emulparams/elf64btsmip.sh: Likewise. * emulparams/elf64ltsmip.sh: Source elf64btsmip.sh, remove duplicates. * emulparams/elf32lppc.sh: Source elf32ppc.sh, remove duplicates. * emulparams/elf32ppclinux.sh: Likewise. * emulparams/elf32ppcsim.sh: Likewise. * emulparams/elf32lppcsim.sh: Source elf32lppc.sh, remove duplicates. * emulparams/elf64hppa.sh: Source hppa64linux.sh, remove duplicates. * emulparams/h8300helf.sh: Source h8300elf.sh, remove duplicates. * emulparams/h8300self.sh: Likewise. * emulparams/mn10300.sh: Source mn10200.sh, remove duplicates. * emulparams/sh.sh: Comment. * emulparams/shl.sh: Source sh.sh, remove duplicates. * emulparams/shlelf.sh: Source shelf.sh, remove duplicates. * emulparams/shelf_linux.sh: Source shlelf_linux.sh, remove duplicates. 2001-11-21 David Heine Alan Modra * ldlang.c (map_input_to_output_sections): Replace "break" accidentally removed with 2001-08-03 change. (lang_gc_sections_1): Likewise. 2001-11-21 Alan Modra * ldlang.c (walk_wild_section): Move sec == NULL case out of loop. 2001-11-20 Angela Marie Thomas * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Use NULL instead of false when calling lang_size_sections. * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise. 2001-11-15 Alan Modra * emultempl/elf32.em (gld${EMULATION_NAME}_finish): Only emit this function when LDEMUL_FINISH isn't set to the same name. Don't call ${LDEMUL_FINISH}. (ld_${EMULATION_NAME}_emulation): Call $LDEMUL_FINISH if defined. * emultempl/armelf.em (arm_elf_finish): Call gld${EMULATION_NAME}_finish. * emultempl/hppaelf.em (hppaelf_finish): Rename to gld${EMULATION_NAME}_finish. Call bfd_elf32_discard_info and hppaelf_layout_sections_again if necessary. (need_laying_out): New var. (hppaelf_layaout_sections_again): Rename to hppaelf_layout_sections_again. Clear need_laying_out. (PARSE_AND_LIST_OPTIONS): Format text. 2001-11-14 H.J. Lu * emultempl/armelf.em (arm_elf_finish): Renamed from gld${EMULATION_NAME}_finish. (LDEMUL_FINISH): Set to arm_elf_finish. 2001-11-14 Daniel Jacobowitz * emultempl/elf32.em (gld${EMULATION_NAME}_finish): New. (struct ld_emulation_xfer_struct): Use it. 2001-11-13 Ross Alexander * emulparams/elf64hppa.sh (OTHER_BSS_END_SYMBOLS): Add additional symbols referenced by newer crt0.o files from HP. 2001-11-12 Anthony Green * emulparams/armelf.sh (DATA_START_SYMBOLS): New symbol. 2001-11-12 Alfred M. Szmidt * Makefile.am (GENSCRIPTS): Quote ${exec_prefix}. * Makefile.in: Regenerate. 2001-11-02 Stephane Carrez * ld.texinfo: Use @command for commands, @option for options. * Makefile.am (POD2MAN): Use 'GNU Development Tools' for the page man title. * Makefile.in: Rebuild. 2001-11-04 Chris Demetriou * configure.tgt (mips*el-*-netbsd*, mips*-*-netbsd*): Add support for targets. 2001-11-02 Nick Clifton * configure.in (ALL_LINGUAS): Add "fr" and "sv" * configure: Regernate. * po/fr.po: New file. * po/sv.po: New file. 2001-11-01 NIIBE Yutaka * configure.tgt (sh-*-linux): Set targ_emul, targ_extra_emuls as little endian default and to support big endian. 2001-11-01 Chris Demetriou * ld.texinfo (Options): Document new option, -nostdlib. * lexsup.c (OPTION_NOSTDLIB): New definition. (ld_options): Add entry for "nostdlib". (parse_args): Handle OPTIONS_NOSTDLIB. * ldfile.c (ldfile_add_library_path): Don't add directories to the search path if they weren't specified on the command line and -nostdlib was specified. * ld.h (ld_config_type): New member only_cmd_line_lib_dirs. 2001-10-31 Nick Clifton * lexsup.c (parse_args): Prevent infinite parsing loop when "-rpath.a" is specified on the command line. Replace calls to fprintf with calls to einfo. 2001-10-31 John Marshall * ld.texinfo: A historical requirement that MEMORY and SECTIONS appear only once across all the linker scripts involved in a link invocation no longer applies. Make the documentation reflect that. 2001-10-31 NIIBE Yutaka * configure.tgt: Supports sh3/sh4/sh3eb/sh4eb-unknown-linux-gnu targets. (sh-*-linux*): Added targ_extra_libpath. 2001-10-31 David Heine * ldlang.c (lang_size_sections): Keep a valid output_offset field for padding statements. 2001-10-30 Hans-Peter Nilsson * configure.tgt (mmix-*-*): New target. * Makefile.am (ALL_EMULATIONS): Add eelf64mmix.o and emmo.o. Add dependencies to match. * emulparams/mmo.sh, emulparams/elf64mmix.sh, emultempl/mmo.em, emultempl/mmix-elfnmmo.em, emultempl/mmixelf.em, scripttempl/mmo.sc: New files. * gen-doc.texi: @set MMIX. * ld.texinfo: Ditto. [MMIX] Add MMIX node. * Makefile.in: Regenerate. 2001-10-29 Kazu Hirata * ldlang.c: Fix a comment typo. 2001-10-23 Alan Modra * configure.host: Move alpha*-*-linux-gnu* entry to generic entries, and match *-*-linux*. 2001-10-20 Alan Modra * ldgram.y (mri_script_command): Surround processing of INCLUDE with ldlex_script, ldlex_popstate. (ifile_p1): Likewise. * ldlex.l (EOF): Don't BEGIN(SCRIPT). Restore lineno from the correct slot. (lex_push_file): Save current lineno to lineno_stack. Set lineno to 1. Don't BEGIN(SCRIPT). (lex_redirect): Similarly. * ldmain.c (main): Set yydebug non-zero if YYDEBUG. 2001-10-20 Nick Clifton * scripttempl/armcoff.sc: Define __EH_FRAME_BEGIN__ and __EH_FRAME_END__ and accept eh frames into data section. Add ctor and dtor sections. 2001-10-19 Danny Smith * pe-dll.c (autofilter_objectlist): Add gcrt0.o. (auto-export): Fix indentation. 2001-10-18 Danny Smith * pe-dll.c (autofilter_objectlist): Add startup objects for profiling. (auto-export): Constify char * p. Extract file basename and use strcmp rather than ststr for object lookup. 2001-10-18 Chris Demetriou * ldmain.c (get_emulation): Improve comment about the handling of -mipsN options. 2001-10-17 Alan Modra * po/POTFILES.in: Regenerate. 2001-10-16 Vassili Karpov * emultempl/elf32.em (gld*_list_options): Remove extra '\t' from -z nocopyreloc and -z nocombreloc usage strings. 2001-10-12 Vassili Karpov * emultempl/elf32.em (gld*_list_options): Include -z nocopyreloc in usage. 2001-10-11 Aleksey Romanov * scripttempl/armaout.sc: Place .bss section after end of aligned data section to match behaviour of aout code in constructrion of header. 2001-10-11 Danny Smith * pe-dll.c (autofilter_entry_type autofilter_liblist: Add startup files for mingw32 dlls to list. 2001-10-10 Chris Demetriou * emultempl/elf32.em: Fix shell 'if' usage for portability. 2001-10-08 Aldy Hernandez * configure.tgt (targ): Add arm9e-*-elf. 2001-10-05 H.J. Lu * genscripts.sh: Fix a typo in the last change. 2001-10-05 Jakub Jelinek * emultempl/elf32.em (gld_*_list_options): Include -z combreloc and -z nocombreloc in usage. 2001-10-03 Jim Blandy * genscripts.sh: Include a comment at the top of each generated script, explaining its purpose. 2001-10-03 Vassili Karpov * emultempl/elf32.em (parse_args): Handle -z nocopyreloc. * NEWS: Mention -z nocopyreloc. * ld.texinfo (Options): Describe nocopyreloc. 2001-10-03 Alan Modra * configure: Regenerate. 2001-10-02 Alan Modra * ldver.h (ld_program_version): Remove declaration. * lexsup.c (parse_args): Move printing of copyright message.. * ldver.c (ldversion): .. to here. Use BFD_VERSION_STRING in place of BFD_VERSION. (ld_program_version): Remove. * Makefile.am (Makefile): Depend on bfd/configure.in. Run "make dep-am". * Makefile.in: Regenerate. 2001-09-30 Hans-Peter Nilsson * Makefile.am: Update dependencies with "make dep-am". * Makefile.in: Regenerate. 2001-09-29 John Reiser * ldlang.c (lang_common): Conditionally inhibit Common allocation. * lexsup.c: Add --no-define-common commandline option. * ldgram.y: Add INHIBIT_COMMON_ALLOCATION script command. * ldlex.l: Likewise. * ld.h: Add command_line.inhibit_common_definition. * ldmain.c (main): Initialize. * ld.texinfo: Document. 2001-09-26 Alan Modra * ldmisc.c (USE_STDARG): Remove. (info_msg): Define using VPARAMS, VA_OPEN, VA_FIXEDARG, VA_CLOSE. (einfo): Likewise. (minfo): Likewise. (lfinfo): Likewise. * ldmisc.h: Remove #ifdef ANSI_PROTOTYPES and non-ansi declarations. Update copyright. 2001-09-24 Charles Wilson * pe-dll.c: Remove obsoleted declaration of pe_get_data_import_dll_name. (pe_create_import_fixup): Fix thinko. * ld.texinfo(enable-auto-import): Clarify the explanation. 2001-09-24 Nick Clifton * pe-dll.c (pe_create_import_fixup): Revert previous patch. * emultemp/pe.em (pe_data_import_dll): Move definition outside of DLL_SUPPORT controlled code. 2001-09-24 Charles Wilson * emultempl/pe.em(pe_data_import_dll): Make static. (pe_get_data_import_dll_name): New accessor function. * pe-dll.c(pe_create_import_fixup): call pe_get_data_import_dll_name() from pe.em, instead of directly accessing pe_data_import_dll variable from pe.em. 2001-09-18 Bruno Haible * deffilep.y: Include "safe-ctype.h" instead of . (def_file_add_directive): Use ISSPACE instead of isspace. (def_lex): Use ISDIGIT/ISXDIGIT/ISALPHA/ISALNUM instead of isdigit/isxdigit/isalpha/isalnum. * emultempl/aix.em: Include "safe-ctype.h" instead of . (gld${EMULATION_NAME}_read_file): Use ISSPACE instead of isspace. * emultempl/elf32.em: Include "safe-ctype.h" instead of . (gld${EMULATION_NAME}_place_orphan): Use ISALNUM instead of isalnum. * emultempl/gld960c.em: Include "safe-ctype.h" instead of . (gld960_set_output_arch): Use ISUPPER/TOLOWER instead of isupper/tolower. * emultempl/sunos.em: Include "safe-ctype.h" instead of . (gld${EMULATION_NAME}_search_dir): Use ISDIGIT instead of isdigit. * ldctor.c: Include "safe-ctype.h" instead of . (ctor_prio): Use ISDIGIT instead of isdigit. * ldfile.c: Include "safe-ctype.h" instead of . (ldfile_open_file_search): Use ISALPHA instead of isalpha. (ldfile_add_arch): Use ISUPPER/TOLOWER instead of isupper/tolower. * ldlang.c: Include "safe-ctype.h" instead of . (stricpy): Use TOLOWER instead of isupper/tolower. (lang_leave_overlay_section): Use ISALNUM instead of isalnum. * ldlex.l: Include "safe-ctype.h" instead of . (lex_warn_invalid): Use ISPRINT instead of isprint. * ldmain.c: Include "safe-ctype.h" instead of . (main): For gettext, also set the LC_CTYPE locate facet. (add_keepsyms_file): Use ISSPACE instead of isspace. * lexsup.c: Include "safe-ctype.h" instead of . (is_num, parse_args): Use ISDIGIT instead of isdigit. * mpw-elfmips.c: Include "safe-ctype.h" instead of . (gldelf32ebmip_place_orphan): Use ISALNUM instead of isalnum. * mpw-eppcmac.c: Include "safe-ctype.h" instead of . (gldppcmacos_read_file): Use ISSPACE instead of isspace. * pe-dll.c: Include "safe-ctype.h" instead of . (quoteput): Use ISSPACE instead of isspace. (pe_dll_generate_implib, pe_process_import_defs): Use ISALNUM instead of isalnum. 2001-09-18 Alan Modra * deffilep.y (def_stash_module): Constify "name" param. * pe-dll.c: Replace CONST with const throughout. (quick_symbol): Constify "n1", "n2", "n3" params. (make_singleton_name_thunk): Constify "import" param. Make "buffer_len" a size_t. (make_import_fixup_entry): Constify "name", "fixup_name", "dll_symname" params. (pe_get16): Cast args of bfd_seek. Replace bfd_read with bfd_bread. (pe_get32): Likewise. (pe_implied_import_dll): Likewise. * emultempl/beos.em (sort_by_file_name): Constify "ra", "rb". (sort_by_section_name): Likewise. * emultempl/pe.em: Move defines for arm_epoc_pe before bfd.h included. (make_import_fixup): Cast printf arg, rel->address to long rather than int. (gld_${EMULATION_NAME}_after_open): Don't compare NULL against int. 2001-09-15 Alan Modra * ldmain.c (main): Rename BufferSize to ld_bufsz because HPUX defines BufferSize. Increase buffer size by one. 2001-09-14 Ralf Habacker * pe-dll.c (pe_walk_relocs_of_symbol): Fix memory leak. 2001-09-14 Kevin Lo * configure.tgt: Add arm-openbsd target. 2001-09-12 H.J. Lu * Makefile.am (ALL_EMULATIONS): Move eelf64ppc.o and eelf64lppc.o to ... (ALL_64_EMULATIONS): Here. * Makefile.in: Regenerated. 2001-09-12 Paul Sokolovsky * emultempl/pe.em(make_import_fixup): change signature to take asection as well as arelec; we need this for proper error reporting. Only call pe_create_import_fixup() if there is no attempt to add a constant addend to the reloc; otherwise, report error condition. * pe-dll.c(pe_walk_relocs_of_symbol): change signature, since final argument is a pointer to make_import_fixup(). Change call to cb() to match make_import_fixup() signature. (make_import_fixup_mark): make buffer_len unsigned. * pe-dll.h: change signature of pe_walk_relocs_of_symbol. 2001-09-12 Charles Wilson * ld.texinfo: add verbose documentation for auto-import direct-addressing workaround, to compliment the terse error message. 2001-09-12 Andrew MacLeod * scripttempl/v850.sc: Add gcc_except_table sections. 2001-09-11 Jeffrey A Law (law@cygnus.com) * emulparams/h8300helf.sh: Move stack to a much higher memory address. * emulparams/h8300self.sh: Similarly. 2001-09-05 Danny Smith * ld.texinfo (Options, --stack): Correct default value for stack reserve. 2001-09-05 Tom Rix * emultempl/aix.em : Handle import file XMC_XO and syscall symbols. 2001-09-03 Andreas Jaeger * emultempl/beos.em: Declare prototypes for comparions functions, adjust definitions. 2001-09-02 Andreas Jaeger * emultempl/aix.em: Add missing prototype. * emultempl/lnk960.em: Likewise. * emultempl/vanilla.em: Likewise. * emultempl/armcoff.em: Likewise. * emultempl/armelf_oabi.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/gld960c.em: Likewise. * emultempl/gld960.em: Likewise. * emulparams/elf64alpha.sh (PARSE_AND_LIST_PROLOGUE): Add parameter for prototype declaration. 2001-08-31 Eric Christopher Jason Eckhardt * ldmain.c (get_emulation): Add support for -mips32 and -mips64. 2001-08-31 Andreas Jaeger * emultempl/pe.em: Add missing prototypes. (gld_${EMULATION_NAME}_after_open): Remove extra args to pe_find_data_imports. (pr_sym): Add unused attribute. 2001-08-29 Joel Sherrill * configure.tgt (i[3456]86-*-rtems*, m68*-*-rtems*): Change default from coff to elf. 2001-08-29 Jeff Law * emulparams/h8300helf.sh: Resync with h8300elf.sh. Update ARCH specification. * emulparams/h8300self.sh: Similarly. 2001-08-28 J"orn Rennecke * Makefile.am (ALL_EMULATIONS): Add eh8300elf.o, eh8300elf.o and eh8300self.o . (eh8300elf.c, eh8300helf.c, eh8300self.c): New targets. * configure.tgt (h8300-*-elf*): New case. * emulparams/h8300elf.sh, emulparams/h8300helf.sh: New files. * emulparams/h8300self.sh: New file. * Makefile.in: Regenerated. 2001-08-28 Nick Clifton * ldmain.c (main): Rename BSIZE to BufferSize to avoid collision with macro name. 2001-08-27 Linus Nordberg Alan Modra * Makefile.am (ALL_EMULATIONS): Add eelf64ppc.o and eelf64lppc.o. (eelf64ppc.c, eelf64lppc.c): Add make targets. Run "make dep-am" * Makefile.in: Regenerate. * configure.tgt: Add powerpc64 support. Move pdp11, pjl, pj entries to correct alphabetical position. * emulparams/elf64ppc.sh: New. * emulparams/elf64lppc.sh: New. 2001-08-27 Nick Clifton * ldmain.c (main): Declare BSIZE as static. 2001-08-23 Jakub Jelinek * emultempl/elf32.em (place_orphan): Place orphan .rel* sections into .rel.dyn resp. .rela.dyn if combreloc. (get_script): If .x linker script is equal to .xn, only put it once into the binary. Add .xc and .xsc scripts. (parse_args): Handle -z combreloc and -z nocombreloc. * scripttempl/elf.sc (.rela.sbss): Fix a typo. For .xc and .xsc scripts put all .rel* or .rela* input sections but .rel*.plt and PLT-like sections into .rel.dyn resp. .rela.dyn. * genscripts.sh (GENERATE_COMBRELOC_SCRIPT): Set if SCRIPT_NAME is elf. Strip trailing whitespace from script. Generate .xc and .xsc scripts if requested. * ldmain.c (main): Initialize link_info.combreloc and link_info.spare_dynamic_tags. * lexsup.c (OPTION_SPARE_DYNAMIC_TAGS): Define. (ld_options): Add --spare-dynamic-tags option. (parse_args): Likewise. * ld.texinfo: Document -z combreloc and -z nocombreloc. * ldint.texinfo: Document .xc and .xsc linker scripts. * NEWS: Add notes about -z combreloc and SHF_MERGE. 2001-08-22 H.J. Lu * emulparams/elf32fr30.sh: Add a newline. 2001-08-21 Andreas Jaeger * deffilep.y: Add missing prototypes. * pe-dll.c: Likewise. 2001-08-20 Alan Modra * ldlang.c (insert_pad): Fix typos in last patch. * ldlang.c: When traversing lang_statement_union_type lists, consistently use "header.next" rather than "next". * mpw-eppcmac.c: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/pe.em: Likewise. * ldlang.h (union lang_statement_union): Remove "next" field. * ldlang.c (insert_pad): Use offsetof macro. (lang_size_sections): Always neuter padding statements. * emultempl/hppaelf.em (hppaelf_delete_padding_statements): Delete. * pe-dll.c (pe_dll_fill_sections): Correct type of "relax" param passed to lang_size_sections. (pe_exe_fill_sections): Likewise. * emultempl/pe.em (output_prev_sec_find): Copied from elf32.em. (gld_${EMULATION_NAME}_place_orphan): Merge from elf32.em. 2001-08-18 Alan Modra * emultempl/aix.em: Formatting fixes. 2001-08-18 Alan Modra * ldlang.c (insert_pad): Make use of an existing pad statement if available. Move code calculating alignment, adjusting section alignment power, and adjusting dot to .. (size_input_section): .. here. Remove unused relax param. (lang_size_sections): Change boolean `relax' param to boolean *. Adjust call to size_input_section. Make use of insert_pad to place pad after the assignment statement. If relaxing, zap padding statements. (reset_memory_regions): Reset output_bfd section sizes too. (relax_again): Move to.. (lang_process): ..here. Adjust call to lang_size_sections, and remove duplicated code. * ldlang.h (lang_size_sections): Change `relax' param to boolean *. 2001-08-17 Alan Modra * ld.texinfo: Document that fill values now use the four least significant bytes. * emulparams/elf32fr30.sh (NOP): Update. * emulparams/elf32mcore.sh: Likewise. * emulparams/elf64_s390.sh: Likewise. * emulparams/elf_i386.sh: Likewise. * emulparams/elf_i386_be.sh: Likewise. * emulparams/elf_i386_chaos.sh: Likewise. * emulparams/elf_i386_ldso.sh: Likewise. * emulparams/elf_s390.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/i386moss.sh: Likewise. * emulparams/i386nw.sh: Likewise. * emulparams/m68kelf.sh: Likewise. * scripttempl/elf.sc: Update NOP comment. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/nw.sc: Likewise. 2001-08-15 Tom Rix * ldgram.y (saved_script_handle): Initialize to NULL. * ldmain.c (main): Change check on saved_script_handle. 2001-08-14 Alan Modra * emultempl/elf32.em: Formatting fixes. (output_prev_sec_find): Test for bfd_ind_section too; do so by looking at sec->owner. (output_rel_find): Move function inside LDEMUL_PLACE_ORPHAN test. (gld${EMULATION_NAME}_place_orphan): Add a few comments. Remove unused code, and reorganize orphan section placement code. * ldlang.c (wild_doit): Rename to lang_add_section. * ldlang.h: Here too. * mpw-elfmips.c: And here. * emultempl/beos.em: And here. * emultempl/elf32.em: And here. * emultempl/hppaelf.em: And here. * emultempl/pe.em: And here. 2001-08-13 Richard Henderson * emultempl/needrelax.em: New file. * emulparams/elf64_ia64.sh (EXTRA_EM_FILE): Reference it. * Makefile.am (eelf64_ia64.c): Depend on it. * Makefile.in: Rebuild. 2001-08-13 Alan Modra * emultempl/elf32.em: For SEC_EXCLUDE sections, ensure that output_section is set non-NULL. * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Return `true' for SEC_EXCLUDE sections so that the generic code doesn't needlessly create an output_section_statement. Treat a correctly named output_section_statement with NULL bfd_section as compatible. 2001-08-13 Hans-Peter Nilsson * emultempl/generic.em: Support EXTRA_EM_FILE. (ld_${EMULATION_NAME}_emulation): Support emulation parameters LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL, LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION, LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET, LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH, LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS, LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN, LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE, LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE, LDEMUL_FIND_POTENTIAL_LIBRARIES. 2001-08-12 Richard Henderson * scripttempl/elf.sc, scripttempl/elfd30v.sc, scripttempl/elfm68hc11.sc, scripttempl/elfm68hc12.sc, scripttempl/v850.sc: Keep .jcr data. 2001-08-12 H.J. Lu Andrew Haley Nick Clifton * ldgram.y (had_script): Change name to saved_script_handle. Change type to file handle. * ld.h (had_script): Rename and retype. * ldfile.c (ldfile_open_command_file): Save the file handle used in saved_script_handle. * lexsup.c (parse_args): Do not allow -c option to alter saved_script_handle. * ldmain.c (main): Print out the linker script used if --verbose is given. Check saved_script_handle to obtain the external linker script used, or if NULL, dump the builtin script. * ld.texinfo: Document that --verbose now dumps the linker script used, regardless of whether it was an internal or an external script. 2001-08-10 Andreas Jaeger * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes to build warnings. * configure: Regenerate. 2001-08-09 Alan Modra * emultempl/elf32.em (output_prev_sec_find): Add missing prototype. * scripttempl/elf.sc: Move non-text .dynamic section before .plt/.got/.sdata* group. (OTHER_GOT_SECTIONS): Move to immediately after .got. (OTHER_SDATA_SECTIONS): Add. * emulparams/criself.sh: Use OTHER_SDATA_SECTIONS rather than OTHER_GOT_SECTIONS. * emulparams/crislinux.sh: Likewise. * emulparams/elf32b4300.sh: Likewise. * emulparams/elf32bmip.sh: Likewise. * emulparams/elf32bmipn32.sh: Likewise. * emulparams/elf32bsmip.sh: Likewise. * emulparams/elf32btsmip.sh: Likewise. * emulparams/elf32ebmip.sh: Likewise. * emulparams/elf32elmip.sh: Likewise. * emulparams/elf32l4300.sh: Likewise. * emulparams/elf32lmip.sh: Likewise. * emulparams/elf32lsmip.sh: Likewise. * emulparams/elf32ltsmip.sh: Likewise. * emulparams/elf64bmip.sh: Likewise. * emulparams/elf64btsmip.sh: Likewise. * emulparams/elf64ltsmip.sh: Likewise. 2001-08-08 Alan Modra * genscripts.sh: Source the emulparams script before each output script is generated so that variables like `RELOCATING' may affect variables defined in the emulparams script. 2001-08-04 Alan Modra * emultempl/aix.em: ldexp.h,ldlang.h,ldfile.h,ldemul.h go in this order. * emultempl/beos.em (sort_sections): Modify for 2001-08-03 change, ie. iterate over wild_statement.section_list. (gld${EMULATION_NAME}_place_orphan): Likewise. 2001-08-03 Stephane Carrez * scripttempl/elfm68hc12.sc (FINISH_CODE, FINISH_RELOC): New to handle .fini[0-4] sections used by _exit (CTOR, DTOR): Export ctor/dtor symbols; move them to ROM. (*.text,*.data,*.bss): Take into account .text.*, .data.*, .bss.*. * scripttempl/elfm68hc11.sc: Likewise. 2001-08-03 H.J. Lu * emultempl/beos.em (init): Add the missing initialization. 2001-08-03 Alan Modra * ld.texinfo (Input Section Basics): Clarify ordering of output sections. * ldlang.c (callback_t): Add wildcard_list param. (walk_wild_section): Remove "section" param. Rewrite for lang_wild_statement_type change. Remove unique_section_p test. (walk_wild_file): Remove "section" param. (walk_wild): Remove "section" and "file" params. (lang_gc_wild): Likewise. (wild): Likewise. Modify for lang_wild_statement_type change. (wild_sort): Likewise. Add "sec" param. (gc_section_callback): Likewise. (output_section_callback): Likewise. Do unique_section_p test. (map_input_to_output_sections): Modify call to wild. (lang_gc_sections_1): Likewise. (print_wild_statement): Modify for lang_wild_statement_type change. (lang_add_wild): Replace filename, filenames_sorted param with filespec. Replace section_name, sections_sorted, exclude_filename_list with section_list. * ldlang.h (lang_add_wild): Here too. (lang_wild_statement_type): Replace section_name, sections_sorted, and exclude_filename_list with section_list. * ldgram.y (current_file): Delete. (%union): Add wildcard_list. (file_NAME_list): Set type to wildcard_list. Build a linked list rather than calling lang_add_wild for each entry. (input_section_spec_no_keep): Call lang_add_wild here instead. * ld.h (struct wildcard_list): Declare. * mri.c (mri_draw_tree): Modify to suit new lang_add_wild. 2001-08-02 Charles Wilson * ldmain.c (main): initialize link_info.pei386_auto_import * pe-dll.c: new tables for auto-export filtering (auto_export): change API, pass abfd for contextual filtering. Loop thru tables of excluded symbols instead of comparing "by hand". 2001-08-02 Paul Sokolovsky * pe-dll.c: new variable pe_dll_enable_extra_debug. New static variable current_sec (static struct sec *). Add forward declaration for add_bfd_to_link. (process_def_file): Don't export undefined symbols. Do not export symbols starting with "_imp__". Call auto_export() with new API. (pe_walk_relocs_of_symbol): New function. (generate_reloc): add optional extra debugging (pe_dll_generate_def_file): eliminate extraneous initial blank line in output (make_one): enlarge symtab to make room for __nm__ symbols (DATA auto-import support). (make_singleton_name_thunk): New function. (make_import_fixup_mark): New function. (make_import_fixup_entry): New function. (pe_create_import_fixup): New function. (add_bfd_to_link): Specify that 'name' argument is a CONST char *. * pe-dll.h: declare new variable pe_dll_extra_pe_debug; declare new functions pe_walk_relocs_of_symbol and pe_create_import_fixup. * emultempl/pe.em: add new options --enable-auto-import, --disable-auto-import, and --enable-extra-pe-debug. (make_import_fixup): New function. (pe_find_data_imports): New function. (pr_sym): New function. (gld_${EMULATION_NAME}_after_open): Add optional extra pe debugging. Call pe_find_data_imports. Mark .idata as DATA, not CODE. 2001-08-02 Charles Wilson * ld.texinfo: add additional documentation for --export-all-symbols. Document --out-implib, --enable-auto-image-base, --disable-auto-image-base, --dll-search-prefix, --enable-auto-import, and --disable-auto-import. * ldint.texinfo: Add detailed documentation on auto-import implementation. 2001-07-30 Nick Clifton * ld.texinfo (Simple Assignments): Fix computation in SECTIONS example. 2001-07-24 Alan Modra * Makefile.am: Update dependencies with "make dep-am". * Makefile.in: Regenerate 2001-07-23 Alan Modra * ldcref.c (check_section_sym_xref): New function. (check_nocrossrefs): Call it. (check_nocrossref): Interate over h->refs here instead of.. (check_refs): ..here. Pass in the symbol name, section, and bfd rather than hash_entry pointers. (struct check_refs_info): Keep symbol name rather than hash entry. Remove "same". (check_reloc_refs): Tweak for above changes in check_refs_info. Only report references to section syms when symname is NULL to prevent duplicate messages for the same reloc. 2001-07-19 Nick Clifton * ldexp.c (exp_print_tree): Use stderr if config.map_file is not available. Do not print NULL trees. (exp_print_token): Print unknown tokens with values > 126 as decimal values not ASCII characters. * ldlang.c (lang_leave_overlay): If a region is specified assign it to all sections inside the overlay unless they have been assigned to the own, non-default, memory region. * README: Add header for consistency with other README files. 2001-07-14 H.J. Lu * emultempl/elf32.em (output_prev_sec_find): Never return bfd_abs_section_ptr, bfd_com_section_ptr nor bfd_und_section_ptr. 2001-07-14 Nick Clifton * Makefile.am (em32relf.c): Change dependency from generic.em to elf32.em. * Makefile.in: Regenerate. 2001-07-14 matthew green * configure.tgt (i386-*-netbsdelf*): New target. (i386-*-netbsd*): Set targ_extra_emuls to `elf_i386' 2001-07-13 Jakub Jelinek * emultempl/elf32.em (output_prev_sec_find): New. (place_orphan): Use it. 2001-07-11 H.J. Lu * ldmain.c (main): Fix typos in the last change. 2001-07-11 Jakub Jelinek * ldmain.c (main): Disallow -F and -f without -shared. 2001-07-11 Nick Clifton * emultempl/pe.em (after_open): Check for the output_bfd not having any coff_data structure allocated to it. 2001-07-09 David O'Brien * emultempl/elf32.em: Do not assuming that contents of the buffer returned from basename function will remain unchanged accross other function calls. 2001-07-03 H.J. Lu * scripttempl/elf.sc (DYNAMIC_PAD): Revert the change made on 2001-07-03. It creates dynamic entries even for static binaries. 2001-07-03 Jakub Jelinek * scripttempl/elf.sc (DYNAMIC_PAD): New variable. (DYNAMIC): Use it to reserve few dynamic entries for post-linking tools. 2001-06-27 Alan Modra * emulparams/hppa64linux.sh: New file. * configure.tgt: hppa*64*-*-linux* uses hppa64linux.sh * Makefile.am (ALL_64_EMULATIONS): Add ehppa64linux.o (ehppa64linux.c): Add rule to make it. Run "make dep-am". * Makefile.in: Regenerate. 2001-06-21 Hans-Peter Nilsson * ld.texinfo (Options, -r): Mention restrictions when using different object formats. 2001-06-19 Hans-Peter Nilsson * ldlang.c (lang_check): Emit fatal error if relocatable link between different object flavours with relocations in input. 2001-06-19 H.J. Lu * ld.texinfo (-E, --export-dynamic): Mention --version-script. (--version-script): Mention the language support. 2001-06-19 H.J. Lu * ldlang.c (lang_check): Revert the change mode on 2001-06-15. 2001-06-18 H.J. Lu * Makefile.am (ld.1): Remove the prefix `$(srcdir)/'. (diststuff): Add $(MANS). * Makefile.in: Regenerated. * ld.1: Removed. 2001-06-18 Hans-Peter Nilsson * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Update for API change in bfd_elf${ELFSIZE}_size_dynamic_sections. * mpw-elfmips.c (gldelf32ebmip_before_allocation): Ditto. * ld.h (args_type): Remove member export_dynamic. All users changed to use struct bfd_link_info member. * Makefile.am (ecriself.c, ed10velf.c, ei386moss.c): Depend on $(srcdir)/emultempl/elf32.em, not $(srcdir)/emultempl/generic.em. * Makefile.in: Regenerate. 2001-06-18 H.J. Lu * ldlang.c (init_os): Add the newline to the einfo call. (lang_check): Likewise. (lang_do_version_exports_section): Likewise. 2001-06-15 H.J. Lu * lexsup.c (parse_args); Save optind to report unrecognized option. 2001-06-15 Hans-Peter Nilsson * ldlang.c (lang_check): Emit fatal error if relocatable link between different object flavours. * lexsup.c (parse_args) : Set new link_info member export_dynamic. * ldmain.c (main): Initialize new link_info member export_dynamic. 2001-06-12 Nick Clifton * ldlang.c (walk_wild): Only call walk_wild_file if lookup_name returns something. (lookup_name): If load_symbols fails, return NULL. (load_symbols): Change to a boolean function. (open_input_bfds): If load_symbols fails then do not make the executable. 2001-06-08 Alan Modra * ldlang.c (record_bfd_errors): Remove. * emultempl/aix.em: Fix copyright dates. 2001-06-07 Andreas Jaeger * elf_x86_64.sh (NONPAGED_TEXT_START_ADDR): Increase. (TEXT_START_ADDR): Likewise. 2001-06-06 Martin Schwidefsky * configure.host: Set HOSTING_CRT0/HOSTING_LIBS correctly for s/390. 2001-06-05 Danny Smith * emultempl/pe.em (init): Reduce default stack reserve to 0x200000. 2001-05-31 H.J. Lu * ldlang.c (open_input_bfds): Don't change the bfd error handler whilst loading symbols. 2001-05-28 Nick Clifton * configure.tgt: Remove i370-mvs architecture, it is not currently supported. 2001-05-25 H.J. Lu * emulparams/ppcmacos.sh: Add SYSCALL_MASK and SYMBOL_MODE_MASK like emulparams/aixppc.sh. 2001-05-25 H.J. Lu * emultempl/beos.em (gld${EMULATION_NAME}_before_parse): Move setting of output_filename after bfd_scan_arch. * emultempl/pe.em: Likewise. 2001-05-25 H.J. Lu * emulparams/aixrs6.sh: Add SYSCALL_MASK and SYMBOL_MODE_MASK like emulparams/aixppc.sh. * emultempl/aix.em (sc): Use ${srcdir}/emultempl/ostring.sed instead of ${srcdir}/emultempl/stringify.sed. 2001-05-25 Timothy Wall * emulparams/elf64_aix.sh: Change settings to match IBM linker output. 2001-05-25 Alan Modra * configure.host: Replace linuxoldld with linux*oldld. * configure.tgt: Likewise. 2001-05-24 H.J. Lu * emultempl/stringify.sed: Removed again. 2001-05-24 H.J. Lu * emultempl/aix.em (OUTPUT_ARCH): Defined. (gld${EMULATION_NAME}_before_parse): Initialize ldfile_output_architecture, ldfile_output_machine and ldfile_output_machine_name from ${OUTPUT_ARCH} if possible. * emultempl/beos.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/mipsecoff.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/sunos.em: Likewise. 2001-05-24 Tom Rix * emultempl/aix.em : (gld${EMULATION_NAME}_read_file) udate import file format. (change_symbol_mode) New, same (is_syscall) New, same * emulparams/aixppc.sh : add SYSCALL_MASK and SYMBOL_MODE_MASK * emulparams/aixppc64.sh : same * emulparams/aixrs6.sh : same * emulparams/ppcmacos.sh : same * emultempl/aix.em : use strtoull to parse options * Makefile.am : add eaixppc64 emulation for xcoff64 * Makefile.in : same * configure.tgt : same * scripttempl/aix.sc : default text section offset to 0x10000000 default data section offset to 0x20000000 add .sv3264 and .sv64 pseudo sections loader and debug sections use the currect section offset. * emultempl/aix.em : Add xcoff64 support Add -binitfini support (gld${EMULATION_NAME}_before_parse) -binitfini (gld${EMULATION_NAME}_parse_args) same (gld${EMULATION_NAME}_before_allocation) format change for special sections * emulparams/aixppc64.sh : New file for xcoff64 support 2001-05-23 Alexandre Oliva * emultempl/elf32.em (ELF_INTERPRETER_SET_DEFAULT): Use this new variable to avoid non-portable shell construct. 2001-05-23 Thiemo Seufer * ldmain.c (get_emulation): Add -mips5 command line argument. 2001-05-22 Alexandre Oliva * emulparams/elf_i386_ldso.sh: New, copied from elf_i386.sh. (ELF_INTERPRETER_NAME): Define it. * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Use it. * configure.tgt (targ_emul, targ_extra_emuls) [i[3456]86-*-solaris2*, i[3456]86-*-solaris*]: Use elf_i386_ldso as primary, elf_i386 as extra. * Makefile.am (ALL_EMULATIONS): Added eelf_i386_ldso.o. (eelf_i386_ldso.c): New rule. * Makefile.in: Rebuilt. 2001-05-22 Nick Clifton * lexsup.c (ld_options): Allow -I to be an alias for --dynamic-linker. This is for Solaris compatability. * ld.texinfo: Document that -I can be used. * ld.1: Regenerate. 2001-05-16 Alan Modra * ldlang.c (wild_doit): Use linker_has_input to reliably determine whether an input section is the first one assigned to an output section. Assorted formatting fixes. 2001-05-14 DJ Delorie * Makefile.am (ld.dvi): Search bfd/doc for texinfo files. * Makefile.in: Ditto. 2001-05-11 Jakub Jelinek * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Put .gnu.linkonce.ia64unw{,i} sections into corresponding .IA_64.unwind* output sections. * emulparams/elf64_aix.sh (OTHER_READONLY_SECTIONS): Likewise. 2001-05-11 Jakub Jelinek * ldlang.c (lang_process): Call bfd_merge_sections. 2001-05-07 Thiemo Seufer * ldgram.y: Fix typo. 2001-05-03 H.J. Lu * emultempl/elf32.em: Include "libiberty.h". (gld${EMULATION_NAME}_vercheck): Call basename () to get the basename of the bfd filename. (gld${EMULATION_NAME}_stat_needed): Likewise. (gld${EMULATION_NAME}_try_needed): Likewise. (gld${EMULATION_NAME}_open_dynamic_archive): Likewise. 2001-05-02 H.J. Lu * emultempl/pe.em: Include . 2001-05-02 Johan Rydberg * emulparams/elf32openrisc.sh: New file. * Makefile.am: Add OpenRISC target. * Makefile.in: Regenerated. * configure.tgt: Add openrisc-*-* mapping. 2001-05-02 Nick Clifton * emultempl/aix.em: Replace buystring with xstrdup. * emultempl/beos.em: Replace buystring with xstrdup. 2001-05-02 H.J. Lu * ldfile.c: Include "libiberty.h". * ldlex.l: Likewise. * ldmisc.c (buystring): Removed. * ldmisc.h: Likewise. * ldfile.c: Replace buystring with xstrdup. * ldlang.c: Likewise. * ldlex.l: Likewise. * ldmain.c: Likewise. * ldmisc.c: Likewise. * lexsup.c: Likewise. * mpw-eppcmac.c: Likewise. 2001-04-30 Andreas Jaeger * emulparms/elf_x86_64.sh (MAXPAGESIZE): Fix value. 2001-04-28 Paul Sokolovsky * ldlang.c (load_symbols): Give emulation a chance to process unrecognized file before fatal error is reported, not after. 2001-04-27 Sean McNeil * configure.tgt: Add arm-vxworks target. * scripttempl/armcoff.sc: Support .text or .data as a section name prefix. Define _etext. 2001-04-13 J.T. Conklin * ld.texinfo: Document --fatal-warnings. * ld.1: Regenerate. * ldmisc.c (vfinfo): Set flag to inhibit making executable if warnings have been turned into errors. * lexsup.c (OPTION_WARN_FATAL): Define. (ld_options): Entry for --fatal-warnings. (parse_args): Handle OPTION_WARN_FATAL. * ld.h (ld_config_type): Add fatal_warnings field. 2001-04-13 Jakub Jelinek * ldmain.c (main): Default to discard_sec_merge. * lexsup.c (OPTION_DISCARD_NONE): Define. (ld_options): Add --discard-none. (parse_args): Handle OPTION_DISCARD_NONE. * ldlang.c (wild_doit): SEC_MERGE should be set in the output section only if SEC_MERGE and SEC_STRINGS flags and entsize of all its input sections match. 2001-04-05 Steven J. Hill * Makefile.am (ALL_EMULATIONS): Add eelf32ltsmip.o. (ALL_64_EMULATIONS): Add eelf64btsmip.o and eelf64ltsmip.o. (eelf32ltsmip.c): New target. (eelf64btsmip.c): Likewise. (eelf64ltsmip.c): Likewise. * Makefile.in: Regenerated. * configure.tgt (mips*el-*-linux-gnu): Uses traditional MIPS target. (mips*-*-linux-gnu*): Likewise. * emulparams/elf32ltsmip.sh: New. Traditional little endian MIPS taget. * emulparams/elf64btsmip.sh: New. Traditional 64bit big endian target. * emulparams/elf64ltsmip.sh: New. Traditional 64bit little endian target. 2001-04-05 Hans-Peter Nilsson * emulparams/criself.sh (EXECUTABLE_SYMBOLS): Cannot provide correct value of __Stext here. (TEXT_START_SYMBOLS): Define; always define __Stext, to start of .startup section. * emulparams/crislinux.sh: Remove FIXME. 2001-04-02 Alan Modra * emulparams/hppalinux.sh (MAXPAGESIZE): Set to 64k. (TEXT_START_ADDR, TARGET_PAGE_SIZE): Likewise. 2001-03-27 Hans-Peter Nilsson * configure.tgt (cris-*-*): Change default emulation to criself. (cris-*-*aout*): New rule. 2001-03-27 Matthew Wilcox * emulparams/hppalinux.sh (MAXPAGESIZE): Set to 0x4000. (TEXT_START_ADDR, TARGET_PAGE_SIZE): Ditto. 2001-03-26 Andreas Jaeger * ld.texinfo (Overview): Fix syntax in texi code. 2001-03-25 Stephane Carrez * ld.texinfo: Put @c man indications to generate the ld man page. When generating man, define all the variables. Define SEEALSO and SYNOPSIS. Re-organize some lines to avoid the cross references. * Makefile.am (MANCONF, TEXI2POD, POD2MAN): New variables. (ld.1): Generate from ld.texinfo. * Makefile.in: Regenerate. 2001-03-23 Mark Elbrecht * scripttempl/i386go32.sc: Support the GCC flags '-ffunction-sections' and '-fdata-sections'. Set the VMA of STABS sections to zero. 2001-03-17 Ulrich Drepper * emultmpl/elf32.em (gld${EMULATION_NAME}_search_needed): If NAME is an absolute path look only for this file and not along the path. 2001-03-17 Ulrich Drepper * emultempl/elf32.em (OPTION_GROUP): New macro. Add new option Bgroup to longopts. (gld*_parse_args): Handle GROUP_OPTION and recognize -z defs. (gld*_list_options): Add -Bgroup and -z defs. * ld.1: Document -Bgroup and -z defs. * ld.texinfo: Likewise. 2001-03-07 Michael Meissner * scripttempl/elfd10v.sc (.rodata,.rodata1,.data1,.sdata): Deal with sections created by -fdata-sections. (.dynbss,.bss): Ditto. 2001-03-05 Alan Modra * emultempl/m68kelf.em (m68k_elf_after_allocation): Call after_allocation_default, not gld..._before_allocation. 2001-02-27 Alan Modra * configure.in (BFD_VERSION): New. (AM_INIT_AUTOMAKE): Use $BFD_VERSION. * configure: Regenerate. * Makefile.am: Run "make dep-am" * Makefile.in: Regenerate. 2001-02-26 Timothy Wall * emulparams/elf64_aix.sh: Add additional read-only sections; uncomment lines which are now required. 2001-02-26 H.J. Lu * ldlang.c (open_input_bfds): Set the bfd error handler so that problems can be caught whilst loading symbols. (record_bfd_errors): New function: Report BFD errors and mark the executable output as being invalid. 2001-02-22 Timothy Wall * configure.host: Add configuration for ia64-*-aix*. * Makefile.am (ALL_64_EMULATIONS): Add emulation for ia64-*-aix*. Add dependencies for eelf64_aix.c. * Makefile.in: Regenerate. * configure.tgt: Add ia64-*-aix* mapping. * emulparams/elf64_aix.sh: Add settings for elf64 on aix5. * testsuite/ld-bootstrap/bootstrap.exp: Exclude ia64 flavor from AIX-specific test. 2001-02-20 H.J. Lu * ldfile.c (ldfile_open_file): Set entry->search_dirs_flag to false if we found the file. 2001-02-18 David O'Brien * configure.tgt: Add FreeBSD/Alpha, FreeBSD/x86-64, FreeBSD/ia64, FreeBSD/PowerPC, FreeBSD/arm, and FreeBSD/sparc64 entries. 2001-02-18 lars brinkhoff * Makefile.am: Add PDP-11 target. * configure.tgt: Likewise. * emulparams/pdp11.sh: New file. 2001-02-17 David O'Brien * configure.host: Add a generic FreeBSD configuration entry such that all [modern] FreeBSD systems on all platforms will look the same. 2001-02-14 H.J. Lu * configure.tgt: Remove mention of earmelf_linux26. 2001-02-13 Richard Henderson * emulparams/elf64_ia64.sh (OTHER_GOT_SYMBOLS): Remove. 2001-02-13 H.J. Lu * ldexp.h (node_type): Add etree_provided. * ldexp.c (exp_fold_tree): Handle etree_provided. Set the node type to etree_provided if defined by PROVIDE. Allow updating for etree_provided. (exp_print_tree): Handle etree_provided. * mpw-elfmips.c (gldelf32ebmip_find_exp_assignment): Handle etree_provided. 2001-02-09 David Mosberger * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Add .IA_64.unwind.* pattern to unwind table section and .IA_64.unwind_info* pattern to unwind info section. 2001-02-09 Martin Schwidefsky * Makefile.am: Add linux target for S/390. * Makefile.in: Likewise. * configure.host: Likewise. * configure.tgt: Likewise. * emulparams/elf64_s390.sh: New file. * emulparams/elf_s390.sh: New file. 2001-02-09 Jakub Jelinek * configure.tgt (sparc64-*-linux-gnu*): Add elf32_sparc into targ_extra_libpath. (sparc-*-linux-gnu*): Add elf64_sparc into targ_extra_libpath. 2001-02-06 Philip Blundell * Makefile.am: Remove mention of earmelf_linux26. * Makefile.in: Regenerate. 2001-02-04 Philip Blundell * emulparams/armelf_linux.sh (TEXT_START_ADDR): Set to 0x8000. * emulparams/armelf_linux26.sh: Delete. * configure.tgt: Remove mention of armelf_linux26 emulation. 2001-02-01 Nick Clifton * ld.1: Replace occurances of -oformat with --oformat. 2001-01-25 Jim Driftmyer * ldlang.c (lang_leave_overlay): Don't set lma_region when load_base is specified. 2001-01-24 Hans-Peter Nilsson * emultempl/elf32.em: Correct spelling in comments and listed options. 2001-01-23 Alan Modra * ldlang.c (lang_leave_overlay): Only set lma_region from the default for the first section of a group of overlay sections. 2001-01-22 Alan Modra * Makefile.am (GENSCRIPTS): Pass exec_prefix. * Makefile.in: Regenerate. * genscripts.sh: Use exec_prefix parameter to specify tool lib. Check for null tool_dir. 2001-01-16 Jim Wilson * emulparams/elf64_ia64.sh (OTHER_READONLY_SECTIONS): Add IA_64.unwind and IA_64.unwind.info. 2001-01-16 H.J. Lu * ldlang.c (lang_check): Merge the private data only if the input file has contents. 2001-01-14 Alan Modra * emulparams/hppalinux.sh (OUTPUT_FORMAT): Set to elf32-hppa-linux. * emultempl/hppaelf.em (hppaelf_after_parse): New function, enabling search for libmilli. On a relocatable link, make .text sections unique. (LDEMUL_AFTER_PARSE): Define. (hppaelf_finish): Correct spelling of relocatable in comments. * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't rummage through the script for sections on the unique list. Correct length of strncmp for ".note". (gld${EMULATION_NAME}_check_needed): Rearrange function. * ldlang.c (unique_section_list): New var. (unique_section_p): New function. (walk_wild_section): Don't match sections on unique_section_list. (lang_add_unique): New function. Correct spelling of relocatable in comments. * ldlang.h (struct unique_sections): Declare. (unique_section_list): Declare. (unique_section_p): Declare. (lang_add_unique): Declare. * lexsup.c (ld_options): Allow --unique to take an optional arg. (parse_args [OPTION_UNIQUE]): Call lang_add_unique. * ld.texinfo (--unique): Update. 2001-01-13 Nick Clifton * lexsup.c (parse_args): Remove spurious white space. 2001-01-12 Nick Clifton * lexsup.c (parse_args): Update copyright date. 2001-01-12 Philip Blundell * configure.host: Set HOSTING_LIBS appropriately for ix86-cygwin. 2001-01-10 Kazu Hirata * scripttempl/h8300.sc: Fix formatting. Fix a comment typo. * scripttempl/h8300h.sc: Fix formatting. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. 2000-01-07 David O'Brien * emultempl/elf32.em: Only perform Linux ld hints processing when targeting Linux. 2001-01-07 Philip Blundell * ld.texinfo (Bug Reporting): Update email address for reports. 2000-12-31 Nick Clifton * lexsup.c (parse_args): Set opterr to 0 and detect unparsed long options by checking for a return value of '?' not -1. 2000-12-28 Nick Clifton * lexsup.c (struct ld_option): Add new enum value: EXACTLY_TWO_DASHES. (ld_options[]): Change -omagic, -output and -oformat options to be EXACTLY_TWO_DASHES. (OUTPUT_COUNT): Use ARRAY_SIZE. (parse_args): Change parameter 'argc' to unsigned. Place EXACTLY_TWO_DASHES options into new really_longopts array. If getopt_long_only fails, try calling getopt_long using the really_longopts array. (help): Print a double dash for both EXACTLY_TWO_DASHES and TWO_DASHES options. * ldlex.h: Fix prototype of parse_args. * ld.texinfo: Document that long options starting with 'o' must be preceeded by two dashes. Change example of a single dashed long option from -oformat to -trace-symbol. 2000-12-26 Danny Smith * emultempl/pe.em (OPTION_NO_DEFAULT_EXCLUDES): Define. (longopts[]): New --no-default-excludes option. (gld_${EMULATION_NAME}_list_options): Document. (gld_${EMULATION_NAME}_parse_args): Handle. 2000-12-13 Michael Sokolov * ldlang.c (new_stat): Revert the last beautification with "innocent" whitespace, it breaks the K&R C preprocessor. 2000-12-11 DJ Delorie * ld.texinfo: Add notes about --whole-archive and gcc. 2000-11-18 Fred Fish * lexsup.c (OPTION_ALLOW_SHLIB_UNDEFINED): Define. (ld_options): Entry for --allow-shlib-undefined. (parse_args): Handle OPTION_ALLOW_SHLIB_UNDEFINED. * ldmain.c (main): Initialize link_info.allow_shlib_undefined to false. * ld.texinfo: Document new command line switch. 2000-12-12 Geoffrey Keating * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): .fixup is actually read/write. * emulparams/elf32lppc.sh (OTHER_READWRITE_SECTIONS): Likewise. * emulparams/elf32ppcsim.sh (OTHER_READWRITE_SECTIONS): Likewise. * emulparams/elf32lppcsim.sh (OTHER_READWRITE_SECTIONS): Likewise. 2000-12-11 Jan Hubicka * NEWS: Add note about x86_64 architecture. 2000-12-06 Mark Elbrecht * scripttempl/i386go32.sc: Use PROVIDE with _etext, _edata, _end. Set DWARF2 sections to a VMA of zero. 2000-12-01 Joel Sherrill * configure.tgt (arm-*-rtems*, a29k-*rtems*, h8300-*-rtems*): New targets. (sparc*-*-rtemself*, sparc*-*-rtemsaout*): New targets. (sparc*-*-rtems*): Switched from a.out to ELF. 2000-11-30 Jan Hubicka * Makefile.am (ALL_EMULATIONS): Add eelf_x86_64.o (eelf_x86_64.c): New. * Makefile.in: Regenerate. * configure.tgt: Add support for x86_64-*-linux-gnu*. * emulparams/elf_x86_64.sh: New. 2000-11-30 Hans-Peter Nilsson * emulparams/crislinux.sh (ENTRY): Change back to _start. (TEXT_START_SYMBOLS): Remove conditional setting of __start. * scripttempl/crisaout.sc: Change all RELOCATING not related to merging non-a.out sections into CONSTRUCTING. 2000-11-28 Nick Clifton * ld.1 (COPYING): Mention that the GNU Free Documentation License is present in the sources, but not the output, and also available from the GNU website. (GNU Free Documentation License): Comment out this section. 2000-11-28 David O'Brien * emulparams/elf64alpha.sh (ENTRY): Remove leading underscore as ELF does not use them. 2000-11-25 David O'Brien * ld.1: Remove old date so it does not give the impression the manpage is way out of date. 2000-11-24 Nick Clifton * configure.tgt (xscale-coff): Add target. (xscale-elf): Add target. 2000-11-24 Fred Fish * ldmain.c (main): Remove redundant init of config.make_executable to true. 2000-11-15 Richard Henderson * emulparams/elf64alpha.sh (MAXPAGESIZE): Typo -- 64k, not 1M. 2000-11-14 Kazu Hirata * scripttempl/h8300.sc: Fix formatting. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300s.sc: Likewise. 2000-11-14 Denis Chertykov * scripttempl/elf32avr.sc: Fix bug in .eeprom segment. 2000-11-09 Philip Blundell * emultempl/pe.em: Define ___start_SECNAME and ___stop_SECNAME around orphan sections whose names can be represented in C. 2000-11-07 Jim Wilson * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): New local hold_sdata. If SEC_SMALL_DATA set, set place to hold_sdata. 2000-11-06 Nick Clifton * ld.texinfo: Add GNU Free Documentation License. * ldint.texinfo: Add GNU Free Documentation License. * ld.1: Add GNU Free Documentation License. 2000-11-05 Alan Modra * ldlex.l (yy_create_string_buffer): Init yy_is_our_buffer, yy_is_interactive, yy_at_bol, and yy_fill_buffer. * Makefile.am (DISTCLEANFILES): Add stringify.sed. Move 2000-11-02 Makefile.in changes to this file. * Makefile.in: Regenerate. 2000-11-03 Nick Clifton * scripttempl/h8300.sc: Use ${CONSTRUCTING...} to enclose constructors and destructors. * scripttempl/h8300h.sc: Ditto. * scripttempl/h8300s.sc: Ditto. * scripttempl/h8500.sc: Ditto. * scripttempl/h8500b.sc: Ditto. * scripttempl/h8500c.sc: Ditto. * scripttempl/h8500m.sc: Ditto. * scripttempl/h8500s.sc: Ditto. * scripttempl/v850.sc: Ditto. * scripttempl/w65.sc: Ditto. * scripttempl/z8000.sc: Ditto. 2000-11-02 Per Lundberg * Makefile.in (e_i386_chaos.c): New rule. (ALL_EMULATIONS): Added e_i386_chaos.o. * emulparams/elf_i386_chaos.sh: New file. * configure.tgt: Recognise i[3456]86-chaosdev-storm-chaos. 2000-10-20 Jakub Jelinek * emulparams/elf64_sparc.sh (TEXT_START_ADDR, NONPAGED_TEXT_START_ADDR): Set to 4GB for Solaris targets. Fix sed invocation, so that it coped with '/' in Solaris 64bit library path suffix. Based on patch by Andrew Macleod . 2000-10-18 Hans-Peter Nilsson * scripttempl/crisaout.sc (.text, .data): Pad, with ALIGN (32), for consecutive sections. 2000-10-17 Chandrakala Chavva * lexsup.c: New option OPTION_TARGET_HELP. Prints all target specific options. * ld.texinfo: Added notes about this new option. 2000-10-16 Nick Clifton * emultempl/pe.em (_after_open): Add tests of return values from bfd functions. Emit appropriate error messages if necessary. 2000-10-13 Nick Clifton * emultempl/pe.em (_after_open): Delete 'is2' and 'nsyms' local variables - they are not used, but leave in the call to bfd_canonicalize_symtab. (_open_dynamic_archive): Add #ifdef DLL_SUPPORT around use of pe_dll_search_prefix. 2000-10-12 Charles Wilson * emultempl/pe.em (pe_dll_search_prefix): New variable, (longopts): New --dll-search-prefix option. (gld_${EMULATION_NAME}_list_options): Document. (gld_${EMULATION_NAME}_parse_args): Handle. (gld_${EMULATION_NAME}_open_dynamic_archive): When linking dynamically, search for a dll named '.dll' in preference to 'lib.dll' if --dll-search-prefix is specified. 2000-10-12 Alan Modra * ldlang.c (section_already_linked): Set kept_section instead of sec->comdat->sec. 2000-10-10 Kazu Hirata * deffile.h: Fix formatting. * lexsup.c: Likewise. * mri.c: Likewise. 2000-10-09 Paul Sokolovsky * pe-dll.c (make_one): Do not generate code thunk for DATA exports. (process_def_file): deduce DATA flag for auto-export sumbols. 2000-10-09 Kazu Hirata * ld.h: Fix formatting. * ldcref.c: Likewise. * ldctor.h: Likewise. * ldemul.c: Likewise. * ldemul.h: Likewise. * ldexp.c: Likewise. * ldexp.h: Likewise. * ldfile.c: Likewise. * ldfile.h: Likewise. * ldlang.c: Likewise. * ldlang.h: Likewise. * ldmain.c: Likewise. * pe-dll.c: Likewise. * pe-dll.c: Revert some formatting fixes. 2000-10-08 Kazu Hirata * pe-dll.c: Fix formatting. 2000-10-05 Kazu Hirata * ldlang.c: Fix formatting. 2000-10-03 DJ Delorie * pe-dll.c (fill_edata): initialize entire block (make_one): fill in correct section. 2000-10-03 Kazu Hirata * ldexp.c: Fix formatting. 2000-10-02 DJ Delorie * emultempl/pe.em (gld_*_after_open): detect case where there two import libraries for same dll; rename one to ensure proper link order. * pe-dll.c (process_def_file): compare ordinals to -1, not 0; fix typo (generate_edata): fix typo 2000-09-29 Hans-Peter Nilsson * scripttempl/crisaout.sc (ENTRY): Now __start. (.text): Add default setting for __start. Remove CONSTRUCTORS handling. (/DISCARD/): Add .gnu.warning.*. * emulparams/crislinux.sh (ENTRY): Now __start. (TEXT_START_SYMBOLS): New; provide __Stext and __start default. * emulparams/criself.sh (OUTPUT_FORMAT): Now elf32-us-cris. (ENTRY): Now __start. (INITIAL_READONLY_SECTIONS): Add KEEP for .startup. (EXECUTABLE_SYMBOLS): Add default setting for __start. 2000-09-29 Kazu Hirata * deffile.h: Fix formatting. * ld.h: Likewise. * ldcref.c: Likewise. * ldctor.c: Likewise. * ldctor.h: Likewise. * ldemul.c: Likewise. * ldemul.h: Likewise. * ldexp.c: Likewise. * ldexp.h: Likewise. * ldfile.c: Likewise. * ldfile.h: Likewise. * ldlang.c: Likewise. * ldlang.h: Likewise. * lexsup.c: Likewise. * mri.c: Likewise. * pe-dll.c: Likewise. 2000-09-28 Paul Sokolovsky * pe-dll.c (process_def_file): Uninitialized data wasn't exported with --export-all-symbols switch. 2000-09-28 DJ Delorie * pe-dll.c (fill_edata): rearrange the data so that ordinals and noname work properly. 2000-09-28 Alan Modra * ld.texinfo (HPPA ELF32): New section. * emultempl/hppaelf.em (group_size): New. (hppaelf_finish): Pass group_size to elf32_hppa_size_stubs. (PARSE_AND_LIST_PROLOGUE): Add OPTION_STUBGROUP_SIZE. (PARSE_AND_LIST_LONGOPTS): Add --stub-group-size. Duplicate options to prevent abbreviations matching. (PARSE_AND_LIST_OPTIONS): Describe the above. Reformat. (PARSE_AND_LIST_ARGS_CASES): Handle it. 2000-09-21 Michael Sokolov * emultempl/m68kelf.em: Conditionalise the embedded relocs feature on the m68*-*-elf target. Make it support COFF input objects. 2000-09-21 Kazu Hirata * ldmain.c: Fix formatting. * ldmisc.c: Likewise. * ldver.c: Likewise. * ldwrite.c: Likewise. 2000-09-21 Alan Modra * ldwrite.c (clone_section): Silence gcc warnings. 2000-09-20 Alan Modra * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Handle out of memory failure. * ldwrite.c (ldwrite): Remove unnecessary einfo arg. (clone_section): Handle out of memory failures. Rename var to avoid c++ reserved word. 2000-09-18 Alan Modra * emultempl/hppaelf.em (hppaelf_add_stub_section): Rename stub_name param to stub_sec_name. (hppaelf_finish): Modify call to elf32_hppa_size_stubs. 2000-09-10 Michael Sokolov * emultempl/m68kelf.em: New file. * emulparams/m68kelf.sh (EXTRA_EM_FILE): Use it. * Makefile.am (em68kelf.c): Add dependency on m68kelf.em. * Makefile.in: Regenerate. 2000-09-15 Alan Modra * emulparams/hppalinux.sh (DATA_START_SYMBOLS): Provide $global$ only as needed. 2000-09-13 Nick Clifton * ldmain.c (multiple_definition): Disable relaxation if multiple symbol definitions are encountered - otherwise the linker could abort with an assertion failure. 2000-09-10 Nick Clifton * mri.c: Fix formatting. 2000-09-07 H.J. Lu * configure.in (AC_ISC_POSIX): Put after AC_CANONICAL_SYSTEM. * configure: Rebuild. 2000-09-07 H.J. Lu * Makefile.am (lexsup.o): Also depend on $(INCDIR)/demangle.h. * Makefile.in: Rebuild. 2000-09-07 Alan Modra * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Fix broken list handling. Create __start_SECNAME and __stop_SECNAME when no place-holder. Add some comments. Test both SEC_CODE and SEC_READONLY for hold_text to prevent .rodata orphan poisoning. Handle case where no output section statement created. 2000-09-07 Niibe Yutaka , Kaz Kojima , Alexandre Oliva * configure.tgt (sh-*-linux*): Added. * Makefile.am: Added eshelf_linux and eshlelf_linux. * Makefile.in: Rebuilt. * emulparams/shelf_linux.sh: New file. * emulparams/shlelf_linux.sh: New file. 2000-09-06 Alan Modra * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't try shuffling sections when the orphan happens to be the place holder. Keep count of unique section names generated so we speed the search for a new name. 2000-09-06 Alexandre Oliva * configure: Rebuilt with new libtool.m4. 2000-09-05 Nick Clifton * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * config.in: Regenerate. * po/ld.pot: Regenerate. * ldint.texinfo: Remove CVS revision marker - it foils local comparisons. * emultempl/ticoff.em: Remove extraneous comma. 2000-09-05 Alan Modra * emultempl/hppaelf.em (hppaelf_add_stub_section): Add SEC_RELOC to stub section flags. (hppa_for_each_input_file_wrapper): New. (hppa_lang_for_each_input_file): New. (lang_for_each_input_file): Define to call above. (multi_subspace): New. (hppaelf_finish): Pass multi_subspace to elf32_hppa_size_stubs. (PARSE_AND_LIST_PROLOGUE): Define. (PARSE_AND_LIST_LONGOPTS): Define. (PARSE_AND_LIST_OPTIONS): Define. (PARSE_AND_LIST_ARGS_CASES): Define. (hppaelf_finish): Call elf32_hppa_set_gp. (hppaelf_set_output_arch): Remove. (LDEMUL_SET_OUTPUT_ARCH): Remove. * emulparams/hppalinux.sh (ELFSIZE): Define. (MACHINE): Define. (OTHER_READONLY_SECTIONS): Define. (DATA_PLT): Define. (GENERATE_SHLIB_SCRIPT): Define. * ldlang.c: Add missing prototypes, and tidy others. Change CONST to const throughout. Change `void *' to `PTR' throughout. (lang_memory_default): Function is local to file, add `static'. * Makefile.am (ehppaelf.c): Depend on emultempl/elf32.em. (ehppalinux.c): Likewise. (earmelf.c): Likewise. (earmelf_linux.c): Likewise. (earmelf_linux26.c): Likewise. * Makefile.in: Regenerate. * ld.h (ld_config_type): Add unique_orphan_sections. * lexsup.c (OPTION_UNIQUE): Define. (ld_options): Add "--unique". (parse_args): Handle it. * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't search for an existing output section if unique_orphan_sections is set. Make use of bfd_get_unique_section_name rather than duplicating code here. * ld.texinfo: Describe --unique. * lexsup.c (ld_options): Make split-by-reloc arg optional. Add optional arg to split-by-file. (parse_args): Handle them. * ld.texinfo: Update description of these options. * ldwrite.c (clone_section): Pass in the section name. Replace local code with bfd_get_unique_section_name. (split_sections): Tidy code and comments. Use a list traversal more appropriate to the list construction. Handle cooked section sizes. Split when split_by_reloc reached rather than exceeded. Track section size and split when split_by_file reached. Fix link_order_tail (even though it's not used). (ldwrite): Modify condition for calling split_sections to suit changed split_by_reloc and split_by_file. * ldmain.c (main): Init config.split_by_reloc and config.split_by_file to -1. * ld.h (ld_config_type): Change split_by_reloc to unsigned. Change split_by_file to bfd_size_type. 2000-09-02 Nick Clifton * configure.in: Increase version number to 2.10.91. * NEWS: Mention new ability to support removal of duplicate DWARF2 debug information. * configure: Regenerate. * aclocal.m4: Regenerate. * config.in: Regenerate. 2000-09-02 Daniel Berlin * scripttempl/elf.sc: Add .gnu.linkonce.wi.* to .debug_info sections. * scripttempl/elf32avr.sc: Ditto. * scripttempl/elfd10v.sc: Ditto. * scripttempl/elfd30v.sc: Ditto. * scripttempl/elfi370.sc: Ditto. * scripttempl/elfm68hc11.sc: Ditto. * scripttempl/elfm68hc12.sc: Ditto. * scripttempl/elfi386beos.sc: Ditto. * scripttempl/v850.sc: Ditto. 2000-08-31 Alexandre Oliva * acinclude.m4: Include libtool and gettext macros from the top level. * aclocal.m4, configure: Rebuilt. 2000-08-25 Nick Clifton * ldlang.c (open_output): When choosing the target for a particular endianness, do nothing if the target is not supported. 2000-08-25 H.J. Lu * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Don't check -rpath nor LD_RUN_PATH for cross link. * ld.texinfo: Document the change. 2000-08-24 Hans-Peter Nilsson * NEWS: Mention support for CRIS. 2000-08-23 H.J. Lu * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Get the current runpath list from bfd_elf_get_runpath_list () before search. 2000-08-22 H.J. Lu * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Search the DT_RPATH/DT_RUNPATH entries for DT_NEEDED after LD_LIBRARY_PATH for native linker. Display the needed DSO if trace_file_tries is non-zero. (gld${EMULATION_NAME}_try_needed): Report the needed DSO found if trace_file_tries is non-zero. * ld.texinfo: Document the usage of DT_RPATH/DT_RUNPATH. * NEWS: Mention it. 2000-08-14 Jason Eckhardt * NEWS: Mention i860 support. 2000-08-14 Andreas Schwab * scripttempl/elf.sc: Fix last change to use correct comment syntax. 2000-08-10 Geoff Keating * scripttempl/elf.sc: Add a comment giving the correspondence between sections, per-datum sections, and linkonce sections. Make the comment true even for .bss, .sdata, .sdata2, .sbss, and .sbss2. 2000-08-10 Jason Eckhardt * emulparams/elf32_i860.sh: New file. * configure.tgt: Recognize new target i860-stardent-{sysv4*|elf*}. * Makefile.am (ALL_EMULATIONS): Add eelf32_i860.o. (eelf32_i860.c): New rule. * Makefile.in: Regenerate. 2000-08-10 Nick Clifton * emulparams/mipspe.sh (ENTRY): Add definition. 2000-08-08 Peter Jeremy * emultempl/elf32.em (_after_close): Refer to -rpath not --rpath in error message. 2000-08-08 Stephane Carrez * scripttempl/elfm68hc11.sc: Define __bss_size symbol to indicate the final size of .bss section. * scripttempl/elfm68hc12.sc: Likewise. 2000-08-04 Alan Modra * emultempl/elf32.em (gld_${EMULATION_NAME}_parse_args): Rename to gld${EMULATION_NAME}_parse_args for consistency. Combine lastoptind and prevoptind vars, and keep track of last optind. (gld_${EMULATION_NAME}_list_options): Rename to gld${EMULATION_NAME}_list_options. 2000-08-03 Rodney Brown * configure.tgt: Select targ_emul=elf_i386 for Unixware 7 (i586-sco-sysv5uw7.1.0). 2000-07-27 H.J. Lu * emulparams/elf64alpha.sh (PARSE_AND_LIST_ARGS): Removed. (PARSE_AND_LIST_PROLOGUE): New. (PARSE_AND_LIST_LONGOPTS): Likewise. (PARSE_AND_LIST_OPTIONS): Likewise. (PARSE_AND_LIST_ARGS_CASES): Likewise. (PARSE_AND_LIST_EPILOGUE): Likewise. 2000-07-28 Alan Modra * emultempl/armelf.em: Elide functions common to elf32.em, ie. most of the file. (arm_elf_after_open): New. Do arm specific things then call gld${EMULATION_NAME}_after_open. (arm_elf_before_allocation): New. Call gld${EMULATION_NAME}_before_allocation then do arm specifics. (PARSE_AND_LIST_PROLOGUE): Define. (PARSE_AND_LIST_SHORTOPTS): Define. (PARSE_AND_LIST_LONGOPTS): Define. (PARSE_AND_LIST_OPTIONS): Define. (PARSE_AND_LIST_ARGS_CASES): Define. (LDEMUL_AFTER_OPEN): Define. (LDEMUL_BEFORE_ALLOCATION): Define. (LDEMUL_BEFORE_PARSE): Define. (LDEMUL_FINISH): Define. * emultempl/hppaelf.em: Similarly zap most of this file. (hppaelf_add_stub_section): Prototype. (hppaelf_layaout_sections_again): Prototype. (hook_in_stub): Prototype. (LDEMUL_SET_OUTPUT_ARCH): Define. (LDEMUL_FINISH): Define. (LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Define. * emulparams/armelf.sh (TEMPLATE_NAME): Use elf32. (EXTRA_EM_FILE): New. * emulparams/armelf_linux.sh: Likewise. * emulparams/armelf_linux26.sh: Likewise. * emulparams/hppalinux.sh: Likewise. * emulparams/hppaelf.sh: Likewise. (NOP): Define. * emultempl/elf32.em: Fix formatting. (EXTRA_EM_FILE): Source it. (LDEMUL_BEFORE_PARSE, LDEMUL_SYSLIB, LDEMUL_HLL, LDEMUL_AFTER_PARSE, LDEMUL_AFTER_OPEN, LDEMUL_AFTER_ALLOCATION, LDEMUL_SET_OUTPUT_ARCH, LDEMUL_CHOOSE_TARGET, LDEMUL_BEFORE_ALLOCATION, LDEMUL_GET_SCRIPT, LDEMUL_FINISH, LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS, LDEMUL_OPEN_DYNAMIC_ARCHIVE, LDEMUL_PLACE_ORPHAN, LDEMUL_SET_SYMBOLS, LDEMUL_PARSE_ARGS, LDEMUL_UNRECOGNIZED_FILE, LDEMUL_LIST_OPTIONS, LDEMUL_RECOGNIZED_FILE, LDEMUL_FIND_POTENTIAL_LIBRARIES): New shell vars. Add code to allow functions in this file to be overridden. (PARSE_AND_LIST_SHORTOPTS): Handle it. * emultempl/m68kcoff.em: Include ldfile.h before ldemul.h. * emultempl/elf32.em: Reorganize file. 2000-07-27 Ivan Kokshaysky * emulparams/elf64alpha.sh: Implement "-taso" emulation specific option to fit 64-bit executable in the lower 31-bit address range. This is done by changing start address of .interp (the very first section of executable) and then setting EF_ALPHA_32BIT elf header flag. 2000-07-21 Michael Sokolov * emultempl/m68kcoff.em: New file. * emulparams/m68kcoff.sh (TEMPLATE_NAME): Use m68kcoff template. * Makefile.am (em68kcoff.c): Depend on m68kcoff.em rather than generic.em. * Makefile.in: Regenerate. 2000-07-20 H.J. Lu * emultempl/elf32.em (longopts): Duplicate "disable-new-dtags" and "disable-new-dtags" to stop getopt from treating -d/-e as abbreviations for these options. 2000-07-20 H.J. Lu * ld.texinfo: Add documentation for --disable-new-dtags and --enable-new-dtags. * ldmain.c (main): Initialize link_info.new_dtags to false. * emultempl/elf32.em (gld_${EMULATION_NAME}_parse_args): Add --disable-new-dtags and --enable-new-dtags. (gld_${EMULATION_NAME}_list_options): Likewise. 2000-07-05 Kenneth Block * lexsup.c: Add optional style to demangle switch * ld.texinfo: Document optional style to demangle switch. 2000-07-20 Hans-Peter Nilsson * Makefile.am (ALL_EMULATIONS): Add ecrisaout.o, ecriself.o, ecrislinux.o. (ecrisaout.c, ecriself.c, ecrislinux.c): New rules. Regenerate dependencies. * Makefile.in: Rebuild. * configure.tgt (cris-*-*): New target. * emulparams/crisaout.sh, emulparams/criself.sh, emulparams/crislinux.sh, scripttempl/crisaout.sc: New files. * po/POTFILES.in, po/ld.pot: Regenerate. 2000-07-20 H.J. Lu * emultempl/elf32.em (gld_${EMULATION_NAME}_list_options): Print out ignored -z options. 2000-07-19 H.J. Lu * emulparams/elf32mcore.sh (PARSE_AND_LIST_ARGS): Removed. (PARSE_AND_LIST_PROLOGUE): New. (PARSE_AND_LIST_LONGOPTS): Likewise. (PARSE_AND_LIST_OPTIONS): Likewise. (PARSE_AND_LIST_ARGS_CASES): Likewise. * ldmain.c (main): Clear link_info.flags and link_info.flags_1. * lexsup.c (ld_options): Comment out 'z'. (parse_args): Likewise. * emultempl/elf32.em: Include "elf/common.h". (gld_${EMULATION_NAME}_parse_args): Defined. Handle some -z options. (gld_${EMULATION_NAME}_list_options): Likewise. * ld.texinfo: Add documentation for the recognized -z options. 2000-07-19 H.J. Lu * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Call bfd_elf_set_dt_needed_soname (). 2000-07-18 DJ Delorie * pe-dll.c (pe_dll_id_target): check object target name also 2000-07-18 Hans-Peter Nilsson * scripttempl/elf.sc (.init): Only do ${INIT_START} and ${INIT_END} if relocating. (.fini): Likewise ${FINI_START} and ${FINI_END}. 2000-07-16 Charles Wilson * emultempl/pe.em (gld_*_open_dynamic_archive): New search order for dynamic library '-lfoo' on pei386: libfoo.dll.a, foo.dll.a, libfoo.a, libfoo.dll, foo.dll. This fixes compatibility errors introduced by the old dynamic lib search order. 2000-07-17 DJ Delorie * pe-dll.c (process_def_file): auto-export data items also (pe_process_import_defs): also see if _imp_ form needed 2000-07-12 Charles Wilson * pe-dll.c (make_one): fix a typo in the __imp_ name decoration for dll import libraries 2000-07-12 Mark Elbrecht * scripttempl/i386go32.sc: Support the g++ attribute init_priority in gcc 2.95.2 and later. 2000-07-11 Kazu Hirata * ldfile.c (ldfile_try_open_bfd): Output '\n' after an error message. 2000-07-10 Alan Modra * ldemul.h (struct lang_input_statement_struct): Remove forward declaration. (struct search_dirs): Likewise. * ldfile.h (struct lang_input_statement_struct): Likewise. Protect file from multiple inclusion. * ldlang.h (LANG_FOR_EACH_INPUT_STATEMENT): Move file_chain declaration from macro to file scope. * ldemul.c: ldexp.h,ldlang.h,ldfile.h,ldemul.h go in this order. * ldgram.y: Likewise here. * ldlang.c: And here. * ldmain.c: And here. * mpw-elfmips.c: And here. * mpw-eppcmac.c: And here. * emultempl/aix.em: And here. * emultempl/armcoff.em: And here. * emultempl/armelf.em: And here. * emultempl/armelf_oabi.em: And here. * emultempl/beos.em: And here. * emultempl/elf32.em: And here. * emultempl/hppaelf.em: And here. * emultempl/linux.em: And here. * emultempl/lnk960.em: And here. * emultempl/pe.em: And here. * emultempl/sunos.em: And here. * mpw-esh.c: And here. Include ldexp.h and ldlang.h too. * mpw-idtmips.c: Ditto. * emultempl/generic.em: Ditto. * emultempl/gld960.em: Ditto. * emultempl/gld960c.em: Ditto. * emultempl/mipsecoff.em: Ditto. * emultempl/ticoff.em: Ditto. * emultempl/vanilla.em: Ditto. * pe-dll.c: Include ldfile.h * ldver.c: Include ldexp.h, ldlang.h, ldfile.h * mpw-elfmips.c: (gldelf32ebmip_before_allocation): Add missing arguments to bfd_elf32_size_dynamic_sections call. (gldelf32ebmip_place_orphan): Add missing arguments to lang_leave_output_section_statement call. 2000-07-10 H.J. Lu * emultempl/pe.em (pe_enable_stdcall_fixup): Protect with DLL_SUPPORT. (strhash): Likewise. (compute_dll_image_base): Likewise. (pe_undef_found_sym): Likewise. (pe_undef_cdecl_match): Likewise. (gld_${EMULATION_NAME}_open_dynamic_archive): Mark the argument "arch" with ATTRIBUTE_UNUSED. 2000-07-10 Alan Modra * configure.tgt: Remove extraneous hppa*-*-linux-gnu*. From Ryan Bradetich * ldwrite.c (SSIZE): Remove to cure macro redefinition warning. 2000-07-09 Alan Modra Changes to create multiple linker stubs, positioned immediately before the section where they are required. * emultempl/hppaelf.em: Include elf32-hppa.h. (stub_sec, file_chain): Delete. (hppaelf_create_output_section_statements): Don't make a stub section here. (hook_stub_info): New struct. (hook_in_stub): New function. (hppaelf_add_stub_section): New function. (hppaelf_finish): Do nothing for relocateable links. Modify the call to elf32_hppa_size_stubs. Move code for updating section layout from here... (hppaelf_layaout_sections_again): ..to here, a new function. * emultempl/hppaelf.em (hppaelf_delete_padding_statements): Fix broken list handling. Pass in a pointer to the list. (hppaelf_finish): Update call to hppaelf_delete_padding_statements for above changes. (hppaelf_before_parse): Prototype. (hppaelf_set_output_arch): Prototype. (hppaelf_create_output_section_statements): Prototype. (hppaelf_delete_padding_statements): Prototype. (hppaelf_finish): Prototype. Merge from elf32.em * emultempl/hppaelf.em: Include ctype.h. (struct orphan_save): New. (gld${EMULATION_NAME}_place_orphan): New. (output_rel_find): New. (hppaelf_get_script): Update from elf32.em. (ld_hppaelf_emulation): Rename to ld_${EMULATION_NAME}_emulation. Change emulation_name field to "${EMULATION_NAME}". Add gld${EMULATION_NAME}_place_orphan. * Makefile.am (ALL_EMULATIONS): Reinstate ehppaelf.o, add ehppalinux.o, sort it. Regenerate dependencies. (ehppalinux.c): Depend on hppaelf.em * Makefile.in: Regenerate. * configure.tgt: targ_emul=hppalinux for hppa*linux * emulparams/hppalinux.sh: New. * emulparams/hppaelf.sh (TARGET_PAGE_SIZE): Write in hex. 2000-07-08 Alan Modra * lexsup.c (parse_args): Copy section name. 2000-07-07 Charles Wilson * emultempl/pe.em: institute the following search order for dynamic libraries on pei386: libfoo.dll.a, foo.dll.a (import libs), libfoo.dll, foo.dll (link direct to dll). Fall back to static lib (libfoo.a) if none of the above are found. 2000-07-07 Mumit Khan * emultempl/pe.em (pe_enable_auto_image_base): New variable. (longopts): New --{enable,disable}-auto-image-base options. (gld_${EMULATION_NAME}_list_options): Document. (gld_${EMULATION_NAME}_parse): Handle. (strhash): New static function. (compute_dll_image_base): New static function. (gld_${EMULATION_NAME}_set_symbols): Use. 2000-07-05 DJ Delorie * MAINTAINERS: new 2000-07-01 Koundinya K * configure.tgt: Add traditional mips (mips*-*-sysv4*) target. * emulparams/elf32btsmip.sh: New file. * Makefile.am: Add traditional mips target. * Makefile.in: Rebuild. 2000-07-01 H.J. Lu * Makefile.am (EXTRA_ld_new_SOURCES): Set to deffilep.y for automake to use YLWRAP. * Makefile.in: Rebuild. 2000-07-01 Alan Modra * Makefile.am (DEP): Fix 2000-06-22. grep after running dep.sed (CLEANFILES): Add DEPA. * Makefile.in: Regenerate. 2000-06-30 Timothy Wall * scripttempl/tic54xcoff.sc: PAGE N is not implemented, so encode the page in the upper octet of the address. 2000-06-26 Marek Michalkiewicz * emulparams/avrmega161.sh (ARCH): Change to avr:5. 2000-06-24 Alan Modra * NEWS: arm-elf does --gc-sections too. 2000-06-22 Alan Modra * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we find one. * Makefile.in: Regenerate. 2000-06-21 H.J. Lu * Makefile.am: Rebuild dependency. * Makefile.in: Rebuild. 2000-06-20 H.J. Lu * Makefile.am: Rebuild dependency. * Makefile.in: Rebuild. 2000-06-20 Timothy Wall * scripttempl/tic54xcoff.sc: New. * ldlang.c (wild_doit): Propagate SEC_BLOCK flag. * gen-doc.texi: Add flag for TI COFF. * ld.texinfo: Add documentation for TI COFF handling switches. * emultempl/ticoff.em: New. TI COFF handling. * configure.tgt: Add tic54x target. * Makefile.am: Add tic54x target. * Makefile.in: Ditto. 2000-06-20 Alan Modra * ldmain.c (set_scripts_dir): Correct pointer comparison when checking for backslashes. 2000-06-19 Alan Modra * NEWS: Move entries not in 2.10 above "Changes in version 2.10". 2000-06-18 Alan Modra * NEWS: Update list of targets supporting --gc-sections. * scripttempl/elf.sc: KEEP .eh_frame contents. * scripttempl/elfd30v.sc: Same here. 2000-06-18 Stephane Carrez * Makefile.am (ALL_EMULATIONS): Added new emulation for m68hc12 and m68hc11 (elf). * Makefile.in: Rebuild. * configure.tgt: Recognize m68hc12 and m68hc11. * scripttempl/elfm68hc12.sc: New file. * emulparams/m68hc12elfb: New emulation. * emulparams/m68hc12elf: New emulation. * emulparams/m68hc11elfb.sh: New file. User configurable emulation (includes a memory.x script to define the ROM and RAM banks). * scripttempl/elfm68hc11.sc, emulparams/m68hc11elf.sh: New configuration files for support of Motorola 68hc11 2000-06-15 Alan Modra * ldmain.c (main): Only change SEC_READONLY for final link. 2000-06-13 H.J. Lu * configure: Regenerate. 2000-06-08 David O'Brien * configure.in (VERSION): Update to show this is the CVS mainline. 2000-06-07 Michael Sokolov * emultempl/mipsecoff.em (gld{EMULATION_NAME}_after_open): Require all input objects to be ECOFF. (check_sections): einfo takes %B, not %P, to print a BFD name. 2000-06-05 Michael Matz * ldgram.y (vers_defns): Handle 'extern "C++" { ... }' in version scripts. * ldlex.l (V_IDENTIFIER): Accept `::' in symbols. 2000-05-23 Marek Michalkiewicz * emulparams/avr1200.sh (STACK): Define as 0. * emulparams/avr23xx.sh (STACK): Define as last internal SRAM address. * emulparams/avr4433.sh (STACK): Likewise. * emulparams/avr44x4.sh (STACK): Likewise. * emulparams/avr85xx.sh (STACK): Likewise. * emulparams/avrmega103.sh (STACK): Likewise. * emulparams/avrmega161.sh (STACK): Likewise. * emulparams/avrmega603.sh (STACK): Likewise. * scripttempl/elf32avr.sc (__data_start): Define for gcrt1. (__stack): Define from ${STACK} for main(). 2000-05-26 Alan Modra * Makefile.am: Update dependencies with "make dep-am" * Makefile.in: Regenerate. 2000-05-26 Eli Zaretskii * ldmain.c: Include filenames.h. (set_scripts_dir): Support backslashes in program name. 2000-05-22 Igor Shevlyakov * ldmain.c (main): When deciding if ".text" section should be read-only, don't forget to reset SEC_READONLY because it could be already set. 2000-05-22 Thomas de Lellis * ld.1: Add documentation for new command line option: --section-start = This is a generic version of -Ttext etc. which accepts any section name as a parameter instead of just text/data/ bss. * ld.texinfo: More docs. * NEWS: More docs. * lexsup.c: (parse_args): Recognize new command line option. (ld_options): Add new option. 2000-05-18 H.J. Lu * lexsup.c (parse_args): `i' == `r', not `q'. 2000-05-18 Jeffrey A Law (law@cygnus.com) * configure.tgt (hppa*64*-*-*): Enable PA64 target. 2000-05-17 S. Bharadwaj Yadavalli Rick Gorton Add support for '-q' == '--emit-relocs' switch. * ldmain.c (main): Default to false. * lexsup.c (parse_args): Turn on emitrelocations flag if set. * NEWS: Describe the emitrelocations switch. * ld.texinfo: Describe the emitrelocations switch. 2000-05-16 Charles Wilson * emultempl/pe.em (_open_dynamic_archive): New function: Search the library path for "foo.dll" and "libfoo.dll" dynamic libraries before searching for 'libfoo.a' in response to a '-Bdynamic -lfoo' link options. 2000-05-15 David O'Brien * lexsup.c (parse_args): Update the year in the copyright notice. 2000-05-13 Alan Modra * ld.h (gettext, dgettext, dcgettext, textdomain, bindtextdomain): Replace defines with those from intl/libgettext.h to quieten gcc warnings. 2000-05-10 H.J. Lu * ldlang.c (open_input_bfds): Don't load the same file within a group again if the whole archive has been loaded already. 2000-05-03 Alan Modra From Ulf Carlsson and Andreas Jaeger * lexsup.c (set_section_start): Use bfd_scan_vma rather than strtoul. 2000-05-01 Jim Wilson * configure.host (ia64-*-linux-gnu*): Change gcc to ${CC}. * configure.host: Added HOSTING_CRT0, HOSTING_LIBS for host "ia64-*-linux-gnu*". 2000-04-29 Andreas Jaeger * ld.h: Correctly check GCC version. 2000-04-25 Jeffrey A Law (law@cygnus.com) * Makefile.am: Add PA64 support. Add missing dependencies for PA32 elf support. * Makefile.in: Rebuilt. * configure.tgt: Add PA64 support (currently disabled). 2000-04-25 Alan Modra * emultempl/elf32.em (gld${EMULATION_NAME}_place_section): Delete. (output_rel_find): New function. (hold_section, hold_use): Delete. (hold_text, hold_rodata, hold_data, hold_bss, hold_rel, hold_interp): Make local to place_orphan. (gld${EMULATION_NAME}_place_orphan): Use lang_output_section_find rather than place_section to find possible previous use of orphan. Similarly find the place-holder output sections. Use returned value from lang_enter_output_section_statement rather than calling lang_output_section_statement_lookup. * emultempl/armelf.em: Same here. * emultempl/pe.em: Similar to above, but no need for output_rel_find. * ldlang.c (lang_enter_output_section_statement): Return output section statement. * ldlang.h (lang_enter_output_section_statement): Change declaration too. * ldlang.h (lang_output_section_statement): Export it. * ldlang.c (lang_output_section_statement): Ditto. 2000-04-24 Nick Clifton * ld.texinfo (Output Section Data): Add note that section data commands cannot appear outside of section directives. 2000-04-2 Matthew Green * configure.tgt: Add NetBSD/sparc ELF, and NetBSD/sparc64 support. 2000-04-21 Richard Henderson David Mosberger * Makefile.am (ALL_64_EMULATIONS): Add eelf64_ia64.o. (eelf64_ia64.c): New rule. * Makefile.in: Rebuild. * configure.tgt (ia64-*-elf*, ia64-*-linux*): New targets. * emulparams/elf64_ia64.sh: New file. 2000-04-21 Richard Henderson * scripttempl/elfd30v.sc: Place .gcc_except_table. 2000-04-19 Alan Modra * dep-in.sed: Match space at start of file name, not at end. 2000-04-18 H.J. Lu * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Call lang_leave_output_section_statement () after calling lang_enter_output_section_statement (). * emultempl/armelf.em: Likewise. 2000-04-18 Alan Modra * emultempl/elf32.em (struct orphan_save): Add section field. (gld${EMULATION_NAME}_place_orphan): Use above to keep sections in better order, and place first orphan section as we did before the 2000-04-12 patch. Ignore ~SEC_ALLOC sections when choosing place. Don't call make_bfd_section here, let wild_doit do the job for us. Don't build a statement list when we'll only throw it away. * emultempl/armelf.em: Ditto. * emultempl/pe.em: Similarly. 2000-04-14 Geoff Keating * scripttempl/elfppc.sc: Remove. * emulparams/elf32ppc.sh: Use elf.sc. * emulparams/elf32lppc.sh: Use elf.sc. * emulparams/elf32ppclinux.sh: Use elf.sc. * emulparams/elf32ppcsim.sh: New file. * emulparams/elf32lppcsim.sh: New file. * Makefile.am: Update dependencies. Add elf32ppcsim ad elf32lppcsim. (ALL_EMULATIONS): Add elf32ppcsim ad elf32lppcsim. * Makefile.in: Regenerate. * configure.tgt (powerpc-*): Add elf32ppcsim and elf32lppcsim. 2000-04-14 Alan Modra * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Process ~SEC_ALLOC sections too. Init start address of debug sections. * emultempl/armelf.em (gld${EMULATION_NAME}_place_orphan): Ditto. * emultempl/pe.em (gld${EMULATION_NAME}_place_orphan): Ditto. Also set all relocateable section start addresses. 2000-04-13 Geoff Keating * scripttempl/elf.sc: Add support for .sbss2 and .sdata2 sections. Add new BSS_PLT variable for when .plt need not be contained in the file. Move _etext so that it is also after .fini, and provide both etext and _etext with a leading underscore. Mark the start and end of .sbss. 2000-04-12 Alan Modra * emultempl/elf32.em (struct orphan_save): New. (hold_text, hold_rodata, hold_data, hold_bss, hold_rel, hold_interp): Make them struct orphan_save. (gld${EMULATION_NAME}_place_section): Modify for new hold_*. (gld${EMULATION_NAME}_place_orphan): Add new orphan sections to the end of the relevant section list. Also add associated section statements to the end of any previous orphan statements. * emultempl/armelf.em: Similarly. * emultempl/pe.em: Similarly. 2000-04-11 Alan Modra * ld.texinfo (Simple Example): Remove extraneous paragraph. 2000-04-07 Andrew Cagney * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add --enable-build-warnings option. * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions. * Makefile.in, configure: Re-generate. 2000-04-04 Alan Modra * po/ld.pot: Regenerate. * lexsup.c (help): Restore translated part of bug string. * Makefile.am (MKDEP): Use gcc -MM rather than mkdep. (DEP): Quote when passing vars to sub-make. Add warning message to end. (DEP1): Rewrite for "gcc -MM". (CLEANFILES): Add DEP2. Update dependencies. * Makefile.in: Regenerate. 2000-04-03 Alan Modra * ld.h: #include "bin-bugs.h" * lexsup.c (help): Use REPORT_BUGS_TO. 2000-03-27 Denis Chertykov * configure.tgt (avr-*-*): New target support. * Makefile.am: Likewise. * scripttempl/elf32avr.sc: New script file. * emulparams/avr1200.sh: New file. * emulparams/avr23xx.sh: New file. * emulparams/avr4433.sh New file. * emulparams/avr44x4.sh New file. * emulparams/avr85xx.sh New file. * emulparams/avrmega103.sh New file. * emulparams/avrmega161.sh New file. * emulparams/avrmega603.sh New file. * Makefile.in: Regenerate. 2000-03-09 Andreas Jaeger * Makefile.am (check-DEJAGNU): Also unset LANG. * Makefile.in: Rebuild. 2000-03-06 Ian Lance Taylor * ldfile.c (ldfile_try_open_bfd): Don't crash if we see an empty archive. 2000-03-02 H.J. Lu * emulparams/elf32mcore.sh: Include "getopt.h". 2000-03-01 Ian Lance Taylor * configure.tgt: Remove *-*-aout, *-*-coff, and *-*-netware. 2000-03-01 H.J. Lu * emulparams/mipspe.sh: Add SUBSYSTEM and INITIAL_SYMBOL_CHAR. * emulparams/shpe.sh: Likewise. 2000-03-01 Nick Clifton * pe-dll.c: Remove unused variables and add ATTRIBUTE_UNUSED to unused parameters. * emultempl/pe.em: Add "#ifdef DLL_SUPPORT" around static functions only used by DLL code. (_place_orphan): Initialise 'dollar'. 2000-03-01 H.J. Lu * ldmain.c (undefined_symbol): Take one more arg, fatal, to indicate if the undefined symbol is a fatal error or not. Don't delete the output file if "fatal" is false. 2000-02-29 H.J. Lu * Makefile.am (check-DEJAGNU): Also pass LIBS="$(LIBS)". Set LC_COLLATE and LC_ALL to null and export them. It is for sort which expects the C locale. Add $(LIBS) to all $(HOSTING_LIBS). * Makefile.in: Rebuild. 2000-02-29 Alan Modra * emultempl/{aix.em, armcoff.em, armelf.em, armelf_oabi.em, beos.em, elf32.em, generic.em, gld960.em, gld960c.em, hppaelf.em, linux.em, lnk960.em, mipsecoff.em, sunos.em, vanilla.em} (ld_emulation_xfer_struct): Add missing NULL initialiser for find_potential_libraries. 2000-02-28 Jim Blandy * ldgram.y (exclude_name_list): Don't require a comma to separate list entries; the lexer considers commas to be valid part of a filename, so in something like `foo, bar' the comma is considered part of the first filename, `foo,'. * ld.texinfo: Update section on EXCLUDE_FILE lists. 2000-02-27 Loren J. Rittle * configure.host: Added HOSTING_CRT0, HOSTING_LIBS for host "i[3456]86-*-freebsdelf*". 2000-02-27 Mark Elbrecht * scripttempl/i386go32.sc: Move misplaced semicolons. 2000-02-25 Ian Lance Taylor * Makefile.am (ALL_EMULATIONS): Remove ehppaelf.o. (ALL_64_EMULATIONS): Remove eelf64hppa.o. (eelf64hppa.c, ehppaelf.c): Remove targets. * Makefile.in: Rebuild. 2000-02-25 Alexandre Oliva * configure.tgt (targ_extra_ofiles): Enable elf64_sparc on GNU/Linux/sparc, but keep the default as 32. * configure.tgt: Enable elf64_sparc on Solaris7+/sparc. And make it default if sparcv9 or sparc64. 2000-02-24 Nick Clifton * Makefile.am: Add rules to build emipspe.o and earmpe.o. * Makefile.in: Regenerate. * configure.tgt: Add targets for arm-wince, sh-pe and mips-pe. * ldemul.h (ld_emulation_xfer_struct): Add new field: find_potential_libraries. * ldemul.c (ldemul_find_potential_libraries): New function. * ldfile.c (ldfile_open_file_search): Allow function to be exported. (ldfile_open_file): Call ldemul_find_potential_libraries. * ldfile.h: Add prototype for ldfile_open_file_search. * pe-dll.c: Add support for ARM, MIPS and SH targets. * emulparams/mipspe.sh: New file. Parameters for mips-pe target. * emulparams/shpe.sh: New file. Parameters for sh-pe target. * emultempl/pe.em: Add support for ARM, MIPS and SH DLLs. (gld_X_find_potential_libraries): New function. Search for libraries called "*.lib". * scripttempl/pe.sc: Add .pdata section. 2000-02-23 Richard Henderson * scripttempl/elfd10v.sc: Remove dynamic linking hooks. Add and use memory regions. 2000-02-23 Linas Vepstas (linas@linas.org) * emulparams/elf32i370.sh, scripttempl/elfi370.sc: New. * Makefile.am: Add support for Linux/IBM 370. * configure.tgt: Likewise. * Makefile.in: Regenerate. 2000-02-21 Alan Modra * ldlang.c (print_input_section, print_data_statement, print_reloc_statement, print_padding_statement, insert_pad, size_input_section, lang_check_section_addresses, lang_size_sections, lang_do_assignments, lang_set_startof, lang_one_common): Change `opb' to unsigned. (lang_do_assignments): Also change `size' to unsigned. 2000-02-16 Richard Henderson * scripttempl/elf.sc: Place OTHER_PLT_RELOC_SECTION. 2000-02-16 Timothy Wall * mri.c (mri_draw_tree): Add default LMA region argument to call to lang_leave_output_section_statement. * ldlang.h: Update prototypes with LMA region arguments. * ldlang.c (lang_size_sections): Encapsulate region bounds checking in os_check_region call. (os_check_region): New function. (lang_output_section_statement_lookup): Initialize lma_region. (lang_leave_output_section_statement): Add LMA region argument. (lang_leave_overlay): Ditto. * ldgram.y: Handle LMA region syntax. * ld.texinfo (Output Section Description): Describe LMA region usage. * emultempl/armelf.em (gld$place_orphan): Add default value for lma region in call to lang_leave_output_section_statement. * emultempl/elf32.em (gld$place_orphan): Add default value for lma region in call to lang_leave_output_section_statement. * emultempl/pe.em (gld$place_orphan): Add default value for lma region in call to lang_leave_output_section_statement. 2000-02-04 Timothy Wall * ldlang.c (lang_check_section_addresses): Use bytes instead of octets when calculating section end addresses. 2000-02-04 Timothy Wall * ldlang.c (lang_size_sections): Fix typo in ALIGN_N invocation. 2000-02-03 Timothy Wall * ldexp.c (fold_name): Make SIZEOF operator return byte count, not octet count. * ldlang.c (print_input_section, print_data_statement, print_reloc_statement, print_padding_statement): Print target address values and section sizes as bytes, not octets. (insert_pad) Calculate padding size in octets, and adjust "dot" by bytes. (size_input_section) Always adjust "dot" by bytes, not octets. (lang_check_section_addresses, lang_do_assignments) Adjust "dot" by bytes, not octets. Use the larger of the directive size or octets_per_byte for the number of octets actually allocated in the output section. (lang_set_startof) Make sure STARTOF returns a target address. (lang_one_common) Record size changes in octets. (lang_abs_symbol_at_end_of) Section end symbol's value is recorded in target bytes. * ld.texinfo: Updated description of BYTE, SHORT, LONG, etc. to be clear about behavior when an octet is smaller than one byte. 2000-01-27 Alan Modra * ldcref.c (output_cref): Don't pass message strings to printf as format arg. Update copyright. * ldmisc.c (vfinfo): Same here. Update copyright. 2000-01-23 Alan Modra * emultempl/{armcoff.em,armelf.em,armelf_oabi.em,beos.em, generic.em,gld960.em,gld960c.em,hppaelf.em,linux.em,lnk960.em, mipsecoff.em,sunos.em,vanilla.em} (ld_emulation_xfer_struct): Add missing NULL initialisers, and comments. * testsuite/ld-srec/sr3.cc (__rethrow): New. 2000-01-21 Nick Clifton * ldlang.c (lang_size_sections): Fix typo in comment. 2000-01-18 H.J. Lu * ldlang.c (lang_size_sections): Also update the current address of a region if the SEC_NEVER_LOAD bit is not set. 2000-01-10 Philip Blundell * configure.tgt (arm*-*-conix*): New target. 2000-01-07 Nick Clifton * ld.texinfo (Options): Remind users to preceed linker command line switches with -Wl, (or whatever is appropriate) if it is being invoked by a comnpiler driver program. Fix description of the behaviour of the -n command line switch. 2000-01-05 Catherine Moore * ld.h (wildcard_spec): Change exclude_name to exclude_name_list. (name_list): New. * ld.texinfo (EXCLUDE_FILE): Update documentation. * ldgram.y (wildcard_spec): Support a list of excluded_files. (exclude_name_list): New. ldlang.c (walk_wild_section): Support list of excluded files. (print_wild_statement): Likewise. (lang_add_wild): Likewise. * ldlang.h (lang_wild_statement_type): Likewise. * scripttempl/elf.sc (OTHER_EXCLUDE_FILES): Support. 2000-01-04 Mumit Khan * pe-dll.c (pe_dll_warn_dup_exports): New variable. (process_def_file): Use. (pe_dll_compat_implib): New variable. (make_one): Use. * pe-dll.h: Add exports of pe_dll_warn_dup_exports and pe_dll_compat_implib. * emultempl/pe.em (longopts): Add warn-duplicate-exports and compat-implib options. (gld_${EMULATION_NAME}_list_options): List new options. (gld_${EMULATION_NAME}_parse_args): Handle. * pe-dll.c (pe_dll_generate_implib): Use the correct name for output dll. * deffilep.y (opt_name): Allow "." in name. For older changes see ChangeLog-9899 Local Variables: mode: change-log left-margin: 8 fill-column: 74 version-control: never End: diff --git a/contrib/binutils/ld/ldlang.c b/contrib/binutils/ld/ldlang.c index 414a0340818e..9d33248a431e 100644 --- a/contrib/binutils/ld/ldlang.c +++ b/contrib/binutils/ld/ldlang.c @@ -1,5227 +1,5229 @@ /* Linker command language support. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. GLD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GLD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GLD; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" #include "libiberty.h" #include "safe-ctype.h" #include "obstack.h" #include "bfdlink.h" #include "ld.h" #include "ldmain.h" #include "ldgram.h" #include "ldexp.h" #include "ldlang.h" #include "ldlex.h" #include "ldmisc.h" #include "ldctor.h" #include "ldfile.h" #include "ldemul.h" #include "fnmatch.h" #include "demangle.h" /* FORWARDS */ static lang_statement_union_type *new_statement PARAMS ((enum statement_enum, size_t, lang_statement_list_type *)); /* LOCALS */ static struct obstack stat_obstack; #define obstack_chunk_alloc xmalloc #define obstack_chunk_free free static const char *startup_file; static lang_statement_list_type input_file_chain; static boolean placed_commons = false; static lang_output_section_statement_type *default_common_section; static boolean map_option_f; static bfd_vma print_dot; static lang_input_statement_type *first_file; static const char *current_target; static const char *output_target; static lang_statement_list_type statement_list; static struct lang_phdr *lang_phdr_list; static void lang_for_each_statement_worker PARAMS ((void (*) (lang_statement_union_type *), lang_statement_union_type *)); static lang_input_statement_type *new_afile PARAMS ((const char *, lang_input_file_enum_type, const char *, boolean)); static lang_memory_region_type *lang_memory_default PARAMS ((asection *)); static void lang_map_flags PARAMS ((flagword)); static void init_os PARAMS ((lang_output_section_statement_type *)); static void exp_init_os PARAMS ((etree_type *)); static void section_already_linked PARAMS ((bfd *, asection *, PTR)); static struct bfd_hash_entry *already_linked_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); static void already_linked_table_init PARAMS ((void)); static void already_linked_table_free PARAMS ((void)); static boolean wildcardp PARAMS ((const char *)); static lang_statement_union_type *wild_sort PARAMS ((lang_wild_statement_type *, struct wildcard_list *, lang_input_statement_type *, asection *)); static void output_section_callback PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, lang_input_statement_type *, PTR)); static lang_input_statement_type *lookup_name PARAMS ((const char *)); static boolean load_symbols PARAMS ((lang_input_statement_type *, lang_statement_list_type *)); static void wild PARAMS ((lang_wild_statement_type *, const char *, lang_output_section_statement_type *)); static bfd *open_output PARAMS ((const char *)); static void ldlang_open_output PARAMS ((lang_statement_union_type *)); static void open_input_bfds PARAMS ((lang_statement_union_type *, boolean)); static void lang_reasonable_defaults PARAMS ((void)); static void insert_undefined PARAMS ((const char *)); static void lang_place_undefineds PARAMS ((void)); static void map_input_to_output_sections PARAMS ((lang_statement_union_type *, const char *, lang_output_section_statement_type *)); static void print_output_section_statement PARAMS ((lang_output_section_statement_type *)); static void print_assignment PARAMS ((lang_assignment_statement_type *, lang_output_section_statement_type *)); static void print_input_statement PARAMS ((lang_input_statement_type *)); static boolean print_one_symbol PARAMS ((struct bfd_link_hash_entry *, PTR)); static void print_input_section PARAMS ((lang_input_section_type *)); static void print_fill_statement PARAMS ((lang_fill_statement_type *)); static void print_data_statement PARAMS ((lang_data_statement_type *)); static void print_address_statement PARAMS ((lang_address_statement_type *)); static void print_reloc_statement PARAMS ((lang_reloc_statement_type *)); static void print_padding_statement PARAMS ((lang_padding_statement_type *)); static void print_wild_statement PARAMS ((lang_wild_statement_type *, lang_output_section_statement_type *)); static void print_group PARAMS ((lang_group_statement_type *, lang_output_section_statement_type *)); static void print_statement PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *)); static void print_statement_list PARAMS ((lang_statement_union_type *, lang_output_section_statement_type *)); static void print_statements PARAMS ((void)); static void insert_pad PARAMS ((lang_statement_union_type **, fill_type, unsigned int, asection *, bfd_vma)); static bfd_vma size_input_section PARAMS ((lang_statement_union_type **, lang_output_section_statement_type *, fill_type, bfd_vma)); static void lang_finish PARAMS ((void)); static void ignore_bfd_errors PARAMS ((const char *, ...)); static void lang_check PARAMS ((void)); static void lang_common PARAMS ((void)); static boolean lang_one_common PARAMS ((struct bfd_link_hash_entry *, PTR)); static void lang_place_orphans PARAMS ((void)); static int topower PARAMS ((int)); static void lang_set_startof PARAMS ((void)); static void gc_section_callback PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, lang_input_statement_type *, PTR)); static void lang_record_phdrs PARAMS ((void)); static void lang_gc_wild PARAMS ((lang_wild_statement_type *)); static void lang_gc_sections_1 PARAMS ((lang_statement_union_type *)); static void lang_gc_sections PARAMS ((void)); static int lang_vers_match_lang_c PARAMS ((struct bfd_elf_version_expr *, const char *)); static int lang_vers_match_lang_cplusplus PARAMS ((struct bfd_elf_version_expr *, const char *)); static int lang_vers_match_lang_java PARAMS ((struct bfd_elf_version_expr *, const char *)); static void lang_do_version_exports_section PARAMS ((void)); static void lang_check_section_addresses PARAMS ((void)); static void os_region_check PARAMS ((lang_output_section_statement_type *, struct memory_region_struct *, etree_type *, bfd_vma)); typedef void (*callback_t) PARAMS ((lang_wild_statement_type *, struct wildcard_list *, asection *, lang_input_statement_type *, PTR)); static void walk_wild PARAMS ((lang_wild_statement_type *, callback_t, PTR)); static void walk_wild_section PARAMS ((lang_wild_statement_type *, lang_input_statement_type *, callback_t, PTR)); static void walk_wild_file PARAMS ((lang_wild_statement_type *, lang_input_statement_type *, callback_t, PTR)); static int get_target PARAMS ((const bfd_target *, PTR)); static void stricpy PARAMS ((char *, char *)); static void strcut PARAMS ((char *, char *)); static int name_compare PARAMS ((char *, char *)); static int closest_target_match PARAMS ((const bfd_target *, PTR)); static char * get_first_input_target PARAMS ((void)); /* EXPORTS */ lang_output_section_statement_type *abs_output_section; lang_statement_list_type lang_output_section_statement; lang_statement_list_type *stat_ptr = &statement_list; lang_statement_list_type file_chain = { NULL, NULL }; const char *entry_symbol = NULL; const char *entry_section = ".text"; boolean entry_from_cmdline; boolean lang_has_input_file = false; boolean had_output_filename = false; boolean lang_float_flag = false; boolean delete_output_file_on_failure = false; struct lang_nocrossrefs *nocrossref_list; struct unique_sections *unique_section_list; etree_type *base; /* Relocation base - or null */ #if defined (__STDC__) || defined (ALMOST_STDC) #define cat(a,b) a##b #else #define cat(a,b) a/**/b #endif /* Don't beautify the line below with "innocent" whitespace, it breaks the K&R C preprocessor! */ #define new_stat(x, y) \ (cat (x,_type)*) new_statement (cat (x,_enum), sizeof (cat (x,_type)), y) #define outside_section_address(q) \ ((q)->output_offset + (q)->output_section->vma) #define outside_symbol_address(q) \ ((q)->value + outside_section_address (q->section)) #define SECTION_NAME_MAP_LENGTH (16) PTR stat_alloc (size) size_t size; { return obstack_alloc (&stat_obstack, size); } boolean unique_section_p (secnam) const char *secnam; { struct unique_sections *unam; for (unam = unique_section_list; unam; unam = unam->next) if (wildcardp (unam->name) ? fnmatch (unam->name, secnam, 0) == 0 : strcmp (unam->name, secnam) == 0) { return true; } return false; } /* Generic traversal routines for finding matching sections. */ static void walk_wild_section (ptr, file, callback, data) lang_wild_statement_type *ptr; lang_input_statement_type *file; callback_t callback; PTR data; { asection *s; if (file->just_syms_flag) return; for (s = file->the_bfd->sections; s != NULL; s = s->next) { struct wildcard_list *sec; sec = ptr->section_list; if (sec == NULL) (*callback) (ptr, sec, s, file, data); while (sec != NULL) { boolean skip = false; struct name_list *list_tmp; /* Don't process sections from files which were excluded. */ for (list_tmp = sec->spec.exclude_name_list; list_tmp; list_tmp = list_tmp->next) { if (wildcardp (list_tmp->name)) skip = fnmatch (list_tmp->name, file->filename, 0) == 0; else skip = strcmp (list_tmp->name, file->filename) == 0; /* If this file is part of an archive, and the archive is excluded, exclude this file. */ if (! skip && file->the_bfd != NULL && file->the_bfd->my_archive != NULL && file->the_bfd->my_archive->filename != NULL) { if (wildcardp (list_tmp->name)) skip = fnmatch (list_tmp->name, file->the_bfd->my_archive->filename, 0) == 0; else skip = strcmp (list_tmp->name, file->the_bfd->my_archive->filename) == 0; } if (skip) break; } if (!skip && sec->spec.name != NULL) { const char *sname = bfd_get_section_name (file->the_bfd, s); if (wildcardp (sec->spec.name)) skip = fnmatch (sec->spec.name, sname, 0) != 0; else skip = strcmp (sec->spec.name, sname) != 0; } if (!skip) (*callback) (ptr, sec, s, file, data); sec = sec->next; } } } /* Handle a wild statement for a single file F. */ static void walk_wild_file (s, f, callback, data) lang_wild_statement_type *s; lang_input_statement_type *f; callback_t callback; PTR data; { if (f->the_bfd == NULL || ! bfd_check_format (f->the_bfd, bfd_archive)) walk_wild_section (s, f, callback, data); else { bfd *member; /* This is an archive file. We must map each member of the archive separately. */ member = bfd_openr_next_archived_file (f->the_bfd, (bfd *) NULL); while (member != NULL) { /* When lookup_name is called, it will call the add_symbols entry point for the archive. For each element of the archive which is included, BFD will call ldlang_add_file, which will set the usrdata field of the member to the lang_input_statement. */ if (member->usrdata != NULL) { walk_wild_section (s, (lang_input_statement_type *) member->usrdata, callback, data); } member = bfd_openr_next_archived_file (f->the_bfd, member); } } } static void walk_wild (s, callback, data) lang_wild_statement_type *s; callback_t callback; PTR data; { const char *file_spec = s->filename; if (file_spec == NULL) { /* Perform the iteration over all files in the list. */ LANG_FOR_EACH_INPUT_STATEMENT (f) { walk_wild_file (s, f, callback, data); } } else if (wildcardp (file_spec)) { LANG_FOR_EACH_INPUT_STATEMENT (f) { if (fnmatch (file_spec, f->filename, FNM_FILE_NAME) == 0) walk_wild_file (s, f, callback, data); } } else { lang_input_statement_type *f; /* Perform the iteration over a single file. */ f = lookup_name (file_spec); if (f) walk_wild_file (s, f, callback, data); } } /* lang_for_each_statement walks the parse tree and calls the provided function for each node. */ static void lang_for_each_statement_worker (func, s) void (*func) PARAMS ((lang_statement_union_type *)); lang_statement_union_type *s; { for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { func (s); switch (s->header.type) { case lang_constructors_statement_enum: lang_for_each_statement_worker (func, constructor_list.head); break; case lang_output_section_statement_enum: lang_for_each_statement_worker (func, s->output_section_statement.children.head); break; case lang_wild_statement_enum: lang_for_each_statement_worker (func, s->wild_statement.children.head); break; case lang_group_statement_enum: lang_for_each_statement_worker (func, s->group_statement.children.head); break; case lang_data_statement_enum: case lang_reloc_statement_enum: case lang_object_symbols_statement_enum: case lang_output_statement_enum: case lang_target_statement_enum: case lang_input_section_enum: case lang_input_statement_enum: case lang_assignment_statement_enum: case lang_padding_statement_enum: case lang_address_statement_enum: case lang_fill_statement_enum: break; default: FAIL (); break; } } } void lang_for_each_statement (func) void (*func) PARAMS ((lang_statement_union_type *)); { lang_for_each_statement_worker (func, statement_list.head); } /*----------------------------------------------------------------------*/ void lang_list_init (list) lang_statement_list_type *list; { list->head = (lang_statement_union_type *) NULL; list->tail = &list->head; } /* Build a new statement node for the parse tree. */ static lang_statement_union_type * new_statement (type, size, list) enum statement_enum type; size_t size; lang_statement_list_type *list; { lang_statement_union_type *new = (lang_statement_union_type *) stat_alloc (size); new->header.type = type; new->header.next = (lang_statement_union_type *) NULL; lang_statement_append (list, new, &new->header.next); return new; } /* Build a new input file node for the language. There are several ways in which we treat an input file, eg, we only look at symbols, or prefix it with a -l etc. We can be supplied with requests for input files more than once; they may, for example be split over serveral lines like foo.o(.text) foo.o(.data) etc, so when asked for a file we check that we haven't got it already so we don't duplicate the bfd. */ static lang_input_statement_type * new_afile (name, file_type, target, add_to_list) const char *name; lang_input_file_enum_type file_type; const char *target; boolean add_to_list; { lang_input_statement_type *p; if (add_to_list) p = new_stat (lang_input_statement, stat_ptr); else { p = ((lang_input_statement_type *) stat_alloc (sizeof (lang_input_statement_type))); p->header.next = NULL; } lang_has_input_file = true; p->target = target; switch (file_type) { case lang_input_file_is_symbols_only_enum: p->filename = name; p->is_archive = false; p->real = true; p->local_sym_name = name; p->just_syms_flag = true; p->search_dirs_flag = false; break; case lang_input_file_is_fake_enum: p->filename = name; p->is_archive = false; p->real = false; p->local_sym_name = name; p->just_syms_flag = false; p->search_dirs_flag = false; break; case lang_input_file_is_l_enum: p->is_archive = true; p->filename = name; p->real = true; p->local_sym_name = concat ("-l", name, (const char *) NULL); p->just_syms_flag = false; p->search_dirs_flag = true; break; case lang_input_file_is_marker_enum: p->filename = name; p->is_archive = false; p->real = false; p->local_sym_name = name; p->just_syms_flag = false; p->search_dirs_flag = true; break; case lang_input_file_is_search_file_enum: p->filename = name; p->is_archive = false; p->real = true; p->local_sym_name = name; p->just_syms_flag = false; p->search_dirs_flag = true; break; case lang_input_file_is_file_enum: p->filename = name; p->is_archive = false; p->real = true; p->local_sym_name = name; p->just_syms_flag = false; p->search_dirs_flag = false; break; default: FAIL (); } p->the_bfd = (bfd *) NULL; p->asymbols = (asymbol **) NULL; p->next_real_file = (lang_statement_union_type *) NULL; p->next = (lang_statement_union_type *) NULL; p->symbol_count = 0; p->dynamic = config.dynamic_link; p->whole_archive = whole_archive; p->loaded = false; lang_statement_append (&input_file_chain, (lang_statement_union_type *) p, &p->next_real_file); return p; } lang_input_statement_type * lang_add_input_file (name, file_type, target) const char *name; lang_input_file_enum_type file_type; const char *target; { lang_has_input_file = true; return new_afile (name, file_type, target, true); } /* Build enough state so that the parser can build its tree. */ void lang_init () { obstack_begin (&stat_obstack, 1000); stat_ptr = &statement_list; lang_list_init (stat_ptr); lang_list_init (&input_file_chain); lang_list_init (&lang_output_section_statement); lang_list_init (&file_chain); first_file = lang_add_input_file ((char *) NULL, lang_input_file_is_marker_enum, (char *) NULL); abs_output_section = lang_output_section_statement_lookup (BFD_ABS_SECTION_NAME); abs_output_section->bfd_section = bfd_abs_section_ptr; } /*---------------------------------------------------------------------- A region is an area of memory declared with the MEMORY { name:org=exp, len=exp ... } syntax. We maintain a list of all the regions here. If no regions are specified in the script, then the default is used which is created when looked up to be the entire data space. */ static lang_memory_region_type *lang_memory_region_list; static lang_memory_region_type **lang_memory_region_list_tail = &lang_memory_region_list; lang_memory_region_type * lang_memory_region_lookup (name) const char *const name; { lang_memory_region_type *p; for (p = lang_memory_region_list; p != (lang_memory_region_type *) NULL; p = p->next) { if (strcmp (p->name, name) == 0) { return p; } } #if 0 /* This code used to always use the first region in the list as the default region. I changed it to instead use a region encompassing all of memory as the default region. This permits NOLOAD sections to work reasonably without requiring a region. People should specify what region they mean, if they really want a region. */ if (strcmp (name, "*default*") == 0) { if (lang_memory_region_list != (lang_memory_region_type *) NULL) { return lang_memory_region_list; } } #endif { lang_memory_region_type *new = (lang_memory_region_type *) stat_alloc (sizeof (lang_memory_region_type)); new->name = xstrdup (name); new->next = (lang_memory_region_type *) NULL; *lang_memory_region_list_tail = new; lang_memory_region_list_tail = &new->next; new->origin = 0; new->flags = 0; new->not_flags = 0; new->length = ~(bfd_size_type) 0; new->current = 0; new->had_full_message = false; return new; } } static lang_memory_region_type * lang_memory_default (section) asection *section; { lang_memory_region_type *p; flagword sec_flags = section->flags; /* Override SEC_DATA to mean a writable section. */ if ((sec_flags & (SEC_ALLOC | SEC_READONLY | SEC_CODE)) == SEC_ALLOC) sec_flags |= SEC_DATA; for (p = lang_memory_region_list; p != (lang_memory_region_type *) NULL; p = p->next) { if ((p->flags & sec_flags) != 0 && (p->not_flags & sec_flags) == 0) { return p; } } return lang_memory_region_lookup ("*default*"); } lang_output_section_statement_type * lang_output_section_find (name) const char *const name; { lang_statement_union_type *u; lang_output_section_statement_type *lookup; for (u = lang_output_section_statement.head; u != (lang_statement_union_type *) NULL; u = lookup->next) { lookup = &u->output_section_statement; if (strcmp (name, lookup->name) == 0) { return lookup; } } return (lang_output_section_statement_type *) NULL; } lang_output_section_statement_type * lang_output_section_statement_lookup (name) const char *const name; { lang_output_section_statement_type *lookup; lookup = lang_output_section_find (name); if (lookup == (lang_output_section_statement_type *) NULL) { lookup = (lang_output_section_statement_type *) new_stat (lang_output_section_statement, stat_ptr); lookup->region = (lang_memory_region_type *) NULL; lookup->lma_region = (lang_memory_region_type *) NULL; lookup->fill = 0; lookup->block_value = 1; lookup->name = name; lookup->next = (lang_statement_union_type *) NULL; lookup->bfd_section = (asection *) NULL; lookup->processed = false; lookup->sectype = normal_section; lookup->addr_tree = (etree_type *) NULL; lang_list_init (&lookup->children); lookup->memspec = (const char *) NULL; lookup->flags = 0; lookup->subsection_alignment = -1; lookup->section_alignment = -1; lookup->load_base = (union etree_union *) NULL; lookup->phdrs = NULL; lang_statement_append (&lang_output_section_statement, (lang_statement_union_type *) lookup, &lookup->next); } return lookup; } static void lang_map_flags (flag) flagword flag; { if (flag & SEC_ALLOC) minfo ("a"); if (flag & SEC_CODE) minfo ("x"); if (flag & SEC_READONLY) minfo ("r"); if (flag & SEC_DATA) minfo ("w"); if (flag & SEC_LOAD) minfo ("l"); } void lang_map () { lang_memory_region_type *m; minfo (_("\nMemory Configuration\n\n")); fprintf (config.map_file, "%-16s %-18s %-18s %s\n", _("Name"), _("Origin"), _("Length"), _("Attributes")); for (m = lang_memory_region_list; m != (lang_memory_region_type *) NULL; m = m->next) { char buf[100]; int len; fprintf (config.map_file, "%-16s ", m->name); sprintf_vma (buf, m->origin); minfo ("0x%s ", buf); len = strlen (buf); while (len < 16) { print_space (); ++len; } minfo ("0x%V", m->length); if (m->flags || m->not_flags) { #ifndef BFD64 minfo (" "); #endif if (m->flags) { print_space (); lang_map_flags (m->flags); } if (m->not_flags) { minfo (" !"); lang_map_flags (m->not_flags); } } print_nl (); } fprintf (config.map_file, _("\nLinker script and memory map\n\n")); print_statements (); } /* Initialize an output section. */ static void init_os (s) lang_output_section_statement_type *s; { section_userdata_type *new; if (s->bfd_section != NULL) return; if (strcmp (s->name, DISCARD_SECTION_NAME) == 0) einfo (_("%P%F: Illegal use of `%s' section\n"), DISCARD_SECTION_NAME); new = ((section_userdata_type *) stat_alloc (sizeof (section_userdata_type))); s->bfd_section = bfd_get_section_by_name (output_bfd, s->name); if (s->bfd_section == (asection *) NULL) s->bfd_section = bfd_make_section (output_bfd, s->name); if (s->bfd_section == (asection *) NULL) { einfo (_("%P%F: output format %s cannot represent section called %s\n"), output_bfd->xvec->name, s->name); } s->bfd_section->output_section = s->bfd_section; /* We initialize an output sections output offset to minus its own vma to allow us to output a section through itself. */ s->bfd_section->output_offset = 0; get_userdata (s->bfd_section) = (PTR) new; /* If there is a base address, make sure that any sections it might mention are initialized. */ if (s->addr_tree != NULL) exp_init_os (s->addr_tree); } /* Make sure that all output sections mentioned in an expression are initialized. */ static void exp_init_os (exp) etree_type *exp; { switch (exp->type.node_class) { case etree_assign: exp_init_os (exp->assign.src); break; case etree_binary: exp_init_os (exp->binary.lhs); exp_init_os (exp->binary.rhs); break; case etree_trinary: exp_init_os (exp->trinary.cond); exp_init_os (exp->trinary.lhs); exp_init_os (exp->trinary.rhs); break; case etree_unary: exp_init_os (exp->unary.child); break; case etree_name: switch (exp->type.node_code) { case ADDR: case LOADADDR: case SIZEOF: { lang_output_section_statement_type *os; os = lang_output_section_find (exp->name.name); if (os != NULL && os->bfd_section == NULL) init_os (os); } } break; default: break; } } /* Sections marked with the SEC_LINK_ONCE flag should only be linked once into the output. This routine checks each section, and arrange to discard it if a section of the same name has already been linked. If the section has COMDAT information, then it uses that to decide whether the section should be included. This code assumes that all relevant sections have the SEC_LINK_ONCE flag set; that is, it does not depend solely upon the section name. section_already_linked is called via bfd_map_over_sections. */ /* This is the shape of the elements inside the already_linked hash table. It maps a name onto a list of already_linked elements with the same name. It's possible to get more than one element in a list if the COMDAT sections have different names. */ struct already_linked_hash_entry { struct bfd_hash_entry root; struct already_linked *entry; }; struct already_linked { struct already_linked *next; asection *sec; }; /* The hash table. */ static struct bfd_hash_table already_linked_table; static void section_already_linked (abfd, sec, data) bfd *abfd; asection *sec; PTR data; { lang_input_statement_type *entry = (lang_input_statement_type *) data; flagword flags; const char *name; struct already_linked *l; struct already_linked_hash_entry *already_linked_list; /* If we are only reading symbols from this object, then we want to discard all sections. */ if (entry->just_syms_flag) { sec->output_section = bfd_abs_section_ptr; sec->output_offset = sec->vma; return; } flags = bfd_get_section_flags (abfd, sec); if ((flags & SEC_LINK_ONCE) == 0) return; /* FIXME: When doing a relocatable link, we may have trouble copying relocations in other sections that refer to local symbols in the section being discarded. Those relocations will have to be converted somehow; as of this writing I'm not sure that any of the backends handle that correctly. It is tempting to instead not discard link once sections when doing a relocatable link (technically, they should be discarded whenever we are building constructors). However, that fails, because the linker winds up combining all the link once sections into a single large link once section, which defeats the purpose of having link once sections in the first place. Also, not merging link once sections in a relocatable link causes trouble for MIPS ELF, which relies in link once semantics to handle the .reginfo section correctly. */ name = bfd_get_section_name (abfd, sec); already_linked_list = ((struct already_linked_hash_entry *) bfd_hash_lookup (&already_linked_table, name, true, false)); for (l = already_linked_list->entry; l != NULL; l = l->next) { if (sec->comdat == NULL || l->sec->comdat == NULL || strcmp (sec->comdat->name, l->sec->comdat->name) == 0) { /* The section has already been linked. See if we should issue a warning. */ switch (flags & SEC_LINK_DUPLICATES) { default: abort (); case SEC_LINK_DUPLICATES_DISCARD: break; case SEC_LINK_DUPLICATES_ONE_ONLY: if (sec->comdat == NULL) einfo (_("%P: %B: warning: ignoring duplicate section `%s'\n"), abfd, name); else einfo (_("%P: %B: warning: ignoring duplicate `%s' section symbol `%s'\n"), abfd, name, sec->comdat->name); break; case SEC_LINK_DUPLICATES_SAME_CONTENTS: /* FIXME: We should really dig out the contents of both sections and memcmp them. The COFF/PE spec says that the Microsoft linker does not implement this correctly, so I'm not going to bother doing it either. */ /* Fall through. */ case SEC_LINK_DUPLICATES_SAME_SIZE: if (bfd_section_size (abfd, sec) != bfd_section_size (l->sec->owner, l->sec)) einfo (_("%P: %B: warning: duplicate section `%s' has different size\n"), abfd, name); break; } /* Set the output_section field so that lang_add_section does not create a lang_input_section structure for this section. */ sec->output_section = bfd_abs_section_ptr; return; } } /* This is the first section with this name. Record it. Allocate the memory from the same obstack as the hash table is kept in. */ l = ((struct already_linked *) bfd_hash_allocate (&already_linked_table, sizeof *l)); l->sec = sec; l->next = already_linked_list->entry; already_linked_list->entry = l; } /* Support routines for the hash table used by section_already_linked, initialize the table, fill in an entry and remove the table. */ static struct bfd_hash_entry * already_linked_newfunc (entry, table, string) struct bfd_hash_entry *entry ATTRIBUTE_UNUSED; struct bfd_hash_table *table; const char *string ATTRIBUTE_UNUSED; { struct already_linked_hash_entry *ret = bfd_hash_allocate (table, sizeof (struct already_linked_hash_entry)); ret->entry = NULL; return (struct bfd_hash_entry *) ret; } static void already_linked_table_init () { if (! bfd_hash_table_init_n (&already_linked_table, already_linked_newfunc, 42)) einfo (_("%P%F: Failed to create hash table\n")); } static void already_linked_table_free () { bfd_hash_table_free (&already_linked_table); } /* The wild routines. These expand statements like *(.text) and foo.o to a list of explicit actions, like foo.o(.text), bar.o(.text) and foo.o(.text, .data). */ /* Return true if the PATTERN argument is a wildcard pattern. Although backslashes are treated specially if a pattern contains wildcards, we do not consider the mere presence of a backslash to be enough to cause the pattern to be treated as a wildcard. That lets us handle DOS filenames more naturally. */ static boolean wildcardp (pattern) const char *pattern; { const char *s; for (s = pattern; *s != '\0'; ++s) if (*s == '?' || *s == '*' || *s == '[') return true; return false; } /* Add SECTION to the output section OUTPUT. Do this by creating a lang_input_section statement which is placed at PTR. FILE is the input file which holds SECTION. */ void lang_add_section (ptr, section, output, file) lang_statement_list_type *ptr; asection *section; lang_output_section_statement_type *output; lang_input_statement_type *file; { flagword flags; boolean discard; flags = bfd_get_section_flags (section->owner, section); discard = false; /* If we are doing a final link, discard sections marked with SEC_EXCLUDE. */ if (! link_info.relocateable && (flags & SEC_EXCLUDE) != 0) discard = true; /* Discard input sections which are assigned to a section named DISCARD_SECTION_NAME. */ if (strcmp (output->name, DISCARD_SECTION_NAME) == 0) discard = true; /* Discard debugging sections if we are stripping debugging information. */ if ((link_info.strip == strip_debugger || link_info.strip == strip_all) && (flags & SEC_DEBUGGING) != 0) discard = true; if (discard) { if (section->output_section == NULL) { /* This prevents future calls from assigning this section. */ section->output_section = bfd_abs_section_ptr; } return; } if (section->output_section == NULL) { boolean first; lang_input_section_type *new; flagword flags; if (output->bfd_section == NULL) init_os (output); first = ! output->bfd_section->linker_has_input; output->bfd_section->linker_has_input = 1; /* Add a section reference to the list. */ new = new_stat (lang_input_section, ptr); new->section = section; new->ifile = file; section->output_section = output->bfd_section; flags = section->flags; /* We don't copy the SEC_NEVER_LOAD flag from an input section to an output section, because we want to be able to include a SEC_NEVER_LOAD section in the middle of an otherwise loaded section (I don't know why we want to do this, but we do). build_link_order in ldwrite.c handles this case by turning the embedded SEC_NEVER_LOAD section into a fill. */ flags &= ~ SEC_NEVER_LOAD; /* If final link, don't copy the SEC_LINK_ONCE flags, they've already been processed. One reason to do this is that on pe format targets, .text$foo sections go into .text and it's odd to see .text with SEC_LINK_ONCE set. */ if (! link_info.relocateable) flags &= ~ (SEC_LINK_ONCE | SEC_LINK_DUPLICATES); /* If this is not the first input section, and the SEC_READONLY flag is not currently set, then don't set it just because the input section has it set. */ if (! first && (section->output_section->flags & SEC_READONLY) == 0) flags &= ~ SEC_READONLY; /* Keep SEC_MERGE and SEC_STRINGS only if they are the same. */ if (! first && ((section->output_section->flags & (SEC_MERGE | SEC_STRINGS)) != (flags & (SEC_MERGE | SEC_STRINGS)) || ((flags & SEC_MERGE) && section->output_section->entsize != section->entsize))) { section->output_section->flags &= ~ (SEC_MERGE | SEC_STRINGS); flags &= ~ (SEC_MERGE | SEC_STRINGS); } section->output_section->flags |= flags; if (flags & SEC_MERGE) section->output_section->entsize = section->entsize; /* If SEC_READONLY is not set in the input section, then clear it from the output section. */ if ((section->flags & SEC_READONLY) == 0) section->output_section->flags &= ~SEC_READONLY; switch (output->sectype) { case normal_section: break; case dsect_section: case copy_section: case info_section: case overlay_section: output->bfd_section->flags &= ~SEC_ALLOC; break; case noload_section: output->bfd_section->flags &= ~SEC_LOAD; output->bfd_section->flags |= SEC_NEVER_LOAD; break; } /* Copy over SEC_SMALL_DATA. */ if (section->flags & SEC_SMALL_DATA) section->output_section->flags |= SEC_SMALL_DATA; if (section->alignment_power > output->bfd_section->alignment_power) output->bfd_section->alignment_power = section->alignment_power; /* If supplied an aligment, then force it. */ if (output->section_alignment != -1) output->bfd_section->alignment_power = output->section_alignment; if (section->flags & SEC_BLOCK) { section->output_section->flags |= SEC_BLOCK; /* FIXME: This value should really be obtained from the bfd... */ output->block_value = 128; } } } /* Handle wildcard sorting. This returns the lang_input_section which should follow the one we are going to create for SECTION and FILE, based on the sorting requirements of WILD. It returns NULL if the new section should just go at the end of the current list. */ static lang_statement_union_type * wild_sort (wild, sec, file, section) lang_wild_statement_type *wild; struct wildcard_list *sec; lang_input_statement_type *file; asection *section; { const char *section_name; lang_statement_union_type *l; if (!wild->filenames_sorted && (sec == NULL || !sec->spec.sorted)) return NULL; section_name = bfd_get_section_name (file->the_bfd, section); for (l = wild->children.head; l != NULL; l = l->header.next) { lang_input_section_type *ls; if (l->header.type != lang_input_section_enum) continue; ls = &l->input_section; /* Sorting by filename takes precedence over sorting by section name. */ if (wild->filenames_sorted) { const char *fn, *ln; boolean fa, la; int i; /* The PE support for the .idata section as generated by dlltool assumes that files will be sorted by the name of the archive and then the name of the file within the archive. */ if (file->the_bfd != NULL && bfd_my_archive (file->the_bfd) != NULL) { fn = bfd_get_filename (bfd_my_archive (file->the_bfd)); fa = true; } else { fn = file->filename; fa = false; } if (ls->ifile->the_bfd != NULL && bfd_my_archive (ls->ifile->the_bfd) != NULL) { ln = bfd_get_filename (bfd_my_archive (ls->ifile->the_bfd)); la = true; } else { ln = ls->ifile->filename; la = false; } i = strcmp (fn, ln); if (i > 0) continue; else if (i < 0) break; if (fa || la) { if (fa) fn = file->filename; if (la) ln = ls->ifile->filename; i = strcmp (fn, ln); if (i > 0) continue; else if (i < 0) break; } } /* Here either the files are not sorted by name, or we are looking at the sections for this file. */ if (sec != NULL && sec->spec.sorted) { if (strcmp (section_name, bfd_get_section_name (ls->ifile->the_bfd, ls->section)) < 0) break; } } return l; } /* Expand a wild statement for a particular FILE. SECTION may be NULL, in which case it is a wild card. */ static void output_section_callback (ptr, sec, section, file, output) lang_wild_statement_type *ptr; struct wildcard_list *sec; asection *section; lang_input_statement_type *file; PTR output; { lang_statement_union_type *before; /* Exclude sections that match UNIQUE_SECTION_LIST. */ if (unique_section_p (bfd_get_section_name (file->the_bfd, section))) return; /* If the wild pattern was marked KEEP, the member sections should be as well. */ if (ptr->keep_sections) section->flags |= SEC_KEEP; before = wild_sort (ptr, sec, file, section); /* Here BEFORE points to the lang_input_section which should follow the one we are about to add. If BEFORE is NULL, then the section should just go at the end of the current list. */ if (before == NULL) lang_add_section (&ptr->children, section, (lang_output_section_statement_type *) output, file); else { lang_statement_list_type list; lang_statement_union_type **pp; lang_list_init (&list); lang_add_section (&list, section, (lang_output_section_statement_type *) output, file); /* If we are discarding the section, LIST.HEAD will be NULL. */ if (list.head != NULL) { ASSERT (list.head->header.next == NULL); for (pp = &ptr->children.head; *pp != before; pp = &(*pp)->header.next) ASSERT (*pp != NULL); list.head->header.next = *pp; *pp = list.head; } } } /* This is passed a file name which must have been seen already and added to the statement tree. We will see if it has been opened already and had its symbols read. If not then we'll read it. */ static lang_input_statement_type * lookup_name (name) const char *name; { lang_input_statement_type *search; for (search = (lang_input_statement_type *) input_file_chain.head; search != (lang_input_statement_type *) NULL; search = (lang_input_statement_type *) search->next_real_file) { if (search->filename == (char *) NULL && name == (char *) NULL) return search; if (search->filename != (char *) NULL && name != (char *) NULL && strcmp (search->filename, name) == 0) break; } if (search == (lang_input_statement_type *) NULL) search = new_afile (name, lang_input_file_is_file_enum, default_target, false); /* If we have already added this file, or this file is not real (FIXME: can that ever actually happen?) or the name is NULL (FIXME: can that ever actually happen?) don't add this file. */ if (search->loaded || ! search->real || search->filename == (const char *) NULL) return search; if (! load_symbols (search, (lang_statement_list_type *) NULL)) return NULL; return search; } /* Get the symbols for an input file. */ static boolean load_symbols (entry, place) lang_input_statement_type *entry; lang_statement_list_type *place; { char **matching; if (entry->loaded) return true; ldfile_open_file (entry); if (! bfd_check_format (entry->the_bfd, bfd_archive) && ! bfd_check_format_matches (entry->the_bfd, bfd_object, &matching)) { bfd_error_type err; lang_statement_list_type *hold; boolean bad_load = true; err = bfd_get_error (); /* See if the emulation has some special knowledge. */ if (ldemul_unrecognized_file (entry)) return true; if (err == bfd_error_file_ambiguously_recognized) { char **p; einfo (_("%B: file not recognized: %E\n"), entry->the_bfd); einfo (_("%B: matching formats:"), entry->the_bfd); for (p = matching; *p != NULL; p++) einfo (" %s", *p); einfo ("%F\n"); } else if (err != bfd_error_file_not_recognized || place == NULL) einfo (_("%F%B: file not recognized: %E\n"), entry->the_bfd); else bad_load = false; bfd_close (entry->the_bfd); entry->the_bfd = NULL; /* Try to interpret the file as a linker script. */ ldfile_open_command_file (entry->filename); hold = stat_ptr; stat_ptr = place; ldfile_assumed_script = true; parser_input = input_script; yyparse (); ldfile_assumed_script = false; stat_ptr = hold; return ! bad_load; } if (ldemul_recognized_file (entry)) return true; /* We don't call ldlang_add_file for an archive. Instead, the add_symbols entry point will call ldlang_add_file, via the add_archive_element callback, for each element of the archive which is used. */ switch (bfd_get_format (entry->the_bfd)) { default: break; case bfd_object: ldlang_add_file (entry); if (trace_files || trace_file_tries) info_msg ("%I\n", entry); break; case bfd_archive: if (entry->whole_archive) { bfd * member = NULL; boolean loaded = true; for (;;) { member = bfd_openr_next_archived_file (entry->the_bfd, member); if (member == NULL) break; if (! bfd_check_format (member, bfd_object)) { einfo (_("%F%B: member %B in archive is not an object\n"), entry->the_bfd, member); loaded = false; } if (! ((*link_info.callbacks->add_archive_element) (&link_info, member, "--whole-archive"))) abort (); if (! bfd_link_add_symbols (member, &link_info)) { einfo (_("%F%B: could not read symbols: %E\n"), member); loaded = false; } } entry->loaded = loaded; return loaded; } break; } if (bfd_link_add_symbols (entry->the_bfd, &link_info)) entry->loaded = true; else einfo (_("%F%B: could not read symbols: %E\n"), entry->the_bfd); return entry->loaded; } /* Handle a wild statement. S->FILENAME or S->SECTION_LIST or both may be NULL, indicating that it is a wildcard. Separate lang_input_section statements are created for each part of the expansion; they are added after the wild statement S. OUTPUT is the output section. */ static void wild (s, target, output) lang_wild_statement_type *s; const char *target ATTRIBUTE_UNUSED; lang_output_section_statement_type *output; { struct wildcard_list *sec; walk_wild (s, output_section_callback, (PTR) output); for (sec = s->section_list; sec != NULL; sec = sec->next) { if (default_common_section != NULL) break; if (sec->spec.name != NULL && strcmp (sec->spec.name, "COMMON") == 0) { /* Remember the section that common is going to in case we later get something which doesn't know where to put it. */ default_common_section = output; } } } /* Return true iff target is the sought target. */ static int get_target (target, data) const bfd_target *target; PTR data; { const char *sought = (const char *) data; return strcmp (target->name, sought) == 0; } /* Like strcpy() but convert to lower case as well. */ static void stricpy (dest, src) char *dest; char *src; { char c; while ((c = *src++) != 0) *dest++ = TOLOWER (c); *dest = 0; } /* Remove the first occurance of needle (if any) in haystack from haystack. */ static void strcut (haystack, needle) char *haystack; char *needle; { haystack = strstr (haystack, needle); if (haystack) { char *src; for (src = haystack + strlen (needle); *src;) *haystack++ = *src++; *haystack = 0; } } /* Compare two target format name strings. Return a value indicating how "similar" they are. */ static int name_compare (first, second) char *first; char *second; { char *copy1; char *copy2; int result; copy1 = xmalloc (strlen (first) + 1); copy2 = xmalloc (strlen (second) + 1); /* Convert the names to lower case. */ stricpy (copy1, first); stricpy (copy2, second); /* Remove and endian strings from the name. */ strcut (copy1, "big"); strcut (copy1, "little"); strcut (copy2, "big"); strcut (copy2, "little"); /* Return a value based on how many characters match, starting from the beginning. If both strings are the same then return 10 * their length. */ for (result = 0; copy1[result] == copy2[result]; result++) if (copy1[result] == 0) { result *= 10; break; } free (copy1); free (copy2); return result; } /* Set by closest_target_match() below. */ static const bfd_target *winner; /* Scan all the valid bfd targets looking for one that has the endianness requirement that was specified on the command line, and is the nearest match to the original output target. */ static int closest_target_match (target, data) const bfd_target *target; PTR data; { const bfd_target *original = (const bfd_target *) data; if (command_line.endian == ENDIAN_BIG && target->byteorder != BFD_ENDIAN_BIG) return 0; if (command_line.endian == ENDIAN_LITTLE && target->byteorder != BFD_ENDIAN_LITTLE) return 0; /* Must be the same flavour. */ if (target->flavour != original->flavour) return 0; /* If we have not found a potential winner yet, then record this one. */ if (winner == NULL) { winner = target; return 0; } /* Oh dear, we now have two potential candidates for a successful match. Compare their names and choose the better one. */ if (name_compare (target->name, original->name) > name_compare (winner->name, original->name)) winner = target; /* Keep on searching until wqe have checked them all. */ return 0; } /* Return the BFD target format of the first input file. */ static char * get_first_input_target () { char *target = NULL; LANG_FOR_EACH_INPUT_STATEMENT (s) { if (s->header.type == lang_input_statement_enum && s->real) { ldfile_open_file (s); if (s->the_bfd != NULL && bfd_check_format (s->the_bfd, bfd_object)) { target = bfd_get_target (s->the_bfd); if (target != NULL) break; } } } return target; } /* Open the output file. */ static bfd * open_output (name) const char *name; { bfd *output; /* Has the user told us which output format to use? */ if (output_target == (char *) NULL) { /* No - has the current target been set to something other than the default? */ if (current_target != default_target) output_target = current_target; /* No - can we determine the format of the first input file? */ else { output_target = get_first_input_target (); /* Failed - use the default output target. */ if (output_target == NULL) output_target = default_target; } } /* Has the user requested a particular endianness on the command line? */ if (command_line.endian != ENDIAN_UNSET) { const bfd_target *target; enum bfd_endian desired_endian; /* Get the chosen target. */ target = bfd_search_for_target (get_target, (PTR) output_target); /* If the target is not supported, we cannot do anything. */ if (target != NULL) { if (command_line.endian == ENDIAN_BIG) desired_endian = BFD_ENDIAN_BIG; else desired_endian = BFD_ENDIAN_LITTLE; /* See if the target has the wrong endianness. This should not happen if the linker script has provided big and little endian alternatives, but some scrips don't do this. */ if (target->byteorder != desired_endian) { /* If it does, then see if the target provides an alternative with the correct endianness. */ if (target->alternative_target != NULL && (target->alternative_target->byteorder == desired_endian)) output_target = target->alternative_target->name; else { /* Try to find a target as similar as possible to the default target, but which has the desired endian characteristic. */ (void) bfd_search_for_target (closest_target_match, (PTR) target); /* Oh dear - we could not find any targets that satisfy our requirements. */ if (winner == NULL) einfo (_("%P: warning: could not find any targets that match endianness requirement\n")); else output_target = winner->name; } } } } output = bfd_openw (name, output_target); if (output == (bfd *) NULL) { if (bfd_get_error () == bfd_error_invalid_target) einfo (_("%P%F: target %s not found\n"), output_target); einfo (_("%P%F: cannot open output file %s: %E\n"), name); } delete_output_file_on_failure = true; #if 0 output->flags |= D_PAGED; #endif if (! bfd_set_format (output, bfd_object)) einfo (_("%P%F:%s: can not make object file: %E\n"), name); if (! bfd_set_arch_mach (output, ldfile_output_architecture, ldfile_output_machine)) einfo (_("%P%F:%s: can not set architecture: %E\n"), name); link_info.hash = bfd_link_hash_table_create (output); if (link_info.hash == (struct bfd_link_hash_table *) NULL) einfo (_("%P%F: can not create link hash table: %E\n")); bfd_set_gp_size (output, g_switch_value); return output; } static void ldlang_open_output (statement) lang_statement_union_type *statement; { switch (statement->header.type) { case lang_output_statement_enum: ASSERT (output_bfd == (bfd *) NULL); output_bfd = open_output (statement->output_statement.name); ldemul_set_output_arch (); if (config.magic_demand_paged && !link_info.relocateable) output_bfd->flags |= D_PAGED; else output_bfd->flags &= ~D_PAGED; if (config.text_read_only) output_bfd->flags |= WP_TEXT; else output_bfd->flags &= ~WP_TEXT; if (link_info.traditional_format) output_bfd->flags |= BFD_TRADITIONAL_FORMAT; else output_bfd->flags &= ~BFD_TRADITIONAL_FORMAT; break; case lang_target_statement_enum: current_target = statement->target_statement.target; break; default: break; } } /* Open all the input files. */ static void open_input_bfds (s, force) lang_statement_union_type *s; boolean force; { for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { case lang_constructors_statement_enum: open_input_bfds (constructor_list.head, force); break; case lang_output_section_statement_enum: open_input_bfds (s->output_section_statement.children.head, force); break; case lang_wild_statement_enum: /* Maybe we should load the file's symbols. */ if (s->wild_statement.filename && ! wildcardp (s->wild_statement.filename)) (void) lookup_name (s->wild_statement.filename); open_input_bfds (s->wild_statement.children.head, force); break; case lang_group_statement_enum: { struct bfd_link_hash_entry *undefs; /* We must continually search the entries in the group until no new symbols are added to the list of undefined symbols. */ do { undefs = link_info.hash->undefs_tail; open_input_bfds (s->group_statement.children.head, true); } while (undefs != link_info.hash->undefs_tail); } break; case lang_target_statement_enum: current_target = s->target_statement.target; break; case lang_input_statement_enum: if (s->input_statement.real) { lang_statement_list_type add; s->input_statement.target = current_target; /* If we are being called from within a group, and this is an archive which has already been searched, then force it to be researched unless the whole archive has been loaded already. */ if (force && !s->input_statement.whole_archive && s->input_statement.loaded && bfd_check_format (s->input_statement.the_bfd, bfd_archive)) s->input_statement.loaded = false; lang_list_init (&add); if (! load_symbols (&s->input_statement, &add)) config.make_executable = false; if (add.head != NULL) { *add.tail = s->header.next; s->header.next = add.head; } } break; default: break; } } } /* If there are [COMMONS] statements, put a wild one into the bss section. */ static void lang_reasonable_defaults () { #if 0 lang_output_section_statement_lookup (".text"); lang_output_section_statement_lookup (".data"); default_common_section = lang_output_section_statement_lookup (".bss"); if (placed_commons == false) { lang_wild_statement_type *new = new_stat (lang_wild_statement, &default_common_section->children); new->section_name = "COMMON"; new->filename = (char *) NULL; lang_list_init (&new->children); } #endif } /* Add the supplied name to the symbol table as an undefined reference. This is a two step process as the symbol table doesn't even exist at the time the ld command line is processed. First we put the name on a list, then, once the output file has been opened, transfer the name to the symbol table. */ typedef struct ldlang_undef_chain_list { struct ldlang_undef_chain_list *next; char *name; } ldlang_undef_chain_list_type; static ldlang_undef_chain_list_type *ldlang_undef_chain_list_head; void ldlang_add_undef (name) const char *const name; { ldlang_undef_chain_list_type *new = ((ldlang_undef_chain_list_type *) stat_alloc (sizeof (ldlang_undef_chain_list_type))); new->next = ldlang_undef_chain_list_head; ldlang_undef_chain_list_head = new; new->name = xstrdup (name); if (output_bfd != NULL) insert_undefined (new->name); } /* Insert NAME as undefined in the symbol table. */ static void insert_undefined (name) const char *name; { struct bfd_link_hash_entry *h; h = bfd_link_hash_lookup (link_info.hash, name, true, false, true); if (h == (struct bfd_link_hash_entry *) NULL) einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new) { h->type = bfd_link_hash_undefined; h->u.undef.abfd = NULL; bfd_link_add_undef (link_info.hash, h); } } /* Run through the list of undefineds created above and place them into the linker hash table as undefined symbols belonging to the script file. */ static void lang_place_undefineds () { ldlang_undef_chain_list_type *ptr; for (ptr = ldlang_undef_chain_list_head; ptr != (ldlang_undef_chain_list_type *) NULL; ptr = ptr->next) { insert_undefined (ptr->name); } } /* Open input files and attatch to output sections. */ static void map_input_to_output_sections (s, target, output_section_statement) lang_statement_union_type *s; const char *target; lang_output_section_statement_type *output_section_statement; { for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { case lang_wild_statement_enum: wild (&s->wild_statement, target, output_section_statement); break; case lang_constructors_statement_enum: map_input_to_output_sections (constructor_list.head, target, output_section_statement); break; case lang_output_section_statement_enum: map_input_to_output_sections (s->output_section_statement.children.head, target, &s->output_section_statement); break; case lang_output_statement_enum: break; case lang_target_statement_enum: target = s->target_statement.target; break; case lang_group_statement_enum: map_input_to_output_sections (s->group_statement.children.head, target, output_section_statement); break; case lang_fill_statement_enum: case lang_input_section_enum: case lang_object_symbols_statement_enum: case lang_data_statement_enum: case lang_reloc_statement_enum: case lang_padding_statement_enum: case lang_input_statement_enum: if (output_section_statement != NULL && output_section_statement->bfd_section == NULL) init_os (output_section_statement); break; case lang_assignment_statement_enum: if (output_section_statement != NULL && output_section_statement->bfd_section == NULL) init_os (output_section_statement); /* Make sure that any sections mentioned in the assignment are initialized. */ exp_init_os (s->assignment_statement.exp); break; case lang_afile_asection_pair_statement_enum: FAIL (); break; case lang_address_statement_enum: /* Mark the specified section with the supplied address. */ { lang_output_section_statement_type *os = lang_output_section_statement_lookup (s->address_statement.section_name); if (os->bfd_section == NULL) init_os (os); os->addr_tree = s->address_statement.address; } break; } } } static void print_output_section_statement (output_section_statement) lang_output_section_statement_type *output_section_statement; { asection *section = output_section_statement->bfd_section; int len; if (output_section_statement != abs_output_section) { minfo ("\n%s", output_section_statement->name); if (section != NULL) { print_dot = section->vma; len = strlen (output_section_statement->name); if (len >= SECTION_NAME_MAP_LENGTH - 1) { print_nl (); len = 0; } while (len < SECTION_NAME_MAP_LENGTH) { print_space (); ++len; } minfo ("0x%V %W", section->vma, section->_raw_size); if (output_section_statement->load_base != NULL) { bfd_vma addr; addr = exp_get_abs_int (output_section_statement->load_base, 0, "load base", lang_final_phase_enum); minfo (_(" load address 0x%V"), addr); } } print_nl (); } print_statement_list (output_section_statement->children.head, output_section_statement); } static void print_assignment (assignment, output_section) lang_assignment_statement_type *assignment; lang_output_section_statement_type *output_section; { int i; etree_value_type result; for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++) print_space (); result = exp_fold_tree (assignment->exp->assign.src, output_section, lang_final_phase_enum, print_dot, &print_dot); if (result.valid_p) minfo ("0x%V", result.value + result.section->bfd_section->vma); else { minfo ("*undef* "); #ifdef BFD64 minfo (" "); #endif } minfo (" "); exp_print_tree (assignment->exp); print_nl (); } static void print_input_statement (statm) lang_input_statement_type *statm; { if (statm->filename != (char *) NULL) { fprintf (config.map_file, "LOAD %s\n", statm->filename); } } /* Print all symbols defined in a particular section. This is called via bfd_link_hash_traverse. */ static boolean print_one_symbol (hash_entry, ptr) struct bfd_link_hash_entry *hash_entry; PTR ptr; { asection *sec = (asection *) ptr; if ((hash_entry->type == bfd_link_hash_defined || hash_entry->type == bfd_link_hash_defweak) && sec == hash_entry->u.def.section) { int i; for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++) print_space (); minfo ("0x%V ", (hash_entry->u.def.value + hash_entry->u.def.section->output_offset + hash_entry->u.def.section->output_section->vma)); minfo (" %T\n", hash_entry->root.string); } return true; } /* Print information about an input section to the map file. */ static void print_input_section (in) lang_input_section_type *in; { asection *i = in->section; bfd_size_type size = i->_cooked_size != 0 ? i->_cooked_size : i->_raw_size; unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); if (size != 0) { print_space (); minfo ("%s", i->name); if (i->output_section != NULL) { int len; len = 1 + strlen (i->name); if (len >= SECTION_NAME_MAP_LENGTH - 1) { print_nl (); len = 0; } while (len < SECTION_NAME_MAP_LENGTH) { print_space (); ++len; } minfo ("0x%V %W %B\n", i->output_section->vma + i->output_offset, size / opb, i->owner); if (i->_cooked_size != 0 && i->_cooked_size != i->_raw_size) { len = SECTION_NAME_MAP_LENGTH + 3; #ifdef BFD64 len += 16; #else len += 8; #endif while (len > 0) { print_space (); --len; } minfo (_("%W (size before relaxing)\n"), i->_raw_size); } bfd_link_hash_traverse (link_info.hash, print_one_symbol, (PTR) i); print_dot = i->output_section->vma + i->output_offset + size / opb; } } } static void print_fill_statement (fill) lang_fill_statement_type *fill; { fprintf (config.map_file, " FILL mask 0x%x\n", fill->fill); } static void print_data_statement (data) lang_data_statement_type *data; { int i; bfd_vma addr; bfd_size_type size; const char *name; unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++) print_space (); addr = data->output_vma; if (data->output_section != NULL) addr += data->output_section->vma; switch (data->type) { default: abort (); case BYTE: size = BYTE_SIZE; name = "BYTE"; break; case SHORT: size = SHORT_SIZE; name = "SHORT"; break; case LONG: size = LONG_SIZE; name = "LONG"; break; case QUAD: size = QUAD_SIZE; name = "QUAD"; break; case SQUAD: size = QUAD_SIZE; name = "SQUAD"; break; } minfo ("0x%V %W %s 0x%v", addr, size, name, data->value); if (data->exp->type.node_class != etree_value) { print_space (); exp_print_tree (data->exp); } print_nl (); print_dot = addr + size / opb; } /* Print an address statement. These are generated by options like -Ttext. */ static void print_address_statement (address) lang_address_statement_type *address; { minfo (_("Address of section %s set to "), address->section_name); exp_print_tree (address->address); print_nl (); } /* Print a reloc statement. */ static void print_reloc_statement (reloc) lang_reloc_statement_type *reloc; { int i; bfd_vma addr; bfd_size_type size; unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++) print_space (); addr = reloc->output_vma; if (reloc->output_section != NULL) addr += reloc->output_section->vma; size = bfd_get_reloc_size (reloc->howto); minfo ("0x%V %W RELOC %s ", addr, size, reloc->howto->name); if (reloc->name != NULL) minfo ("%s+", reloc->name); else minfo ("%s+", reloc->section->name); exp_print_tree (reloc->addend_exp); print_nl (); print_dot = addr + size / opb; } static void print_padding_statement (s) lang_padding_statement_type *s; { int len; bfd_vma addr; unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); minfo (" *fill*"); len = sizeof " *fill*" - 1; while (len < SECTION_NAME_MAP_LENGTH) { print_space (); ++len; } addr = s->output_offset; if (s->output_section != NULL) addr += s->output_section->vma; minfo ("0x%V %W", addr, s->size); if (s->fill != 0) minfo (" %u", s->fill); print_nl (); print_dot = addr + s->size / opb; } static void print_wild_statement (w, os) lang_wild_statement_type *w; lang_output_section_statement_type *os; { struct wildcard_list *sec; print_space (); if (w->filenames_sorted) minfo ("SORT("); if (w->filename != NULL) minfo ("%s", w->filename); else minfo ("*"); if (w->filenames_sorted) minfo (")"); minfo ("("); for (sec = w->section_list; sec; sec = sec->next) { if (sec->spec.sorted) minfo ("SORT("); if (sec->spec.exclude_name_list != NULL) { name_list *tmp; - minfo ("EXCLUDE_FILE ( %s", sec->spec.exclude_name_list->name); + minfo ("EXCLUDE_FILE(%s", sec->spec.exclude_name_list->name); for (tmp = sec->spec.exclude_name_list->next; tmp; tmp = tmp->next) - minfo (", %s", tmp->name); - minfo (")"); + minfo (" %s", tmp->name); + minfo (") "); } if (sec->spec.name != NULL) minfo ("%s", sec->spec.name); else minfo ("*"); if (sec->spec.sorted) minfo (")"); + if (sec->next) + minfo (" "); } minfo (")"); print_nl (); print_statement_list (w->children.head, os); } /* Print a group statement. */ static void print_group (s, os) lang_group_statement_type *s; lang_output_section_statement_type *os; { fprintf (config.map_file, "START GROUP\n"); print_statement_list (s->children.head, os); fprintf (config.map_file, "END GROUP\n"); } /* Print the list of statements in S. This can be called for any statement type. */ static void print_statement_list (s, os) lang_statement_union_type *s; lang_output_section_statement_type *os; { while (s != NULL) { print_statement (s, os); s = s->header.next; } } /* Print the first statement in statement list S. This can be called for any statement type. */ static void print_statement (s, os) lang_statement_union_type *s; lang_output_section_statement_type *os; { switch (s->header.type) { default: fprintf (config.map_file, _("Fail with %d\n"), s->header.type); FAIL (); break; case lang_constructors_statement_enum: if (constructor_list.head != NULL) { if (constructors_sorted) minfo (" SORT (CONSTRUCTORS)\n"); else minfo (" CONSTRUCTORS\n"); print_statement_list (constructor_list.head, os); } break; case lang_wild_statement_enum: print_wild_statement (&s->wild_statement, os); break; case lang_address_statement_enum: print_address_statement (&s->address_statement); break; case lang_object_symbols_statement_enum: minfo (" CREATE_OBJECT_SYMBOLS\n"); break; case lang_fill_statement_enum: print_fill_statement (&s->fill_statement); break; case lang_data_statement_enum: print_data_statement (&s->data_statement); break; case lang_reloc_statement_enum: print_reloc_statement (&s->reloc_statement); break; case lang_input_section_enum: print_input_section (&s->input_section); break; case lang_padding_statement_enum: print_padding_statement (&s->padding_statement); break; case lang_output_section_statement_enum: print_output_section_statement (&s->output_section_statement); break; case lang_assignment_statement_enum: print_assignment (&s->assignment_statement, os); break; case lang_target_statement_enum: fprintf (config.map_file, "TARGET(%s)\n", s->target_statement.target); break; case lang_output_statement_enum: minfo ("OUTPUT(%s", s->output_statement.name); if (output_target != NULL) minfo (" %s", output_target); minfo (")\n"); break; case lang_input_statement_enum: print_input_statement (&s->input_statement); break; case lang_group_statement_enum: print_group (&s->group_statement, os); break; case lang_afile_asection_pair_statement_enum: FAIL (); break; } } static void print_statements () { print_statement_list (statement_list.head, abs_output_section); } /* Print the first N statements in statement list S to STDERR. If N == 0, nothing is printed. If N < 0, the entire list is printed. Intended to be called from GDB. */ void dprint_statement (s, n) lang_statement_union_type *s; int n; { FILE *map_save = config.map_file; config.map_file = stderr; if (n < 0) print_statement_list (s, abs_output_section); else { while (s && --n >= 0) { print_statement (s, abs_output_section); s = s->header.next; } } config.map_file = map_save; } static void insert_pad (ptr, fill, alignment_needed, output_section, dot) lang_statement_union_type **ptr; fill_type fill; unsigned int alignment_needed; asection *output_section; bfd_vma dot; { lang_statement_union_type *pad; pad = ((lang_statement_union_type *) ((char *) ptr - offsetof (lang_statement_union_type, header.next))); if (ptr != &statement_list.head && pad->header.type == lang_padding_statement_enum && pad->padding_statement.output_section == output_section) { /* Use the existing pad statement. The above test on output section is probably redundant, but it doesn't hurt to check. */ } else { /* Make a new padding statement, linked into existing chain. */ pad = ((lang_statement_union_type *) stat_alloc (sizeof (lang_padding_statement_type))); pad->header.next = *ptr; *ptr = pad; pad->header.type = lang_padding_statement_enum; pad->padding_statement.output_section = output_section; pad->padding_statement.fill = fill; } pad->padding_statement.output_offset = dot - output_section->vma; pad->padding_statement.size = alignment_needed; output_section->_raw_size += alignment_needed; } /* Work out how much this section will move the dot point. */ static bfd_vma size_input_section (this_ptr, output_section_statement, fill, dot) lang_statement_union_type **this_ptr; lang_output_section_statement_type *output_section_statement; fill_type fill; bfd_vma dot; { lang_input_section_type *is = &((*this_ptr)->input_section); asection *i = is->section; if (is->ifile->just_syms_flag == false) { unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); unsigned int alignment_needed; asection *o; /* Align this section first to the input sections requirement, then to the output section's requirement. If this alignment is greater than any seen before, then record it too. Perform the alignment by inserting a magic 'padding' statement. */ if (output_section_statement->subsection_alignment != -1) i->alignment_power = output_section_statement->subsection_alignment; o = output_section_statement->bfd_section; if (o->alignment_power < i->alignment_power) o->alignment_power = i->alignment_power; alignment_needed = align_power (dot, i->alignment_power) - dot; if (alignment_needed != 0) { insert_pad (this_ptr, fill, alignment_needed * opb, o, dot); dot += alignment_needed; } /* Remember where in the output section this input section goes. */ i->output_offset = dot - o->vma; /* Mark how big the output section must be to contain this now. */ if (i->_cooked_size != 0) dot += i->_cooked_size / opb; else dot += i->_raw_size / opb; o->_raw_size = (dot - o->vma) * opb; } else { i->output_offset = i->vma - output_section_statement->bfd_section->vma; } return dot; } #define IGNORE_SECTION(bfd, s) \ (((bfd_get_section_flags (bfd, s) & (SEC_ALLOC | SEC_LOAD)) \ != (SEC_ALLOC | SEC_LOAD)) \ || bfd_section_size (bfd, s) == 0) /* Check to see if any allocated sections overlap with other allocated sections. This can happen when the linker script specifically specifies the output section addresses of the two sections. */ static void lang_check_section_addresses () { asection *s; unsigned opb = bfd_octets_per_byte (output_bfd); /* Scan all sections in the output list. */ for (s = output_bfd->sections; s != NULL; s = s->next) { asection *os; /* Ignore sections which are not loaded or which have no contents. */ if (IGNORE_SECTION (output_bfd, s)) continue; /* Once we reach section 's' stop our seach. This prevents two warning messages from being produced, one for 'section A overlaps section B' and one for 'section B overlaps section A'. */ for (os = output_bfd->sections; os != s; os = os->next) { bfd_vma s_start; bfd_vma s_end; bfd_vma os_start; bfd_vma os_end; /* Only consider loadable sections with real contents. */ if (IGNORE_SECTION (output_bfd, os)) continue; /* We must check the sections' LMA addresses not their VMA addresses because overlay sections can have overlapping VMAs but they must have distinct LMAs. */ s_start = bfd_section_lma (output_bfd, s); os_start = bfd_section_lma (output_bfd, os); s_end = s_start + bfd_section_size (output_bfd, s) / opb - 1; os_end = os_start + bfd_section_size (output_bfd, os) / opb - 1; /* Look for an overlap. */ if ((s_end < os_start) || (s_start > os_end)) continue; einfo ( _("%X%P: section %s [%V -> %V] overlaps section %s [%V -> %V]\n"), s->name, s_start, s_end, os->name, os_start, os_end); /* Once we have found one overlap for this section, stop looking for others. */ break; } } } /* Make sure the new address is within the region. We explicitly permit the current address to be at the exact end of the region when the address is non-zero, in case the region is at the end of addressable memory and the calculation wraps around. */ static void os_region_check (os, region, tree, base) lang_output_section_statement_type *os; struct memory_region_struct *region; etree_type *tree; bfd_vma base; { if ((region->current < region->origin || (region->current - region->origin > region->length)) && ((region->current != region->origin + region->length) || base == 0)) { if (tree != (etree_type *) NULL) { einfo (_("%X%P: address 0x%v of %B section %s is not within region %s\n"), region->current, os->bfd_section->owner, os->bfd_section->name, region->name); } else { einfo (_("%X%P: region %s is full (%B section %s)\n"), region->name, os->bfd_section->owner, os->bfd_section->name); } /* Reset the region pointer. */ region->current = region->origin; } } /* Set the sizes for all the output sections. */ bfd_vma lang_size_sections (s, output_section_statement, prev, fill, dot, relax) lang_statement_union_type *s; lang_output_section_statement_type *output_section_statement; lang_statement_union_type **prev; fill_type fill; bfd_vma dot; boolean *relax; { unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); /* Size up the sections from their constituent parts. */ for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { case lang_output_section_statement_enum: { bfd_vma after; lang_output_section_statement_type *os; os = &s->output_section_statement; if (os->bfd_section == NULL) /* This section was never actually created. */ break; /* If this is a COFF shared library section, use the size and address from the input section. FIXME: This is COFF specific; it would be cleaner if there were some other way to do this, but nothing simple comes to mind. */ if ((os->bfd_section->flags & SEC_COFF_SHARED_LIBRARY) != 0) { asection *input; if (os->children.head == NULL || os->children.head->header.next != NULL || os->children.head->header.type != lang_input_section_enum) einfo (_("%P%X: Internal error on COFF shared library section %s\n"), os->name); input = os->children.head->input_section.section; bfd_set_section_vma (os->bfd_section->owner, os->bfd_section, bfd_section_vma (input->owner, input)); os->bfd_section->_raw_size = input->_raw_size; break; } if (bfd_is_abs_section (os->bfd_section)) { /* No matter what happens, an abs section starts at zero. */ ASSERT (os->bfd_section->vma == 0); } else { if (os->addr_tree == (etree_type *) NULL) { /* No address specified for this section, get one from the region specification. */ if (os->region == (lang_memory_region_type *) NULL || (((bfd_get_section_flags (output_bfd, os->bfd_section) & (SEC_ALLOC | SEC_LOAD)) != 0) && os->region->name[0] == '*' && strcmp (os->region->name, "*default*") == 0)) { os->region = lang_memory_default (os->bfd_section); } /* If a loadable section is using the default memory region, and some non default memory regions were defined, issue a warning. */ if ((bfd_get_section_flags (output_bfd, os->bfd_section) & (SEC_ALLOC | SEC_LOAD)) != 0 && (bfd_get_section_flags (output_bfd, os->bfd_section) & SEC_NEVER_LOAD) == 0 && ! link_info.relocateable && strcmp (os->region->name, "*default*") == 0 && lang_memory_region_list != NULL && (strcmp (lang_memory_region_list->name, "*default*") != 0 || lang_memory_region_list->next != NULL)) einfo (_("%P: warning: no memory region specified for section `%s'\n"), bfd_get_section_name (output_bfd, os->bfd_section)); dot = os->region->current; if (os->section_alignment == -1) { bfd_vma olddot; olddot = dot; dot = align_power (dot, os->bfd_section->alignment_power); if (dot != olddot && config.warn_section_align) einfo (_("%P: warning: changing start of section %s by %u bytes\n"), os->name, (unsigned int) (dot - olddot)); } } else { etree_value_type r; r = exp_fold_tree (os->addr_tree, abs_output_section, lang_allocating_phase_enum, dot, &dot); if (r.valid_p == false) { einfo (_("%F%S: non constant address expression for section %s\n"), os->name); } dot = r.value + r.section->bfd_section->vma; } /* The section starts here. First, align to what the section needs. */ if (os->section_alignment != -1) dot = align_power (dot, os->section_alignment); bfd_set_section_vma (0, os->bfd_section, dot); os->bfd_section->output_offset = 0; } lang_size_sections (os->children.head, os, &os->children.head, os->fill, dot, relax); /* Put the section within the requested block size, or align at the block boundary. */ after = ALIGN_N (os->bfd_section->vma + os->bfd_section->_raw_size / opb, /* The coercion here is important, see ld.h. */ (bfd_vma) os->block_value); if (bfd_is_abs_section (os->bfd_section)) ASSERT (after == os->bfd_section->vma); else os->bfd_section->_raw_size = (after - os->bfd_section->vma) * opb; dot = os->bfd_section->vma + os->bfd_section->_raw_size / opb; os->processed = true; /* Update dot in the region ? We only do this if the section is going to be allocated, since unallocated sections do not contribute to the region's overall size in memory. If the SEC_NEVER_LOAD bit is not set, it will affect the addresses of sections after it. We have to update dot. */ if (os->region != (lang_memory_region_type *) NULL && ((bfd_get_section_flags (output_bfd, os->bfd_section) & SEC_NEVER_LOAD) == 0 || (bfd_get_section_flags (output_bfd, os->bfd_section) & (SEC_ALLOC | SEC_LOAD)))) { os->region->current = dot; /* Make sure the new address is within the region. */ os_region_check (os, os->region, os->addr_tree, os->bfd_section->vma); /* If there's no load address specified, use the run region as the load region. */ if (os->lma_region == NULL && os->load_base == NULL) os->lma_region = os->region; if (os->lma_region != NULL) { if (os->load_base != NULL) { einfo (_("%X%P: use an absolute load address or a load memory region, not both\n")); } else { /* Don't allocate twice. */ if (os->lma_region != os->region) { /* Set load_base, which will be handled later. */ os->load_base = exp_intop (os->lma_region->current); os->lma_region->current += os->bfd_section->_raw_size / opb; os_region_check (os, os->lma_region, NULL, os->bfd_section->lma); } } } } } break; case lang_constructors_statement_enum: dot = lang_size_sections (constructor_list.head, output_section_statement, &s->wild_statement.children.head, fill, dot, relax); break; case lang_data_statement_enum: { unsigned int size = 0; s->data_statement.output_vma = dot - output_section_statement->bfd_section->vma; s->data_statement.output_section = output_section_statement->bfd_section; switch (s->data_statement.type) { default: abort (); case QUAD: case SQUAD: size = QUAD_SIZE; break; case LONG: size = LONG_SIZE; break; case SHORT: size = SHORT_SIZE; break; case BYTE: size = BYTE_SIZE; break; } if (size < opb) size = opb; dot += size / opb; output_section_statement->bfd_section->_raw_size += size; /* The output section gets contents, and then we inspect for any flags set in the input script which override any ALLOC. */ output_section_statement->bfd_section->flags |= SEC_HAS_CONTENTS; if (!(output_section_statement->flags & SEC_NEVER_LOAD)) { output_section_statement->bfd_section->flags |= SEC_ALLOC | SEC_LOAD; } } break; case lang_reloc_statement_enum: { int size; s->reloc_statement.output_vma = dot - output_section_statement->bfd_section->vma; s->reloc_statement.output_section = output_section_statement->bfd_section; size = bfd_get_reloc_size (s->reloc_statement.howto); dot += size / opb; output_section_statement->bfd_section->_raw_size += size; } break; case lang_wild_statement_enum: dot = lang_size_sections (s->wild_statement.children.head, output_section_statement, &s->wild_statement.children.head, fill, dot, relax); break; case lang_object_symbols_statement_enum: link_info.create_object_symbols_section = output_section_statement->bfd_section; break; case lang_output_statement_enum: case lang_target_statement_enum: break; case lang_input_section_enum: { asection *i; i = (*prev)->input_section.section; if (! relax) { if (i->_cooked_size == 0) i->_cooked_size = i->_raw_size; } else { boolean again; if (! bfd_relax_section (i->owner, i, &link_info, &again)) einfo (_("%P%F: can't relax section: %E\n")); if (again) *relax = true; } dot = size_input_section (prev, output_section_statement, output_section_statement->fill, dot); } break; case lang_input_statement_enum: break; case lang_fill_statement_enum: s->fill_statement.output_section = output_section_statement->bfd_section; fill = s->fill_statement.fill; break; case lang_assignment_statement_enum: { bfd_vma newdot = dot; exp_fold_tree (s->assignment_statement.exp, output_section_statement, lang_allocating_phase_enum, dot, &newdot); if (newdot != dot) { if (output_section_statement == abs_output_section) { /* If we don't have an output section, then just adjust the default memory address. */ lang_memory_region_lookup ("*default*")->current = newdot; } else { /* Insert a pad after this statement. We can't put the pad before when relaxing, in case the assignment references dot. */ insert_pad (&s->header.next, fill, (newdot - dot) * opb, output_section_statement->bfd_section, dot); /* Don't neuter the pad below when relaxing. */ s = s->header.next; } dot = newdot; } } break; case lang_padding_statement_enum: /* If this is the first time lang_size_sections is called, we won't have any padding statements. If this is the second or later passes when relaxing, we should allow padding to shrink. If padding is needed on this pass, it will be added back in. */ s->padding_statement.size = 0; /* Make sure output_offset is valid. If relaxation shrinks the section and this pad isn't needed, it's possible to have output_offset larger than the final size of the section. bfd_set_section_contents will complain even for a pad size of zero. */ s->padding_statement.output_offset = dot - output_section_statement->bfd_section->vma; break; case lang_group_statement_enum: dot = lang_size_sections (s->group_statement.children.head, output_section_statement, &s->group_statement.children.head, fill, dot, relax); break; default: FAIL (); break; /* We can only get here when relaxing is turned on. */ case lang_address_statement_enum: break; } prev = &s->header.next; } return dot; } bfd_vma lang_do_assignments (s, output_section_statement, fill, dot) lang_statement_union_type *s; lang_output_section_statement_type *output_section_statement; fill_type fill; bfd_vma dot; { unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { case lang_constructors_statement_enum: dot = lang_do_assignments (constructor_list.head, output_section_statement, fill, dot); break; case lang_output_section_statement_enum: { lang_output_section_statement_type *os; os = &(s->output_section_statement); if (os->bfd_section != NULL) { dot = os->bfd_section->vma; (void) lang_do_assignments (os->children.head, os, os->fill, dot); dot = os->bfd_section->vma + os->bfd_section->_raw_size / opb; } if (os->load_base) { /* If nothing has been placed into the output section then it won't have a bfd_section. */ if (os->bfd_section) { os->bfd_section->lma = exp_get_abs_int (os->load_base, 0, "load base", lang_final_phase_enum); } } } break; case lang_wild_statement_enum: dot = lang_do_assignments (s->wild_statement.children.head, output_section_statement, fill, dot); break; case lang_object_symbols_statement_enum: case lang_output_statement_enum: case lang_target_statement_enum: #if 0 case lang_common_statement_enum: #endif break; case lang_data_statement_enum: { etree_value_type value; value = exp_fold_tree (s->data_statement.exp, abs_output_section, lang_final_phase_enum, dot, &dot); s->data_statement.value = value.value; if (value.valid_p == false) einfo (_("%F%P: invalid data statement\n")); } { unsigned int size; switch (s->data_statement.type) { default: abort (); case QUAD: case SQUAD: size = QUAD_SIZE; break; case LONG: size = LONG_SIZE; break; case SHORT: size = SHORT_SIZE; break; case BYTE: size = BYTE_SIZE; break; } if (size < opb) size = opb; dot += size / opb; } break; case lang_reloc_statement_enum: { etree_value_type value; value = exp_fold_tree (s->reloc_statement.addend_exp, abs_output_section, lang_final_phase_enum, dot, &dot); s->reloc_statement.addend_value = value.value; if (value.valid_p == false) einfo (_("%F%P: invalid reloc statement\n")); } dot += bfd_get_reloc_size (s->reloc_statement.howto) / opb; break; case lang_input_section_enum: { asection *in = s->input_section.section; if (in->_cooked_size != 0) dot += in->_cooked_size / opb; else dot += in->_raw_size / opb; } break; case lang_input_statement_enum: break; case lang_fill_statement_enum: fill = s->fill_statement.fill; break; case lang_assignment_statement_enum: { exp_fold_tree (s->assignment_statement.exp, output_section_statement, lang_final_phase_enum, dot, &dot); } break; case lang_padding_statement_enum: dot += s->padding_statement.size / opb; break; case lang_group_statement_enum: dot = lang_do_assignments (s->group_statement.children.head, output_section_statement, fill, dot); break; default: FAIL (); break; case lang_address_statement_enum: break; } } return dot; } /* Fix any .startof. or .sizeof. symbols. When the assemblers see the operator .startof. (section_name), it produces an undefined symbol .startof.section_name. Similarly, when it sees .sizeof. (section_name), it produces an undefined symbol .sizeof.section_name. For all the output sections, we look for such symbols, and set them to the correct value. */ static void lang_set_startof () { asection *s; if (link_info.relocateable) return; for (s = output_bfd->sections; s != NULL; s = s->next) { const char *secname; char *buf; struct bfd_link_hash_entry *h; secname = bfd_get_section_name (output_bfd, s); buf = xmalloc (10 + strlen (secname)); sprintf (buf, ".startof.%s", secname); h = bfd_link_hash_lookup (link_info.hash, buf, false, false, true); if (h != NULL && h->type == bfd_link_hash_undefined) { h->type = bfd_link_hash_defined; h->u.def.value = bfd_get_section_vma (output_bfd, s); h->u.def.section = bfd_abs_section_ptr; } sprintf (buf, ".sizeof.%s", secname); h = bfd_link_hash_lookup (link_info.hash, buf, false, false, true); if (h != NULL && h->type == bfd_link_hash_undefined) { unsigned opb; opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); h->type = bfd_link_hash_defined; if (s->_cooked_size != 0) h->u.def.value = s->_cooked_size / opb; else h->u.def.value = s->_raw_size / opb; h->u.def.section = bfd_abs_section_ptr; } free (buf); } } static void lang_finish () { struct bfd_link_hash_entry *h; boolean warn; if (link_info.relocateable || link_info.shared) warn = false; else warn = true; if (entry_symbol == (char *) NULL) { /* No entry has been specified. Look for start, but don't warn if we don't find it. */ entry_symbol = "start"; warn = false; } h = bfd_link_hash_lookup (link_info.hash, entry_symbol, false, false, true); if (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak) && h->u.def.section->output_section != NULL) { bfd_vma val; val = (h->u.def.value + bfd_get_section_vma (output_bfd, h->u.def.section->output_section) + h->u.def.section->output_offset); if (! bfd_set_start_address (output_bfd, val)) einfo (_("%P%F:%s: can't set start address\n"), entry_symbol); } else { bfd_vma val; const char *send; /* We couldn't find the entry symbol. Try parsing it as a number. */ val = bfd_scan_vma (entry_symbol, &send, 0); if (*send == '\0') { if (! bfd_set_start_address (output_bfd, val)) einfo (_("%P%F: can't set start address\n")); } else { asection *ts; /* Can't find the entry symbol, and it's not a number. Use the first address in the text section. */ ts = bfd_get_section_by_name (output_bfd, entry_section); if (ts != (asection *) NULL) { if (warn) einfo (_("%P: warning: cannot find entry symbol %s; defaulting to %V\n"), entry_symbol, bfd_get_section_vma (output_bfd, ts)); if (! bfd_set_start_address (output_bfd, bfd_get_section_vma (output_bfd, ts))) einfo (_("%P%F: can't set start address\n")); } else { if (warn) einfo (_("%P: warning: cannot find entry symbol %s; not setting start address\n"), entry_symbol); } } } } /* This is a small function used when we want to ignore errors from BFD. */ static void #ifdef ANSI_PROTOTYPES ignore_bfd_errors (const char *s ATTRIBUTE_UNUSED, ...) #else ignore_bfd_errors (s) const char *s ATTRIBUTE_UNUSED; #endif { /* Don't do anything. */ } /* Check that the architecture of all the input files is compatible with the output file. Also call the backend to let it do any other checking that is needed. */ static void lang_check () { lang_statement_union_type *file; bfd *input_bfd; const bfd_arch_info_type *compatible; for (file = file_chain.head; file != (lang_statement_union_type *) NULL; file = file->input_statement.next) { input_bfd = file->input_statement.the_bfd; compatible = bfd_arch_get_compatible (input_bfd, output_bfd); /* In general it is not possible to perform a relocatable link between differing object formats when the input file has relocations, because the relocations in the input format may not have equivalent representations in the output format (and besides BFD does not translate relocs for other link purposes than a final link). */ if ((link_info.relocateable || link_info.emitrelocations) && (compatible == NULL || bfd_get_flavour (input_bfd) != bfd_get_flavour (output_bfd)) && (bfd_get_file_flags (input_bfd) & HAS_RELOC) != 0) { einfo (_("%P%F: Relocatable linking with relocations from format %s (%B) to format %s (%B) is not supported\n"), bfd_get_target (input_bfd), input_bfd, bfd_get_target (output_bfd), output_bfd); /* einfo with %F exits. */ } if (compatible == NULL) { if (command_line.warn_mismatch) einfo (_("%P: warning: %s architecture of input file `%B' is incompatible with %s output\n"), bfd_printable_name (input_bfd), input_bfd, bfd_printable_name (output_bfd)); } else if (bfd_count_sections (input_bfd)) { /* If the input bfd has no contents, it shouldn't set the private data of the output bfd. */ bfd_error_handler_type pfn = NULL; /* If we aren't supposed to warn about mismatched input files, temporarily set the BFD error handler to a function which will do nothing. We still want to call bfd_merge_private_bfd_data, since it may set up information which is needed in the output file. */ if (! command_line.warn_mismatch) pfn = bfd_set_error_handler (ignore_bfd_errors); if (! bfd_merge_private_bfd_data (input_bfd, output_bfd)) { if (command_line.warn_mismatch) einfo (_("%E%X: failed to merge target specific data of file %B\n"), input_bfd); } if (! command_line.warn_mismatch) bfd_set_error_handler (pfn); } } } /* Look through all the global common symbols and attach them to the correct section. The -sort-common command line switch may be used to roughly sort the entries by size. */ static void lang_common () { if (command_line.inhibit_common_definition) return; if (link_info.relocateable && ! command_line.force_common_definition) return; if (! config.sort_common) bfd_link_hash_traverse (link_info.hash, lang_one_common, (PTR) NULL); else { int power; for (power = 4; power >= 0; power--) bfd_link_hash_traverse (link_info.hash, lang_one_common, (PTR) &power); } } /* Place one common symbol in the correct section. */ static boolean lang_one_common (h, info) struct bfd_link_hash_entry *h; PTR info; { unsigned int power_of_two; bfd_vma size; asection *section; unsigned opb = bfd_arch_mach_octets_per_byte (ldfile_output_architecture, ldfile_output_machine); if (h->type != bfd_link_hash_common) return true; size = h->u.c.size; power_of_two = h->u.c.p->alignment_power; if (config.sort_common && power_of_two < (unsigned int) *(int *) info) return true; section = h->u.c.p->section; /* Increase the size of the section. */ section->_cooked_size = ALIGN_N ((section->_cooked_size + opb - 1) / opb, (bfd_size_type) (1 << power_of_two)) * opb; /* Adjust the alignment if necessary. */ if (power_of_two > section->alignment_power) section->alignment_power = power_of_two; /* Change the symbol from common to defined. */ h->type = bfd_link_hash_defined; h->u.def.section = section; h->u.def.value = section->_cooked_size; /* Increase the size of the section. */ section->_cooked_size += size; /* Make sure the section is allocated in memory, and make sure that it is no longer a common section. */ section->flags |= SEC_ALLOC; section->flags &= ~SEC_IS_COMMON; if (config.map_file != NULL) { static boolean header_printed; int len; char *name; char buf[50]; if (! header_printed) { minfo (_("\nAllocating common symbols\n")); minfo (_("Common symbol size file\n\n")); header_printed = true; } name = demangle (h->root.string); minfo ("%s", name); len = strlen (name); free (name); if (len >= 19) { print_nl (); len = 0; } while (len < 20) { print_space (); ++len; } minfo ("0x"); if (size <= 0xffffffff) sprintf (buf, "%lx", (unsigned long) size); else sprintf_vma (buf, size); minfo ("%s", buf); len = strlen (buf); while (len < 16) { print_space (); ++len; } minfo ("%B\n", section->owner); } return true; } /* Run through the input files and ensure that every input section has somewhere to go. If one is found without a destination then create an input request and place it into the statement tree. */ static void lang_place_orphans () { LANG_FOR_EACH_INPUT_STATEMENT (file) { asection *s; for (s = file->the_bfd->sections; s != (asection *) NULL; s = s->next) { if (s->output_section == (asection *) NULL) { /* This section of the file is not attatched, root around for a sensible place for it to go. */ if (file->just_syms_flag) { /* We are only retrieving symbol values from this file. We want the symbols to act as though the values in the file are absolute. */ s->output_section = bfd_abs_section_ptr; s->output_offset = s->vma; } else if (strcmp (s->name, "COMMON") == 0) { /* This is a lonely common section which must have come from an archive. We attach to the section with the wildcard. */ if (! link_info.relocateable || command_line.force_common_definition) { if (default_common_section == NULL) { #if 0 /* This message happens when using the svr3.ifile linker script, so I have disabled it. */ info_msg (_("%P: no [COMMON] command, defaulting to .bss\n")); #endif default_common_section = lang_output_section_statement_lookup (".bss"); } lang_add_section (&default_common_section->children, s, default_common_section, file); } } else if (ldemul_place_orphan (file, s)) ; else { lang_output_section_statement_type *os; os = lang_output_section_statement_lookup (s->name); lang_add_section (&os->children, s, os, file); } } } } } void lang_set_flags (ptr, flags, invert) lang_memory_region_type *ptr; const char *flags; int invert; { flagword *ptr_flags; ptr_flags = invert ? &ptr->not_flags : &ptr->flags; while (*flags) { switch (*flags) { case 'A': case 'a': *ptr_flags |= SEC_ALLOC; break; case 'R': case 'r': *ptr_flags |= SEC_READONLY; break; case 'W': case 'w': *ptr_flags |= SEC_DATA; break; case 'X': case 'x': *ptr_flags |= SEC_CODE; break; case 'L': case 'l': case 'I': case 'i': *ptr_flags |= SEC_LOAD; break; default: einfo (_("%P%F: invalid syntax in flags\n")); break; } flags++; } } /* Call a function on each input file. This function will be called on an archive, but not on the elements. */ void lang_for_each_input_file (func) void (*func) PARAMS ((lang_input_statement_type *)); { lang_input_statement_type *f; for (f = (lang_input_statement_type *) input_file_chain.head; f != NULL; f = (lang_input_statement_type *) f->next_real_file) func (f); } /* Call a function on each file. The function will be called on all the elements of an archive which are included in the link, but will not be called on the archive file itself. */ void lang_for_each_file (func) void (*func) PARAMS ((lang_input_statement_type *)); { LANG_FOR_EACH_INPUT_STATEMENT (f) { func (f); } } #if 0 /* Not used. */ void lang_for_each_input_section (func) void (*func) PARAMS ((bfd *ab, asection *as)); { LANG_FOR_EACH_INPUT_STATEMENT (f) { asection *s; for (s = f->the_bfd->sections; s != (asection *) NULL; s = s->next) { func (f->the_bfd, s); } } } #endif void ldlang_add_file (entry) lang_input_statement_type *entry; { bfd **pp; lang_statement_append (&file_chain, (lang_statement_union_type *) entry, &entry->next); /* The BFD linker needs to have a list of all input BFDs involved in a link. */ ASSERT (entry->the_bfd->link_next == (bfd *) NULL); ASSERT (entry->the_bfd != output_bfd); for (pp = &link_info.input_bfds; *pp != (bfd *) NULL; pp = &(*pp)->link_next) ; *pp = entry->the_bfd; entry->the_bfd->usrdata = (PTR) entry; bfd_set_gp_size (entry->the_bfd, g_switch_value); /* Look through the sections and check for any which should not be included in the link. We need to do this now, so that we can notice when the backend linker tries to report multiple definition errors for symbols which are in sections we aren't going to link. FIXME: It might be better to entirely ignore symbols which are defined in sections which are going to be discarded. This would require modifying the backend linker for each backend which might set the SEC_LINK_ONCE flag. If we do this, we should probably handle SEC_EXCLUDE in the same way. */ bfd_map_over_sections (entry->the_bfd, section_already_linked, (PTR) entry); } void lang_add_output (name, from_script) const char *name; int from_script; { /* Make -o on command line override OUTPUT in script. */ if (had_output_filename == false || !from_script) { output_filename = name; had_output_filename = true; } } static lang_output_section_statement_type *current_section; static int topower (x) int x; { unsigned int i = 1; int l; if (x < 0) return -1; for (l = 0; l < 32; l++) { if (i >= (unsigned int) x) return l; i <<= 1; } return 0; } lang_output_section_statement_type * lang_enter_output_section_statement (output_section_statement_name, address_exp, sectype, block_value, align, subalign, ebase) const char *output_section_statement_name; etree_type *address_exp; enum section_type sectype; bfd_vma block_value; etree_type *align; etree_type *subalign; etree_type *ebase; { lang_output_section_statement_type *os; current_section = os = lang_output_section_statement_lookup (output_section_statement_name); /* Add this statement to tree. */ #if 0 add_statement (lang_output_section_statement_enum, output_section_statement); #endif /* Make next things chain into subchain of this. */ if (os->addr_tree == (etree_type *) NULL) { os->addr_tree = address_exp; } os->sectype = sectype; if (sectype != noload_section) os->flags = SEC_NO_FLAGS; else os->flags = SEC_NEVER_LOAD; os->block_value = block_value ? block_value : 1; stat_ptr = &os->children; os->subsection_alignment = topower (exp_get_value_int (subalign, -1, "subsection alignment", 0)); os->section_alignment = topower (exp_get_value_int (align, -1, "section alignment", 0)); os->load_base = ebase; return os; } void lang_final () { lang_output_statement_type *new = new_stat (lang_output_statement, stat_ptr); new->name = output_filename; } /* Reset the current counters in the regions. */ void lang_reset_memory_regions () { lang_memory_region_type *p = lang_memory_region_list; asection *o; for (p = lang_memory_region_list; p != (lang_memory_region_type *) NULL; p = p->next) { p->old_length = (bfd_size_type) (p->current - p->origin); p->current = p->origin; } for (o = output_bfd->sections; o != NULL; o = o->next) o->_raw_size = 0; } /* If the wild pattern was marked KEEP, the member sections should be as well. */ static void gc_section_callback (ptr, sec, section, file, data) lang_wild_statement_type *ptr; struct wildcard_list *sec ATTRIBUTE_UNUSED; asection *section; lang_input_statement_type *file ATTRIBUTE_UNUSED; PTR data ATTRIBUTE_UNUSED; { if (ptr->keep_sections) section->flags |= SEC_KEEP; } /* Handle a wild statement, marking it against GC. */ static void lang_gc_wild (s) lang_wild_statement_type *s; { walk_wild (s, gc_section_callback, NULL); } /* Iterate over sections marking them against GC. */ static void lang_gc_sections_1 (s) lang_statement_union_type *s; { for (; s != (lang_statement_union_type *) NULL; s = s->header.next) { switch (s->header.type) { case lang_wild_statement_enum: lang_gc_wild (&s->wild_statement); break; case lang_constructors_statement_enum: lang_gc_sections_1 (constructor_list.head); break; case lang_output_section_statement_enum: lang_gc_sections_1 (s->output_section_statement.children.head); break; case lang_group_statement_enum: lang_gc_sections_1 (s->group_statement.children.head); break; default: break; } } } static void lang_gc_sections () { struct bfd_link_hash_entry *h; ldlang_undef_chain_list_type *ulist, fake_list_start; /* Keep all sections so marked in the link script. */ lang_gc_sections_1 (statement_list.head); /* Keep all sections containing symbols undefined on the command-line. Handle the entry symbol at the same time. */ if (entry_symbol != NULL) { fake_list_start.next = ldlang_undef_chain_list_head; fake_list_start.name = (char *) entry_symbol; ulist = &fake_list_start; } else ulist = ldlang_undef_chain_list_head; for (; ulist; ulist = ulist->next) { h = bfd_link_hash_lookup (link_info.hash, ulist->name, false, false, false); if (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak) && ! bfd_is_abs_section (h->u.def.section)) { h->u.def.section->flags |= SEC_KEEP; } } bfd_gc_sections (output_bfd, &link_info); } void lang_process () { lang_reasonable_defaults (); current_target = default_target; /* Open the output file. */ lang_for_each_statement (ldlang_open_output); ldemul_create_output_section_statements (); /* Add to the hash table all undefineds on the command line. */ lang_place_undefineds (); already_linked_table_init (); /* Create a bfd for each input file. */ current_target = default_target; open_input_bfds (statement_list.head, false); ldemul_after_open (); already_linked_table_free (); /* Make sure that we're not mixing architectures. We call this after all the input files have been opened, but before we do any other processing, so that any operations merge_private_bfd_data does on the output file will be known during the rest of the link. */ lang_check (); /* Handle .exports instead of a version script if we're told to do so. */ if (command_line.version_exports_section) lang_do_version_exports_section (); /* Build all sets based on the information gathered from the input files. */ ldctor_build_sets (); /* Remove unreferenced sections if asked to. */ if (command_line.gc_sections) lang_gc_sections (); /* If there were any SEC_MERGE sections, finish their merging, so that section sizes can be computed. This has to be done after GC of sections, so that GCed sections are not merged, but before assigning output sections, since removing whole input sections is hard then. */ bfd_merge_sections (output_bfd, &link_info); /* Size up the common data. */ lang_common (); /* Run through the contours of the script and attach input sections to the correct output sections. */ map_input_to_output_sections (statement_list.head, (char *) NULL, (lang_output_section_statement_type *) NULL); /* Find any sections not attached explicitly and handle them. */ lang_place_orphans (); if (! link_info.relocateable) { /* Look for a text section and set the readonly attribute in it. */ asection *found = bfd_get_section_by_name (output_bfd, ".text"); if (found != (asection *) NULL) { if (config.text_read_only) found->flags |= SEC_READONLY; else found->flags &= ~SEC_READONLY; } } /* Do anything special before sizing sections. This is where ELF and other back-ends size dynamic sections. */ ldemul_before_allocation (); /* We must record the program headers before we try to fix the section positions, since they will affect SIZEOF_HEADERS. */ lang_record_phdrs (); /* Size up the sections. */ lang_size_sections (statement_list.head, abs_output_section, &statement_list.head, 0, (bfd_vma) 0, NULL); /* Now run around and relax if we can. */ if (command_line.relax) { /* Keep relaxing until bfd_relax_section gives up. */ boolean relax_again; do { lang_reset_memory_regions (); relax_again = false; /* Note: pe-dll.c does something like this also. If you find you need to change this code, you probably need to change pe-dll.c also. DJ */ /* Do all the assignments with our current guesses as to section sizes. */ lang_do_assignments (statement_list.head, abs_output_section, (fill_type) 0, (bfd_vma) 0); /* Perform another relax pass - this time we know where the globals are, so can make better guess. */ lang_size_sections (statement_list.head, abs_output_section, &(statement_list.head), 0, (bfd_vma) 0, &relax_again); } while (relax_again); } /* See if anything special should be done now we know how big everything is. */ ldemul_after_allocation (); /* Fix any .startof. or .sizeof. symbols. */ lang_set_startof (); /* Do all the assignments, now that we know the final resting places of all the symbols. */ lang_do_assignments (statement_list.head, abs_output_section, (fill_type) 0, (bfd_vma) 0); /* Make sure that the section addresses make sense. */ if (! link_info.relocateable && command_line.check_section_addresses) lang_check_section_addresses (); /* Final stuffs. */ ldemul_finish (); lang_finish (); } /* EXPORTED TO YACC */ void lang_add_wild (filespec, section_list, keep_sections) struct wildcard_spec *filespec; struct wildcard_list *section_list; boolean keep_sections; { struct wildcard_list *curr, *next; lang_wild_statement_type *new; /* Reverse the list as the parser puts it back to front. */ for (curr = section_list, section_list = NULL; curr != NULL; section_list = curr, curr = next) { if (curr->spec.name != NULL && strcmp (curr->spec.name, "COMMON") == 0) placed_commons = true; next = curr->next; curr->next = section_list; } if (filespec != NULL && filespec->name != NULL) { if (strcmp (filespec->name, "*") == 0) filespec->name = NULL; else if (! wildcardp (filespec->name)) lang_has_input_file = true; } new = new_stat (lang_wild_statement, stat_ptr); new->filename = NULL; new->filenames_sorted = false; if (filespec != NULL) { new->filename = filespec->name; new->filenames_sorted = filespec->sorted; } new->section_list = section_list; new->keep_sections = keep_sections; lang_list_init (&new->children); } void lang_section_start (name, address) const char *name; etree_type *address; { lang_address_statement_type *ad; ad = new_stat (lang_address_statement, stat_ptr); ad->section_name = name; ad->address = address; } /* Set the start symbol to NAME. CMDLINE is nonzero if this is called because of a -e argument on the command line, or zero if this is called by ENTRY in a linker script. Command line arguments take precedence. */ void lang_add_entry (name, cmdline) const char *name; boolean cmdline; { if (entry_symbol == NULL || cmdline || ! entry_from_cmdline) { entry_symbol = name; entry_from_cmdline = cmdline; } } void lang_add_target (name) const char *name; { lang_target_statement_type *new = new_stat (lang_target_statement, stat_ptr); new->target = name; } void lang_add_map (name) const char *name; { while (*name) { switch (*name) { case 'F': map_option_f = true; break; } name++; } } void lang_add_fill (exp) int exp; { lang_fill_statement_type *new = new_stat (lang_fill_statement, stat_ptr); new->fill = exp; } void lang_add_data (type, exp) int type; union etree_union *exp; { lang_data_statement_type *new = new_stat (lang_data_statement, stat_ptr); new->exp = exp; new->type = type; } /* Create a new reloc statement. RELOC is the BFD relocation type to generate. HOWTO is the corresponding howto structure (we could look this up, but the caller has already done so). SECTION is the section to generate a reloc against, or NAME is the name of the symbol to generate a reloc against. Exactly one of SECTION and NAME must be NULL. ADDEND is an expression for the addend. */ void lang_add_reloc (reloc, howto, section, name, addend) bfd_reloc_code_real_type reloc; reloc_howto_type *howto; asection *section; const char *name; union etree_union *addend; { lang_reloc_statement_type *p = new_stat (lang_reloc_statement, stat_ptr); p->reloc = reloc; p->howto = howto; p->section = section; p->name = name; p->addend_exp = addend; p->addend_value = 0; p->output_section = NULL; p->output_vma = 0; } lang_assignment_statement_type * lang_add_assignment (exp) etree_type *exp; { lang_assignment_statement_type *new = new_stat (lang_assignment_statement, stat_ptr); new->exp = exp; return new; } void lang_add_attribute (attribute) enum statement_enum attribute; { new_statement (attribute, sizeof (lang_statement_union_type), stat_ptr); } void lang_startup (name) const char *name; { if (startup_file != (char *) NULL) { einfo (_("%P%Fmultiple STARTUP files\n")); } first_file->filename = name; first_file->local_sym_name = name; first_file->real = true; startup_file = name; } void lang_float (maybe) boolean maybe; { lang_float_flag = maybe; } void lang_leave_output_section_statement (fill, memspec, phdrs, lma_memspec) bfd_vma fill; const char *memspec; struct lang_output_section_phdr_list *phdrs; const char *lma_memspec; { current_section->fill = fill; current_section->region = lang_memory_region_lookup (memspec); if (strcmp (lma_memspec, "*default*") != 0) { current_section->lma_region = lang_memory_region_lookup (lma_memspec); /* If no runtime region has been given, but the load region has been, use the load region. */ if (strcmp (memspec, "*default*") == 0) current_section->region = lang_memory_region_lookup (lma_memspec); } current_section->phdrs = phdrs; stat_ptr = &statement_list; } /* Create an absolute symbol with the given name with the value of the address of first byte of the section named. If the symbol already exists, then do nothing. */ void lang_abs_symbol_at_beginning_of (secname, name) const char *secname; const char *name; { struct bfd_link_hash_entry *h; h = bfd_link_hash_lookup (link_info.hash, name, true, true, true); if (h == (struct bfd_link_hash_entry *) NULL) einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new || h->type == bfd_link_hash_undefined) { asection *sec; h->type = bfd_link_hash_defined; sec = bfd_get_section_by_name (output_bfd, secname); if (sec == (asection *) NULL) h->u.def.value = 0; else h->u.def.value = bfd_get_section_vma (output_bfd, sec); h->u.def.section = bfd_abs_section_ptr; } } /* Create an absolute symbol with the given name with the value of the address of the first byte after the end of the section named. If the symbol already exists, then do nothing. */ void lang_abs_symbol_at_end_of (secname, name) const char *secname; const char *name; { struct bfd_link_hash_entry *h; h = bfd_link_hash_lookup (link_info.hash, name, true, true, true); if (h == (struct bfd_link_hash_entry *) NULL) einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n")); if (h->type == bfd_link_hash_new || h->type == bfd_link_hash_undefined) { asection *sec; h->type = bfd_link_hash_defined; sec = bfd_get_section_by_name (output_bfd, secname); if (sec == (asection *) NULL) h->u.def.value = 0; else h->u.def.value = (bfd_get_section_vma (output_bfd, sec) + bfd_section_size (output_bfd, sec) / bfd_octets_per_byte (output_bfd)); h->u.def.section = bfd_abs_section_ptr; } } void lang_statement_append (list, element, field) lang_statement_list_type *list; lang_statement_union_type *element; lang_statement_union_type **field; { *(list->tail) = element; list->tail = field; } /* Set the output format type. -oformat overrides scripts. */ void lang_add_output_format (format, big, little, from_script) const char *format; const char *big; const char *little; int from_script; { if (output_target == NULL || !from_script) { if (command_line.endian == ENDIAN_BIG && big != NULL) format = big; else if (command_line.endian == ENDIAN_LITTLE && little != NULL) format = little; output_target = format; } } /* Enter a group. This creates a new lang_group_statement, and sets stat_ptr to build new statements within the group. */ void lang_enter_group () { lang_group_statement_type *g; g = new_stat (lang_group_statement, stat_ptr); lang_list_init (&g->children); stat_ptr = &g->children; } /* Leave a group. This just resets stat_ptr to start writing to the regular list of statements again. Note that this will not work if groups can occur inside anything else which can adjust stat_ptr, but currently they can't. */ void lang_leave_group () { stat_ptr = &statement_list; } /* Add a new program header. This is called for each entry in a PHDRS command in a linker script. */ void lang_new_phdr (name, type, filehdr, phdrs, at, flags) const char *name; etree_type *type; boolean filehdr; boolean phdrs; etree_type *at; etree_type *flags; { struct lang_phdr *n, **pp; n = (struct lang_phdr *) stat_alloc (sizeof (struct lang_phdr)); n->next = NULL; n->name = name; n->type = exp_get_value_int (type, 0, "program header type", lang_final_phase_enum); n->filehdr = filehdr; n->phdrs = phdrs; n->at = at; n->flags = flags; for (pp = &lang_phdr_list; *pp != NULL; pp = &(*pp)->next) ; *pp = n; } /* Record the program header information in the output BFD. FIXME: We should not be calling an ELF specific function here. */ static void lang_record_phdrs () { unsigned int alc; asection **secs; struct lang_output_section_phdr_list *last; struct lang_phdr *l; lang_statement_union_type *u; alc = 10; secs = (asection **) xmalloc (alc * sizeof (asection *)); last = NULL; for (l = lang_phdr_list; l != NULL; l = l->next) { unsigned int c; flagword flags; bfd_vma at; c = 0; for (u = lang_output_section_statement.head; u != NULL; u = u->output_section_statement.next) { lang_output_section_statement_type *os; struct lang_output_section_phdr_list *pl; os = &u->output_section_statement; pl = os->phdrs; if (pl != NULL) last = pl; else { if (os->sectype == noload_section || os->bfd_section == NULL || (os->bfd_section->flags & SEC_ALLOC) == 0) continue; pl = last; } if (os->bfd_section == NULL) continue; for (; pl != NULL; pl = pl->next) { if (strcmp (pl->name, l->name) == 0) { if (c >= alc) { alc *= 2; secs = ((asection **) xrealloc (secs, alc * sizeof (asection *))); } secs[c] = os->bfd_section; ++c; pl->used = true; } } } if (l->flags == NULL) flags = 0; else flags = exp_get_vma (l->flags, 0, "phdr flags", lang_final_phase_enum); if (l->at == NULL) at = 0; else at = exp_get_vma (l->at, 0, "phdr load address", lang_final_phase_enum); if (! bfd_record_phdr (output_bfd, l->type, l->flags != NULL, flags, l->at != NULL, at, l->filehdr, l->phdrs, c, secs)) einfo (_("%F%P: bfd_record_phdr failed: %E\n")); } free (secs); /* Make sure all the phdr assignments succeeded. */ for (u = lang_output_section_statement.head; u != NULL; u = u->output_section_statement.next) { struct lang_output_section_phdr_list *pl; if (u->output_section_statement.bfd_section == NULL) continue; for (pl = u->output_section_statement.phdrs; pl != NULL; pl = pl->next) if (! pl->used && strcmp (pl->name, "NONE") != 0) einfo (_("%X%P: section `%s' assigned to non-existent phdr `%s'\n"), u->output_section_statement.name, pl->name); } } /* Record a list of sections which may not be cross referenced. */ void lang_add_nocrossref (l) struct lang_nocrossref *l; { struct lang_nocrossrefs *n; n = (struct lang_nocrossrefs *) xmalloc (sizeof *n); n->next = nocrossref_list; n->list = l; nocrossref_list = n; /* Set notice_all so that we get informed about all symbols. */ link_info.notice_all = true; } /* Overlay handling. We handle overlays with some static variables. */ /* The overlay virtual address. */ static etree_type *overlay_vma; /* The overlay load address. */ static etree_type *overlay_lma; /* Whether nocrossrefs is set for this overlay. */ static int overlay_nocrossrefs; /* An expression for the maximum section size seen so far. */ static etree_type *overlay_max; /* A list of all the sections in this overlay. */ struct overlay_list { struct overlay_list *next; lang_output_section_statement_type *os; }; static struct overlay_list *overlay_list; /* Start handling an overlay. */ void lang_enter_overlay (vma_expr, lma_expr, nocrossrefs) etree_type *vma_expr; etree_type *lma_expr; int nocrossrefs; { /* The grammar should prevent nested overlays from occurring. */ ASSERT (overlay_vma == NULL && overlay_lma == NULL && overlay_list == NULL && overlay_max == NULL); overlay_vma = vma_expr; overlay_lma = lma_expr; overlay_nocrossrefs = nocrossrefs; } /* Start a section in an overlay. We handle this by calling lang_enter_output_section_statement with the correct VMA and LMA. */ void lang_enter_overlay_section (name) const char *name; { struct overlay_list *n; etree_type *size; lang_enter_output_section_statement (name, overlay_vma, normal_section, 0, 0, 0, overlay_lma); /* If this is the first section, then base the VMA and LMA of future sections on this one. This will work correctly even if `.' is used in the addresses. */ if (overlay_list == NULL) { overlay_vma = exp_nameop (ADDR, name); overlay_lma = exp_nameop (LOADADDR, name); } /* Remember the section. */ n = (struct overlay_list *) xmalloc (sizeof *n); n->os = current_section; n->next = overlay_list; overlay_list = n; size = exp_nameop (SIZEOF, name); /* Adjust the LMA for the next section. */ overlay_lma = exp_binop ('+', overlay_lma, size); /* Arrange to work out the maximum section end address. */ if (overlay_max == NULL) overlay_max = size; else overlay_max = exp_binop (MAX_K, overlay_max, size); } /* Finish a section in an overlay. There isn't any special to do here. */ void lang_leave_overlay_section (fill, phdrs) bfd_vma fill; struct lang_output_section_phdr_list *phdrs; { const char *name; char *clean, *s2; const char *s1; char *buf; name = current_section->name; lang_leave_output_section_statement (fill, "*default*", phdrs, "*default*"); /* Define the magic symbols. */ clean = xmalloc (strlen (name) + 1); s2 = clean; for (s1 = name; *s1 != '\0'; s1++) if (ISALNUM (*s1) || *s1 == '_') *s2++ = *s1; *s2 = '\0'; buf = xmalloc (strlen (clean) + sizeof "__load_start_"); sprintf (buf, "__load_start_%s", clean); lang_add_assignment (exp_assop ('=', buf, exp_nameop (LOADADDR, name))); buf = xmalloc (strlen (clean) + sizeof "__load_stop_"); sprintf (buf, "__load_stop_%s", clean); lang_add_assignment (exp_assop ('=', buf, exp_binop ('+', exp_nameop (LOADADDR, name), exp_nameop (SIZEOF, name)))); free (clean); } /* Finish an overlay. If there are any overlay wide settings, this looks through all the sections in the overlay and sets them. */ void lang_leave_overlay (fill, memspec, phdrs, lma_memspec) bfd_vma fill; const char *memspec; struct lang_output_section_phdr_list *phdrs; const char *lma_memspec; { lang_memory_region_type *region; lang_memory_region_type * default_region; lang_memory_region_type *lma_region; struct overlay_list *l; struct lang_nocrossref *nocrossref; default_region = lang_memory_region_lookup ("*default*"); if (memspec == NULL) region = NULL; else region = lang_memory_region_lookup (memspec); if (lma_memspec == NULL) lma_region = NULL; else lma_region = lang_memory_region_lookup (lma_memspec); nocrossref = NULL; l = overlay_list; while (l != NULL) { struct overlay_list *next; if (fill != 0 && l->os->fill == 0) l->os->fill = fill; /* Assign a region to the sections, if one has been specified. Override the assignment of the default section, but not other sections. */ if (region != NULL && (l->os->region == NULL || l->os->region == default_region)) l->os->region = region; /* We only set lma_region for the first overlay section, as subsequent overlay sections will have load_base set relative to the first section. Also, don't set lma_region if load_base is specified. FIXME: There should really be a test that `AT ( LDADDR )' doesn't conflict with `AT >LMA_REGION' rather than letting LDADDR simply override LMA_REGION. */ if (lma_region != NULL && l->os->lma_region == NULL && l->next == NULL && l->os->load_base == NULL) l->os->lma_region = lma_region; if (phdrs != NULL && l->os->phdrs == NULL) l->os->phdrs = phdrs; if (overlay_nocrossrefs) { struct lang_nocrossref *nc; nc = (struct lang_nocrossref *) xmalloc (sizeof *nc); nc->name = l->os->name; nc->next = nocrossref; nocrossref = nc; } next = l->next; free (l); l = next; } if (nocrossref != NULL) lang_add_nocrossref (nocrossref); /* Update . for the end of the overlay. */ lang_add_assignment (exp_assop ('=', ".", exp_binop ('+', overlay_vma, overlay_max))); overlay_vma = NULL; overlay_lma = NULL; overlay_nocrossrefs = 0; overlay_list = NULL; overlay_max = NULL; } /* Version handling. This is only useful for ELF. */ /* This global variable holds the version tree that we build. */ struct bfd_elf_version_tree *lang_elf_version_info; static int lang_vers_match_lang_c (expr, sym) struct bfd_elf_version_expr *expr; const char *sym; { if (expr->pattern[0] == '*' && expr->pattern[1] == '\0') return 1; return fnmatch (expr->pattern, sym, 0) == 0; } static int lang_vers_match_lang_cplusplus (expr, sym) struct bfd_elf_version_expr *expr; const char *sym; { char *alt_sym; int result; if (expr->pattern[0] == '*' && expr->pattern[1] == '\0') return 1; alt_sym = cplus_demangle (sym, /* DMGL_NO_TPARAMS */ 0); if (!alt_sym) { /* cplus_demangle (also) returns NULL when it is not a C++ symbol. Should we early out false in this case? */ result = fnmatch (expr->pattern, sym, 0) == 0; } else { result = fnmatch (expr->pattern, alt_sym, 0) == 0; free (alt_sym); } return result; } static int lang_vers_match_lang_java (expr, sym) struct bfd_elf_version_expr *expr; const char *sym; { char *alt_sym; int result; if (expr->pattern[0] == '*' && expr->pattern[1] == '\0') return 1; alt_sym = cplus_demangle (sym, DMGL_JAVA); if (!alt_sym) { /* cplus_demangle (also) returns NULL when it is not a Java symbol. Should we early out false in this case? */ result = fnmatch (expr->pattern, sym, 0) == 0; } else { result = fnmatch (expr->pattern, alt_sym, 0) == 0; free (alt_sym); } return result; } /* This is called for each variable name or match expression. */ struct bfd_elf_version_expr * lang_new_vers_pattern (orig, new, lang) struct bfd_elf_version_expr *orig; const char *new; const char *lang; { struct bfd_elf_version_expr *ret; ret = (struct bfd_elf_version_expr *) xmalloc (sizeof *ret); ret->next = orig; ret->pattern = new; if (lang == NULL || strcasecmp (lang, "C") == 0) ret->match = lang_vers_match_lang_c; else if (strcasecmp (lang, "C++") == 0) ret->match = lang_vers_match_lang_cplusplus; else if (strcasecmp (lang, "Java") == 0) ret->match = lang_vers_match_lang_java; else { einfo (_("%X%P: unknown language `%s' in version information\n"), lang); ret->match = lang_vers_match_lang_c; } return ret; } /* This is called for each set of variable names and match expressions. */ struct bfd_elf_version_tree * lang_new_vers_node (globals, locals) struct bfd_elf_version_expr *globals; struct bfd_elf_version_expr *locals; { struct bfd_elf_version_tree *ret; ret = (struct bfd_elf_version_tree *) xmalloc (sizeof *ret); ret->next = NULL; ret->name = NULL; ret->vernum = 0; ret->globals = globals; ret->locals = locals; ret->deps = NULL; ret->name_indx = (unsigned int) -1; ret->used = 0; return ret; } /* This static variable keeps track of version indices. */ static int version_index; /* This is called when we know the name and dependencies of the version. */ void lang_register_vers_node (name, version, deps) const char *name; struct bfd_elf_version_tree *version; struct bfd_elf_version_deps *deps; { struct bfd_elf_version_tree *t, **pp; struct bfd_elf_version_expr *e1; if (name == NULL) name = ""; if ((name[0] == '\0' && lang_elf_version_info != NULL) || (lang_elf_version_info && lang_elf_version_info->name[0] == '\0')) { einfo (_("%X%P: anonymous version tag cannot be combined with other version tags\n")); return; } /* Make sure this node has a unique name. */ for (t = lang_elf_version_info; t != NULL; t = t->next) if (strcmp (t->name, name) == 0) einfo (_("%X%P: duplicate version tag `%s'\n"), name); /* Check the global and local match names, and make sure there aren't any duplicates. */ for (e1 = version->globals; e1 != NULL; e1 = e1->next) { for (t = lang_elf_version_info; t != NULL; t = t->next) { struct bfd_elf_version_expr *e2; for (e2 = t->locals; e2 != NULL; e2 = e2->next) if (strcmp (e1->pattern, e2->pattern) == 0) einfo (_("%X%P: duplicate expression `%s' in version information\n"), e1->pattern); } } for (e1 = version->locals; e1 != NULL; e1 = e1->next) { for (t = lang_elf_version_info; t != NULL; t = t->next) { struct bfd_elf_version_expr *e2; for (e2 = t->globals; e2 != NULL; e2 = e2->next) if (strcmp (e1->pattern, e2->pattern) == 0) einfo (_("%X%P: duplicate expression `%s' in version information\n"), e1->pattern); } } version->deps = deps; version->name = name; if (name[0] != '\0') { ++version_index; version->vernum = version_index; } else version->vernum = 0; for (pp = &lang_elf_version_info; *pp != NULL; pp = &(*pp)->next) ; *pp = version; } /* This is called when we see a version dependency. */ struct bfd_elf_version_deps * lang_add_vers_depend (list, name) struct bfd_elf_version_deps *list; const char *name; { struct bfd_elf_version_deps *ret; struct bfd_elf_version_tree *t; ret = (struct bfd_elf_version_deps *) xmalloc (sizeof *ret); ret->next = list; for (t = lang_elf_version_info; t != NULL; t = t->next) { if (strcmp (t->name, name) == 0) { ret->version_needed = t; return ret; } } einfo (_("%X%P: unable to find version dependency `%s'\n"), name); return ret; } static void lang_do_version_exports_section () { struct bfd_elf_version_expr *greg = NULL, *lreg; LANG_FOR_EACH_INPUT_STATEMENT (is) { asection *sec = bfd_get_section_by_name (is->the_bfd, ".exports"); char *contents, *p; bfd_size_type len; if (sec == NULL) continue; len = bfd_section_size (is->the_bfd, sec); contents = xmalloc (len); if (!bfd_get_section_contents (is->the_bfd, sec, contents, 0, len)) einfo (_("%X%P: unable to read .exports section contents\n"), sec); p = contents; while (p < contents + len) { greg = lang_new_vers_pattern (greg, p, NULL); p = strchr (p, '\0') + 1; } /* Do not free the contents, as we used them creating the regex. */ /* Do not include this section in the link. */ bfd_set_section_flags (is->the_bfd, sec, bfd_get_section_flags (is->the_bfd, sec) | SEC_EXCLUDE); } lreg = lang_new_vers_pattern (NULL, "*", NULL); lang_register_vers_node (command_line.version_exports_section, lang_new_vers_node (greg, lreg), NULL); } void lang_add_unique (name) const char *name; { struct unique_sections *ent; for (ent = unique_section_list; ent; ent = ent->next) if (strcmp (ent->name, name) == 0) return; ent = (struct unique_sections *) xmalloc (sizeof *ent); ent->name = xstrdup (name); ent->next = unique_section_list; unique_section_list = ent; }