aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
AgeCommit message (Collapse)AuthorFilesLines
2006-09-15PR ld/3107Nick Clifton1-1/+12
* ldlang.c (lang_size_sections_1): Do not abort when encountering a non-empty section that is ignored. Instead produce a warning message.
2006-09-07bfd/H.J. Lu1-0/+48
2006-09-07 H.J. Lu <hongjiu.lu@intel.com> * elf-bfd.h (elf_link_hash_entry): Add a dynamic field. (bfd_elf_link_mark_dynamic_symbol): New. (SYMBOLIC_BIND): New. * elf32-i386.c (elf_i386_check_relocs): Replace info->symbolic with SYMBOLIC_BIND (info, h). (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise. (elf64_x86_64_relocate_section): Likewise. * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise. * elflink.c (bfd_elf_link_mark_dynamic_symbol): New. (bfd_elf_record_link_assignment): Call bfd_elf_link_mark_dynamic_symbol on new entry. (_bfd_elf_merge_symbol): Likewise. (_bfd_elf_export_symbol): Return if the symbol isn't exported. (_bfd_elf_fix_symbol_flags): Replace info->symbolic with SYMBOLIC_BIND (info, h). (_bfd_elf_dynamic_symbol_p): Likewise. (_bfd_elf_symbol_refs_local_p): Likewise. (bfd_elf_size_dynamic_sections): Updated. include/ 2006-09-07 H.J. Lu <hongjiu.lu@intel.com> * bfdlink.h (bfd_elf_dynamic_list): New. (bfd_link_info): Add a dynamic field. ld/ 2006-09-07 H.J. Lu <hongjiu.lu@intel.com> * Makefile.am (CXX): Set to g++. (CXX_FOR_TARGET): Likewise. * Makefile.in: Regenerated. * NEWS: Mention --dynamic-list. * ld.texinfo: Document --dynamic-list. * ldgram.y: Support dynamic list. * ldlang.c (lang_process): Call lang_finalize_version_expr_head on link_info.dynamic if needed. (lang_append_dynamic_list): New. (lang_append_dynamic_list_cpp_typeinfo): New. * ldlang.h (lang_append_dynamic_list): Likewise. * ldlang.h (lang_append_dynamic_list_cpp_typeinfo): Likewise. * ldlex.h (input_enum): Add input_dynamic_list. * ldlex.l: Handle it. * ldmain.c (main): Initialize link_info.dynamic. * lexsup.c (option_values): Add OPTION_DYNAMIC_LIST and OPTION_DYNAMIC_LIST_CPP_TYPEINFO. (ld_options): Add entries for OPTION_DYNAMIC_LIST and OPTION_DYNAMIC_LIST_CPP_TYPEINFO. (parse_args): Handle OPTION_DYNAMIC_LIST and OPTION_DYNAMIC_LIST_CPP_TYPEINFO. ld/testsuite/ 2006-09-07 H.J. Lu <hongjiu.lu@intel.com> * ld-elf/dl1.c: New file. * ld-elf/dl1.list: Likewise. * ld-elf/dl1.out: Likewise. * ld-elf/dl1main.c: Likewise. * ld-elf/dl2.c: Likewise. * ld-elf/dl2.list: Likewise. * ld-elf/dl2a.out: Likewise. * ld-elf/dl2b.out: Likewise. * ld-elf/dl2main.c: Likewise. * ld-elf/dl2xxx.c: Likewise. * ld-elf/dl2xxx.list: Likewise. * ld-elf/dl3.cc: Likewise. * ld-elf/dl3.list: Likewise. * ld-elf/dl3a.out: Likewise. * ld-elf/dl3b.out: Likewise. * ld-elf/dl3header.h: Likewise. * ld-elf/dl3main.cc: Likewise. * ld-elf/shared.exp: Updated. * lib/ld-lib.exp (run_ld_link_exec_tests): Take an optional argument for source language. Use CC/CXX for link, depending on source language. (run_cc_link_tests): Likewise.
2006-08-29 * ldlang.c (walk_wild): Allow * to glob '/' in wildcarded match.Nathan Sidwell1-1/+1
2006-08-24* ldlang.c (lang_size_sections_1, lang_assignment_statement_enum):Nick Clifton1-2/+2
Adjust the current address of DEFAULT_MEMORY_REGION even when dot hasn't changed.
2006-08-22 * NEWS: Mention LMA default change.Alan Modra1-6/+27
* ld.texinfo (Output Section LMA): Update default description. (Location Counter): Clarify backward movement. * ldlang.c (lang_size_sections_1): Leave non-alloc sections with default lma equal to vma. Warn on backward movement of dot.
2006-08-16ld/Alan Modra1-67/+88
PR 3052 * ldlang.h (lang_output_section_statement_type): Replace "processed" field with "processed_vma" and "processed_lma". * ldlang.c (lang_do_assignments_1): Move lma setting code.. (lang_size_sections_1): ..to here. (lang_reset_memory_regions): Adjust for lang_output_section_statement_type change. * ldexp.c (fold_name): Likewise. And this is something I forgot the check in from the previous patch. ld/testsuite/ * ld-scripts/overlay-size-map.d: Adjust.
2006-08-082006-08-08 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-13/+7
PR ld/3006 * ldlang.c (lang_section_bst_type): Moved to ... * ldlang.h: Here. * ldlang.h (lang_wild_statement_struct): Add a tree field. * ldlang.c (wild_sort_fast): Use the tree field for BST. (wild): Likeise. (analyze_walk_wild_section_handler): Initialize the tree field.
2006-08-08ld/H.J. Lu1-1/+2
2006-08-08 H.J. Lu <hongjiu.lu@intel.com> PR ld/3009 * ldlang.c (update_wild_statements): Update the whole wild section list. ld/testsuite/ 2006-08-08 H.J. Lu <hongjiu.lu@intel.com> PR ld/3009 * ld-scripts/sort.t: New file. * ld-scripts/sort_b_a-1.d: Likewise. * ld-scripts/sort_b_a-1.s: Likewise. * ld-scripts/sort_b_n-1.d: Likewise. * ld-scripts/sort_b_n-1.s: Likewise.
2006-08-01ld/H.J. Lu1-35/+41
2006-08-01 H.J. Lu <hongjiu.lu@intel.com> * ldlang.c (init_os): Add flags. Replace bfd_make_section with bfd_make_section_with_flags. (exp_init_os): Updated. (lang_add_section): Call init_os with flags. (map_input_to_output_sections): Likewise. ld/testsuite/ 2006-08-01 H.J. Lu <hongjiu.lu@intel.com> * ld-elf/noload-1.d: New. * ld-elf/noload-1.s: Likewise. * ld-elf/noload-1.t: Likewise.
2006-07-26 * ldexp.c (fold_name <LOADADDR>): Use the lma.Alan Modra1-51/+67
* ldlang.h (lang_memory_region_type): Delete old_length. Add last_os. * ldlang.c (lang_memory_region_lookup): Init new field. (lang_reset_memory_regions): Reset new field. (lang_insert_orphan): Don't set load_base. (lang_leave_overlay): Likewise. (lang_size_sections_1): Delete unnecessary code setting lma_region to region. Correct lma region check. (lang_do_assignments_1): Rename output_section_statement parm to current_os. Set lma from previous section in region.
2006-07-26 * ldlang.c: Formatting.Alan Modra1-41/+42
2006-07-25 * ldlang.c (analyze_walk_wild_section_handler): Init handler_dataAlan Modra1-4/+4
earlier.
2006-07-23* ldlang.c (lang_section_bst): New structure for sorting sections by name.Nick Clifton1-41/+145
(wild_sort_fast): New function: Insert a section into a binary search tree. (output_section_callback_fast): New function: Store a section in BST. (output_section_callback_tree_to_list): New function: Convert a BST into a list. (analyze_walk_wild_section_handler): Initialize handler_data elements. (wild): If the data is sorted by name use the BST method to sort the names.
2006-06-21Fix for segmentation fault.Mark Shinwell1-1/+12
* ldlang.c (lang_insert_orphan): Correctly handle the case where the section is to end up after the section currently at the end of the list in output_bfd.
2006-06-20 * emultempl/elf-generic.em (gld${EMULATION_NAME}_map_segments): LimitAlan Modra1-1/+1
loop to ten iterations. Throw away any previous linker generated segment map. * ldlang.c (lang_phdr_list): Make global. * ldlang.h (lang_phdr_list): Declare. * Makefile.am (ELF_GEN_DEPS): Define. Use in emul deps. * Makefile.in: Regenerate.
2006-06-20bfd/Alan Modra1-2/+2
* elf-bfd.h: Formatting. (_bfd_elf_map_sections_to_segments): Declare. * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Don't clear program_header_size. * elf.c (get_program_header_size): Move. Don't use or set saved program_header_size here. (elf_modify_segment_map): New function. Split out from.. (assign_file_positions_for_load_sections): ..here. Assert header size is correct. Remove dead code. (_bfd_elf_map_sections_to_segments): Rename from map_sections_to_segments. Make global. Use get_program_header_size when we need estimate of header size. Call elf_modify_segment_map. Set program_header_size. (print_segment_map): Delete. (_bfd_elf_sizeof_headers): If segment_map available, get the actual size. * elf32-arm.c (elf32_arm_symbian_modify_segment_map): Make safe for calling more than once. * elf32-bfin.c (elf32_bfinfdpic_modify_segment_map): Likewise. * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Likewise. * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise. * elf32-i370.c (elf_backend_add_symbol_hook): Delete. (elf_backend_additional_program_headers): Delete. (elf_backend_modify_segment_map): Delete. * elf64-hppa.c (elf64_hppa_modify_segment_map): Convert to ISO C. * elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise. * doc/bfdint.texi: Delete SIZEOF_HEADERS difficulties. ld/ * Makefile.am (ELF_DEPS): Define. Use in emul file deps. Fix many ELF emul file deps that incorrectly said they needed elf32.em instead of generic.em. Add genelf.em as required. * Makefile.in: Regenerate. * ldlang.c (lang_process): Call ldemul_finish before lang_check_section_addresses. * emulparams/arcelf.sh: Generic elf target needs genelf. * emulparams/d30v_e.sh: Likewise. * emulparams/d30v_o.sh: Likewise. * emulparams/d30velf.sh: Likewise. * emulparams/elf32_dlx.sh: Likewise. * emulparams/elf32_i860.sh: Likewise. * emulparams/elf32fr30.sh: Likewise. * emulparams/elf32frv.sh: Likewise. * emulparams/elf32iq10.sh: Likewise. * emulparams/elf32iq2000.sh: Likewise. * emulparams/elf32mt.sh: Likewise. * emulparams/mn10200.sh: Likewise. * emulparams/or32.sh: Likewise. * emulparams/or32elf.sh: Likewise. * emulparams/pjelf.sh: Likewise. * emulparams/msp430all.sh: Likewise. Extract common entries. * emulparams/pjlelf.sh: Include pjelf.sh. * emulparams/elf32frvfd.sh (EXTRA_EM_FILE): Unset. * emulparams/mn10300.sh (EXTRA_EM_FILE): Unset. * emultempl/elf-generic.em: New file. * emultempl/genelf.em: New file. * emultempl/elf32.em: Include elf-generic.em. (gld${EMULATION_NAME}_layout_sections_again): Delete. (gld${EMULATION_NAME}_finish): Call gld${EMULATION_NAME}_map_segments. * emultempl/hppaelf.em (hppaelf_layout_sections_again): Likewise. (gld${EMULATION_NAME}_finish): Rename from hppaelf_finish. Call gld${EMULATION_NAME}_map_segments. (LDEMUL_FINISH): Update. * emultempl/mmo.em: Correct comment. Include elf-bfd.h and source elf-generic.em. (mmo_finish): Call gld${EMULATION_NAME}_map_segments. * emultempl/ppc64elf.em (ppc_layout_sections_again): Likewise. (gld${EMULATION_NAME}_finish): Rename from ppc_finish. Call gld${EMULATION_NAME}_map_segments. (LDEMUL_FINISH): Update. ld/testsuite/ * ld-elf/eh1.d: Update for fewer program headers. * ld-elf/eh2.d: Likewise. * ld-elf/eh3.d: Likewise.
2006-06-09 * ldlang.h (lang_input_statement_type): Use bitfields for booleans.Alan Modra1-52/+56
* ldlang.c (struct out_section_hash_entry): Rename from output_statement_hash_entry. Delete output_section_statement_type entry. Add statement_union_type entry. Adjust all users. (output_section_statement_table): Rename from output_statement_table. Adjust all users. (output_section_statement_newfunc): Rename from output_statement_newfunc. Adjust all users. (output_section_statement_table_init): Rename from output_statement_table_init. Adjust all users. (output_section_statement_table_free): Rename from output_statement_table_free. Adjust all users.
2006-06-07 * ldlang.h (enum section_type): Delete dsect_section, copy_section,Alan Modra1-4/+1
info_section and overlay_section. Add noalloc_section. * ldlang.c (lang_add_section): Adjust. * ldgram.y (type): Adjust.
2006-06-06 * ldlang.c (init_os): Whitespace.Alan Modra1-5/+4
(map_input_to_output_sections): Don't init_os for lang_input_section. (print_all_symbols): Remove forward declaration. Convert to ISO C.
2006-06-05 * ldlang.c (lookup_name): Delete dead code. Remove FIXMEs.Alan Modra1-9/+3
2006-05-19 * ldlang.c (lang_size_sections_1): Don't check mem regions forAlan Modra1-1/+2
os->ignored sections.
2006-05-17 * ldlang.c (lang_size_sections): Call lang_reset_memory_regionsDaniel Jacobowitz1-0/+3
before redoing one_lang_size_sections_pass.
2006-04-19 * ldlang.c (wild): Tidy default_common_section loop.Alan Modra1-49/+44
(print_input_section): Format.
2006-04-07 * ldlang.c (load_symbols): Set as_needed and add_needed accordingKaz Kojima1-0/+7
to the corresponding script's fields while processing it.
2006-04-06bfd/H.J. Lu1-29/+39
2006-04-06 H.J. Lu <hongjiu.lu@intel.com> * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes with the skip_relax_pass_0 and skip_relax_pass_1 bits in the section structure. include/ 2006-04-06 H.J. Lu <hongjiu.lu@intel.com> * bfdlink.h (bfd_link_info): Replace need_relax_finalize with relax_pass. ld/ 2006-04-06 H.J. Lu <hongjiu.lu@intel.com> * emultempl/ia64elf.em: Set link_info.relax_pass to 2. Remove link_info.need_relax_finalize. * ldlang.c (relax_sections): New. (lang_process): Use. Call relax_sections link_info.relax_pass times. * ldmain.c (main): Set link_info.relax_pass to 1. Remove link_info.need_relax_finalize.
2006-04-04 * ldlang.c (lang_map): Print the list of discarded input sections.Eric Botcazou1-6/+29
(print_input_section): Change parameter and print zero-sized sections. (print_statement): Adjust call to print_input_section.
2006-03-16 PR 2434Alan Modra1-4/+8
bfd/ * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete. (elf_link_add_object_symbols): Delete unnecessary locals. Rename hash_table -> htab. Formatting. Save entire symbol table before loading as-needed syms, and restore afterwards if lib not needed. Use bfd_hash_allocate rather than bfd_alloc for sym name. Free some buffers earlier. * bfd-in.h (struct bfd_hash_table): Add entsize. (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype. * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise * hash.c (bfd_hash_table_init_n): Add entsize param, save to hash table. (bfd_hash_table_init): Add param, adjust calls. * aoutx.h: Adjust all hash_table_init functions and calls. * bfd.c: Likewise. * coff-arm.c: Likewise. * coff-h8300.c: Likewise. * coff-ppc.c: Likewise. * cofflink.c: Likewise. * ecoff.c: Likewise. * ecofflink.c: Likewise. * elf-m10300.c: Likewise. * elf-strtab.c: Likewise. * elf.c: Likewise. * elf32-arm.c: Likewise. * elf32-bfin.c: Likewise. * elf32-cris.c: Likewise. * elf32-frv.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh.c: Likewise. * elf32-vax.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-x86-64.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-sparc.c: Likewise. * i386linux.c: Likewise. * libaout.h: Likewise. * libbfd-in.h: Likewise. * libcoff-in.h: Likewise. * linker.c: Likewise. * m68klinux.c: Likewise. * merge.c: Likewise. * opncls.c: Likewise. * pdp11.c: Likewise. * sparclinux.c: Likewise. * stabs.c: Likewise. * sunos.c: Likewise. * vms.c: Likewise. * xcofflink.c: Likewise. * section.c (struct section_hash_entry): Move to.. * libbfd-in.h: ..here. * Makefile.am: Run "make dep-am" * Makefile.in: Regenerate. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate. binutils/ * ieee.c (write_ieee_debugging_info): Adjust bfd_hash_table_init calls. * wrstabs.c (write_stabs_in_sections_debugging_info): Likewise. ld/ * ldcref.c (add_cref): Adjust bfd_hash_table_init calls. * ldlang.c (output_statement_table_init, lang_init): Likewise. * ldmain.c (add_ysym, add_wrap, add_keepsyms_file): Likewise. (undefined_symbol): Likewise.
2005-12-24 * ldlang.h (lang_output_section_statement_type): Add prev.Alan Modra1-7/+15
* ldlang.c (output_statement_newfunc): Set os.prev. (lang_insert_orphan): Likewise. (output_prev_sec_find): Use os.prev.
2005-12-192005-12-19 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-4/+7
PR ld/2065 * ldlang.c (output_statement_newfunc): Revert the change made on 2005-11-16. (output_prev_sec_find): Likewsise. * ldlang.h (lang_statement_list_type): Likewsise.
2005-11-24bfd/Alan Modra1-41/+35
* elf-bfd.h (_bfd_generic_match_sections_by_type): Don't define. * libbfd-in.h (_bfd_generic_match_sections_by_type): Delete. * libbfd.c (_bfd_generic_match_sections_by_type): Delete. * targets.c (bfd_match_sections_by_type): Don't define. (BFD_JUMP_TABLE_LINK): Remove _bfd_generic_match_sections_by_type. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise. * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. ld/ * ldlang.c (lang_output_section_find_by_flags): Add match_type param. Run two passes, first using match_type, second without. * ldlang.h (lang_match_sec_type_func): New typedef. (lang_output_section_find_by_flags): Update prototype. bfd_match_sections_by_type and lang_output_section_find_by_flags. * emultempl/pe.em (place_orphan): Likewise.
2005-11-24 * ldlang.c (lang_insert_orphan): Skip first assignment to dotAlan Modra1-2/+11
in script when looking for place to insert orphan statements.
2005-11-18 * ldlang.c (lang_size_sections_1): Revert 2005-11-16 functionalAlan Modra1-11/+16
changes to section alignment. * ldmisc.c (vfinfo): Handle %ld and %lu.
2005-11-17 * ldlang.h (lang_input_section_type): Remove "ifile" field.Alan Modra1-19/+14
(lang_insert_orphan, lang_add_section): Update prototypes. * ldlang.c (lang_insert_orphan): Remove "file" param. (lang_add_section): Likewise. Update all callers. (wild_sort): Get an input section's bfd via "section->owner". (size_input_section): Access just_syms_flag via bfd usrdata. (lang_place_orphans): Update ldemul_place_orphan call. * ldemul.h (ldemul_place_orphan): Remove input_statement param. (struct ld_emulation_xfer_struct <place_orphan>): Likewise. * ldemul.c (ldemul_place_orphan): Likewise. * ldwrite.c (build_link_order): Access just_syms_flag via bfd usrdata. * emultempl/armelf.em (arm_elf_set_bfd_for_interworking): Likewise. * emultempl/beos.em (sort_by_file_name): Access bfd by section->owner. (sort_sections): Likewise. (place_orphan): Remove "file" param. Adjust lang_add_section call. * emultempl/elf32.em (place_orphan): Remove "file" param. Adjust lang_add_section and lang_insert_orphan calls. * emultempl/hppaelf.em (hppaelf_add_stub_section): Adjust lang_add_section call. (build_section_lists): Access just_syms_flag via bfd usrdata. * emultempl/m68hc1xelf.em (m68hc11elf_add_stub_section): Adjust lang_add_section call. * emultempl/mmo.em (mmo_place_orphan): Remove "file" param. Adjust lang_add_section and lang_insert_orphan calls. * emultempl/pe.em (place_orphan): Likewise. Access bfd via section owner. * emultempl/ppc64elf.em (ppc_add_stub_section): Adjust lang_add_section call. (build_toc_list): Access just_syms_flag via bfd usrdata. (build_section_lists): Likewise. * emultempl/xtensaelf.em (elf_xtensa_place_orphan): Remove "file" param. Adjust place_orphan call. (ld_build_required_section_dependence): Access bfd via section owner.
2005-11-16 * ldlang.h (lang_output_section_statement_type): Add prev.Alan Modra1-25/+19
* ldlang.c (new_afile): Always init header.type. (output_statement_newfunc): Set os.prev. (output_prev_sec_find): Use os.prev. (lang_enter_output_section_statement): Formatting. (lang_final, lang_add_target, lang_add_fill): Likewise. (lang_add_data, lang_add_reloc): Likewise. (lang_add_attribute): Only alloc the header.
2005-11-16 * ld.texinfo (Forced Output Alignment): Specify that this is anAlan Modra1-22/+17
alignment increase, not an override. * ldlang.c (init_os): Set output section alignment here.. (lang_add_section): ..rather than here. (lang_size_sections_1): Consolidate alignment code. Warn if section alignment affects start address when explicit address given.
2005-11-04 * ldlang.c (struct output_statement_hash_entry): Don't indirect to os.Alan Modra1-76/+87
(output_statement_newfunc): Rewrite. (lang_output_section_find_1): Merge into.. (lang_output_section_find): ..here. (lang_output_section_statement_lookup_1): Rewrite to handle multiple sections with the same name. (output_statement_table_init): Commonise error message. (lang_init, open_output): Likewise.
2005-11-03 * ldlang.h (lang_output_section_statement_type): Rearrange. RemoveAlan Modra1-9/+6
memspec. Make "processed" a bitfield. (lang_data_statement_type, lang_reloc_statement_type): Rename output_vma to output_offset. * ldlang.c (lang_output_section_statement_lookup_1): Init all_input_readonly. Don't init memspec. (init_os): Remove incorrect comment. (print_data_statement, print_reloc_statement): Adjust for lang_data_statement_type and lang_reloc_statement_type change. (lang_size_sections_1, lang_add_reloc): Likewise. * ldwrite.c (build_link_order): Likewise.
2005-10-24bfd/H.J. Lu1-7/+12
2005-10-23 H.J. Lu <hongjiu.lu@intel.com> PR ld/1487 * elf-bfd.h (_bfd_generic_init_private_section_data): New. (_bfd_elf_init_private_section_data): New. * elf.c (elf_fake_sections): Don't set SHF_GROUP for relocatable link. (bfd_elf_set_group_contents): Don't handle relocatable link specially. (assign_section_numbers): If it isn't called by assembler, use the output section of elf_linked_to_section for SHF_LINK_ORDER. (_bfd_elf_init_private_section_data): New. (_bfd_elf_copy_private_section_data): Call it. * libbfd-in.h (_bfd_generic_init_private_section_data): New. * libbfd.c (_bfd_generic_init_private_section_data): New. * targets.c (BFD_JUMP_TABLE_COPY): Add _bfd_generic_init_private_section_data. (bfd_init_private_section_data): Likewise. * bfd-in2.h: Regenerated. * libbfd.h: Likewise. ld/ 2005-10-23 H.J. Lu <hongjiu.lu@intel.com> PR ld/1487 * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Call bfd_match_sections_by_type to match section types. * ldlang.c (init_os): Take the input section. Call bfd_init_private_section_data if the input section isn't NULL. (exp_init_os): Pass NULL to init_os. (map_input_to_output_sections): Likewise. (lang_add_section): Pass the input section to init_os. ld/testsuite/ 2005-10-23 H.J. Lu <hongjiu.lu@intel.com> PR ld/1487 * ld-ia64/tlspic.rd: Updated.
2005-10-15bfd/H.J. Lu1-6/+42
2005-10-15 H.J. Lu <hongjiu.lu@intel.com> PR ld/1467 * elf-bfd.h (_bfd_elf_match_sections_by_type): New. (_bfd_generic_match_sections_by_type): New. Defined. * elf.c (_bfd_elf_match_sections_by_type): New. * libbfd-in.h (_bfd_generic_match_sections_by_type): New. * bfd-in2.h: Regenerated. * libbfd.h: Likewise. * libbfd.c (_bfd_generic_match_sections_by_type): New. * targets.c (BFD_JUMP_TABLE_LINK): Initialize _bfd_match_sections_by_type with _bfd_generic_match_sections_by_type. (bfd_target): Add _bfd_match_sections_by_type. ld/ 2005-10-15 H.J. Lu <hongjiu.lu@intel.com> PR ld/1467 * emultempl/elf32.em: Include "elf-bfd.h". (gld${EMULATION_NAME}_place_orphan): Check section type and don't use section name for ELF input sections. * ld.texinfo: Document orphan section processing. * ldlang.c (lang_output_section_find_by_flags): Match section types by calling bfd_match_sections_by_type.
2005-10-13 * ld.texino: Describe double-quoted string syntax for versionMark Mitchell1-14/+19
nodes. * ldlang.h (lang_new_vers_pattern): Add literal_p parameter. * ldgram.y (vers_defns): Allow NAME as well as VERS_IDENTIFIER. Adjust calls to lang_new_vers_pattern to pass literal_p argument. * ldlang.c (lang_vers_match): Fix indentation. Do not glob-match version nodes without a pattern. (lang_new_vers_pattern): Add literal_p parameter. (lang_do_version_exports_section): Pass it. * ld-elfvers/vers.exp: Add vers31. * ld-elfvers/vers31.c: New file. * ld-elfvers/vers31.dsym: Likewise. * ld-elfvers/vers31.map: Likewise. * ld-elfvers/vers31.ver: Likewise.
2005-09-30Fix malformed error message.Jim Wilson1-1/+1
* ldlang.c (lang_startup): Add missing ": " to einfo call.
2005-09-30ld/H.J. Lu1-7/+77
2005-09-30 H.J. Lu <hongjiu.lu@intel.com> * ldlang.c (output_statement_hash_entry): New type. (output_statement_table): New variable for hash table. (output_statement_newfunc): New function. (output_statement_table_init): Likewise. (output_statement_table_free): Likewise. (lang_init): Call output_statement_table_init. (lang_finish): Renamed to ... (lang_end): This. (lang_process): Updated. (lang_finish): New function. (lang_output_section_find_1): Use hash table. (lang_output_section_statement_lookup_1): Likewise. * ldlang.h (lang_finish): New. * ldmain.c (main): Call lang_finish. ld/testsuite/ 2005-09-30 H.J. Lu <hongjiu.lu@intel.com> * ld-elf/sec64k.exp: Enabled for all ELF targets.
2005-09-20 * ldlang.h (lang_output_section_statement_struct): Change type ofAlan Modra1-5/+4
"processed" to bfd_boolean. * ldexp.c (fold_name): Update references to os->processed. * ldlang.c (lang_output_section_statement_lookup_1): Likewise. (lang_size_sections_1): Likewise. (lang_reset_memory_regions): Likewise.
2005-09-19 PR ld/1353Alan Modra1-16/+16
* ldlang.c (lang_size_sections_1): Process addr_tree earlier, so that unused output section statements affect dot.
2005-08-04bfd/Alan Modra1-4/+1
* elf32-ppc.c (struct elf_linker_section): Replace sym_val field with sym. (ppc_elf_relocate_section): Adjust for above. (create_sdata_sym): New function. (ppc_elf_create_linker_section): Call it. (ppc_elf_check_relocs): Correct has_sda_refs and non_got_refs. Create sdata syms for all SDA relocs. (ppc_elf_adjust_dynamic_symbol): Don't special case _SDA_BASE_ and _SDA2_BASE_. (ppc_elf_set_sdata_syms): Delete. * elflink.c (bfd_elf_size_dynamic_sections): Don't create DT_INIT and DT_FINI tags unless associated section has input. (bfd_elf_set_symbol, _bfd_elf_provide_symbol): Delete. (_bfd_elf_provide_section_bound_symbols): Delete. * bfd-in.h (_bfd_elf_provide_symbol): Delete. (_bfd_elf_provide_section_bound_symbols): Delete. * bfd-in2.h: Regenerate. ld/ * ldemul.c (ldemul_do_assignments, do_assignments_default): Delete. * ldemul.h (ldemul_do_assignments, do_assignments_default): Delete. (struct ld_emulation_xfer_struct): Remove do_assignments field. * ldlang.c (lang_do_assignments): Don't call ldemul_do_assignments. * emulparams/elf32ppc.sh (SDATA_START_SYMBOLS): New. (SDATA2_START_SYMBOLS, SBSS_START_SYMBOLS, SBSS_END_SYMBOLS): New. * emultempl/aix.em (ld_*_emulation): Delete do_assignments init. * emultempl/armcoff.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/generic.em: Likewise. * emultempl/gld960.em: Likewise. * emultempl/gld960c.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/lnk960.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vanilla.em: Likewise. * emultempl/elf32.em: Likewise. (gld*_provide_bound_symbols): Delete. (gld*_provide_init_fini_syms): Delete. (gld*_before_allocation): Don't call ldemul_do_assignments. * emultempl/ppc32elf.em (ppc_do_assignments): Delete. (LDEMUL_DO_ASSIGNMENTS): Delete. * scripttempl/elf.sc: Provide init/fini syms. Add SBSS_START_SYMBOLS, SBSS_END_SYMBOLS, SDATA2_START_SYMBOLS.
2005-08-03 * ldlang.c (exp_init_os): Handle etree_provide.Alan Modra1-0/+1
* emulparams/armelf.sh (OTHER_END_SYMBOLS): Rename from.. (OTHER_BSS_END_SYMBOLS): ..this. * emulparams/armelf_linux.sh: Likewise. * emulparams/armnto.sh: Likewise. * emulparams/criself.sh: Likewise. * emulparams/crislinux.sh: Likewise. * emulparams/elf32frv.sh: Likewise. * emulparams/elf32mcore.sh: Likewise. * emulparams/elf32ppc.sh: Likewise. * emulparams/elf32ppclinux.sh: Likewise. * emulparams/hppa64linux.sh: Likewise. * scripttempl/armbpabi.sc: Substitute $OTHER_END_SYMBOLS, not $OTHER_BSS_END_SYMBOLS. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/elf.sc: Likewise. Delete __bss_start comment. * scripttempl/elfxtensa.sc: Likewise.
2005-07-28* ldlang.c (lang_output_section_statement_lookup_1): Don't cast aDJ Delorie1-1/+6
unary & address operator, as that breaks GCC's strict aliasing rules.
2005-07-15 * ldemul.c (ldemul_do_assignments): New function.Alan Modra1-0/+1
(do_assignments_default): New function. * ldemul.h (ldemul_do_assignments): Declare. (do_assignments_default): Declare. (struct ld_emulation_xfer_struct): Add do_assignments. * ldlang.c (lang_do_assignments) Call ldemul_do_assignments. * emultempl/aix.em (ld_*_emulation): Init do_assignments field. * emultempl/armcoff.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/generic.em: Likewise. * emultempl/gld960.em: Likewise. * emultempl/gld960c.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/lnk960.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vanilla.em: Likewise. * emultempl/elf32.em: Likewise, to call gld*_provide_init_fini_syms. (gld*_find_exp_assignment): Adjust bfd_elf_record_link_assignment call.
2005-07-14bfd/Alan Modra1-8/+0
* bfd-in.h (_bfd_elf_fix_excluded_sec_syms): Declare. (_bfd_elf_provide_section_bound_symbols): Remove param name. Formatting. * bfd-in2.h: Regenerate. * elflink.c (bfd_elf_gc_sections): Don't call generic function. (_bfd_elf_provide_symbol): Formatting. (_bfd_elf_provide_section_bound_symbols): Remove all hacks, just create section relative syms. (fix_syms, _bfd_elf_fix_excluded_sec_syms): New functions. * elf32-ppc.c (ppc_elf_set_sdata_syms): Use _bfd_elf_provide_section_bound_symbols. * reloc.c (bfd_mark_used_section): Delete. (bfd_generic_gc_sections): Don't call the above. ld/ * ldlang.c (strip_excluded_output_sections): Don't call bfd_gc_sections. * emultempl/elf32.em (gld*_provide_bound_symbols): Move. (gld*_provide_init_fini_syms): Move. (gld*_before_allocation): Call the above from here.. (gld*_finish): ..not here. Call _bfd_elf_fix_excluded_sec_syms. * emultempl/hppaelf.em (hppaelf_finish): Likewise. * emultempl/ppc64elf.em (ppc_finish): Likewise.
2005-07-08 * ldlang.c (wild_sort): Formatting.Alan Modra1-24/+22
(strip_excluded_output_sections): Strip zero size sections here. * emultempl/elf32.em (gld*_strip_empty_sections): Delete. (gld*_finish): Don't call the above. * emultempl/hppaelf.em (hppaelf_finish): Likewise. * emultempl/ppc64elf.em (ppc_finish): Likewise.