aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-172007-10-17 Zack Weinberg <zack@codesourcery.com>Daniel Jacobowitz1-7/+23
* ldlang.c (lang_check_section_addresses): Also report size of overflow for any overflowed memory regions. (os_region_check): Diagnose an overflowed region only once per region. Do not reset region->current on overflow. 2007-10-17 Zack Weinberg <zack@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> Mark Shinwell <shinwell@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * ld-scripts/rgn-over.exp: New driver. * ld-scripts/rgn-over.s: New file. * ld-scripts/rgn-over1.d, ld-scripts/rgn-over1.t, ld-scripts/rgn-over2.d, ld-scripts/rgn-over2.t, ld-scripts/rgn-over3.d, ld-scripts/rgn-over3.t, ld-scripts/rgn-over4.d, ld-scripts/rgn-over4.t, ld-scripts/rgn-over5.d, ld-scripts/rgn-over5.t, ld-scripts/rgn-over6.d, ld-scripts/rgn-over6.t, ld-scripts/rgn-over7.d, ld-scripts/rgn-over7.t: New test cases.
2007-09-18bfd/H.J. Lu1-0/+101
2007-09-17 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3281 PR binutils/5037 * elf-bfd.h (elf_obj_tdata): Remove relro. * elf.c (get_program_header_size): Check info->relro instead of elf_tdata (abfd)->relro. (_bfd_elf_map_sections_to_segments): Likewise. (assign_file_positions_for_load_sections): Don't set PT_GNU_RELRO segment alignment here. (assign_file_positions_for_non_load_sections): Properly set up PT_GNU_RELRO segment for copying executable/shared library. (rewrite_elf_program_header): Remove PT_GNU_RELRO segment. (copy_elf_program_header): Set p_size and p_size_valid fields for PT_GNU_RELRO segment. include/elf/ 2007-09-17 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3281 PR binutils/5037 * internal.h (elf_segment_map): Add p_size and p_size_valid. (ELF_IS_SECTION_IN_SEGMENT): Allow SHF_TLS sections in PT_GNU_RELRO segments. ld/ 2007-09-17 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3281 PR binutils/5037 * ldexp.h (ldexp_control): Add relro, relro_start_stat and relro_end_stat. * ldexp.c (fold_binary): Set expld.dataseg.relro to exp_dataseg_relro_start or exp_dataseg_relro_end when seeing DATA_SEGMENT_ALIGN or DATA_SEGMENT_RELRO_END, respectively. * ldlang.c (lang_size_sections_1): Properly set expld.dataseg.relro_start_stat and expld.dataseg.relro_end_stat. (find_relro_section_callback): New function. (lang_find_relro_sections_1): Likewise. (lang_find_relro_sections): Likewise. (lang_process): Call lang_find_relro_sections for non-relocatable link. ld/testsuite/ 2007-09-17 H.J. Lu <hongjiu.lu@intel.com> PR binutils/3281 PR binutils/5037 * ld-elf/binutils.exp: Update "-z relro" tests to use relro1.s. Add "-z relro" tests with relro2.s. Add "-z relro" tests with TLS for objcopy. * ld-elf/relro1.s: New file. * ld-elf/relro2.s: Likewise.
2007-08-31* ldlang.c (lang_map): Increment lang_statement_iteration so that DEFINED() ↵Nick Clifton1-1/+2
expressions are correctly computed. * testsuite/ld-script/map-address.d, * testsuite/ld-script/map-address.t: Add a test for testing DEFINED in map output.
2007-08-31 * ldlang.c (lang_record_phdrs): Give a fatal error if no sectionsAlan Modra1-5/+8
assigned to phdrs. Avoid multiple forward scans for a section with phdr assignment.
2007-08-28bfd:Joseph Myers1-0/+4
2007-08-28 Mark Shinwell <shinwell@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * elf32-arm.c (elf32_arm_compare_mapping): Compare first on vma, then on type. binutils/testsuite: 2007-08-28 Mark Shinwell <shinwell@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * binutils-all/ar.exp (long_filenames): Delete temporary files on the host. * binutils-all/arm/objdump.exp: Only check "which $OBJDUMP" if host is local. * binutils-all/objcopy.exp: Use ${srecfile} to get the name of the srec file to be passed to binutils_run. (objcopy_test_readelf): Use remote_exec. * binutils-all/readelf.exp (readelf_find_size): Use remote_exec. (readelf_test): Likewise. (readelf_wi_test): Likewise. * lib/utils-lib.exp (run_dump_test): Only check "which $binary" if host is local. Use remote_exec. Use $tempfile not tmpdir/bintest.o. gas: 2007-08-28 Mark Shinwell <shinwell@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * as.c (main): Flush stderr before printing listings to ensure consistent output order across platforms. gas/testsuite: 2007-08-28 Mark Shinwell <shinwell@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * lib/gas-defs.exp (gas_version): Use remote_* functions instead of exec. (gas_host_run): New. (gas_run): Use gas_host_run. (gas_start): Likewise. (run_dump_test): Likewise. (objdump): Use gas_host_run. (objdump_start_no_subdir): Likewise. * lib/gas-dg.exp (gas-dg-test): Use "remote_file host delete". * lib/run: Remove. * gas/macros/macros.exp: Download app4b.s to host. * gas/i386/i386.exp (gas_64_check): Use gas_host_run. (gas_32_check): Likewise. * gas/maxq10/maxq10.exp (gas_64_check): Likewise (gas_32_check): Likewise. * gas/maxq20/maxq20.exp (gas_64_check): Likewise (gas_32_check): Likewise. * gas/sparc/sparc.exp (gas_64_check): Likewise. * gas/cfi/cfi.exp: Likewise. * gas/elf/elf.exp (run_list_test): Likewise. Use temporary file for readelf output in place of pipe. * gas/all/gas.exp: Download incbin.dat to host. (do_comment): Allow \r\r\n. ld: 2007-08-28 Mark Shinwell <shinwell@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * ldlang.c (sort_sections_by_lma): Sort by internal id after lma for stable sort. ld/testsuite: 2007-08-28 Mark Shinwell <shinwell@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * ld-elfcomm/elfcomm.exp: Use run_host_cmd. Only check "which $CC" if host is local. * ld-checks/checks.exp: Use run_host_cmd. * ld-elf/exclude.exp: Likewise. * ld-elf/elf.exp: Download merge.ld if host is remote. * ld-elf/binutils.exp (binutils_test): Use remote_exec. * ld-elf/tls_common.exp: Use run_host_cmd. * lib/ld-lib.exp (ld_version): Only check "which $ld" if host is local. Use remote_exec. (run_host_cmd): New. (run_host_cmd_yesno): New. (default_ld_relocate): Use run_host_cmd_yesno. (default_ld_link): Likewise. (default_ld_simple_link): Use run_host_cmd. (default_ld_compile): Only check "which $ccprog" if host is local. Use remote_file and remote_exec. (default_ld_assemble): Only check "which $as" if host is local. Use run_host_cmd. (default_ld_nm): Use remote_exec, remote_upload and remote_file. (run_dump_test): Use remote_exec, remote_upload and remote_file. Only check "which $binary" if host is local. (run_ld_link_tests): Use remote_exec, remote_upload and remote_file. * ld-selective/selective.exp: Only check "which $CXX" if host is local. Use remote_exec. * ld-scripts/phdrs.exp: Only check "which $objdump" if host is local. Use run_host_cmd. * ld-scripts/phdrs2.exp: Likewise. * ld-scripts/weak.exp: Likewise. * ld-undefined/weak-undef.exp: Likewise. * ld-scripts/crossref.exp: Only check "which $CC" if host is local. Use run_host_cmd. * ld-scripts/map-address.exp: Upload map_address.map if host is remote. * ld-srec/srec.exp (run_srec_tests): Use run_host_cmd. Only check "which $CC" and "which $CXX" if host is local. * ld-undefined/undefined.exp: Only check "which $CC" if host is local. Use remote_file and run_host_cmd. * config/default.exp: Use remote_exec to create tmpdir.
2007-07-29ld/Alan Modra1-1/+2
* ldlang.c (lang_insert_orphan): When searching through linker script to place an orphan, don't stop on statements that appear outside of SECTIONS. * emultempl/elf32.em (output_rel_find): Prefer read-only alloc sections over read/write alloc sections. ld/testsuite/ * ld-elf/weak-dyn-1.rd: Adjust.
2007-07-13 * ldlang.c (strip_excluded_output_sections): Don't ignore sectionsAlan Modra1-1/+2
with update_dot_tree.
2007-07-12 PR 4782Alan Modra1-4/+3
* ldlang.c (lang_size_sections_1 <output_section_statement>): Only use expld.result when valid.
2007-07-06Update sources to GPLv3Nick Clifton1-8/+8
2007-05-31include/Alan Modra1-5/+3
* bfdlink.h (struct bfd_link_info): Add input_bfds_tail. bfd/ * simple.c (bfd_simple_get_relocated_section_content): Init input_bfds_tail. ld/ * ldlang.c (ldlang_add_file): Use input_bfds_tail. * ldmain.c (main): Init input_bfds_tail. Sort link_info initialization.
2007-05-02commit the Robert's removal of "warning:"Alan Modra1-1/+1
2007-05-01 * ldlang.c (lang_check): Error on architecture mismatch.Alan Modra1-1/+1
2007-04-28 * ldcref.c (struct cref_hash_entry): Make "demangled" const.Alan Modra1-3/+11
(cref_fill_array): Adjust for changed demangler. * ldlang.c (lang_one_common): Likewise.
2007-04-26bfd/Alan Modra1-1/+1
Many files: Include sysdep.h before bfd.h. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. binutils/ * bucumm.h: Split off host dependencies to.. * sysdep.h: ..here. Many files: Include sysdep.h. Remove duplicate headers and reorder. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. ld/ Many files: Include sysdep.h first. Remove duplicate headers. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. opcodes/ * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. * ns32k-dis.c: Include sysdep.h first.
2007-04-19 * ldcref.c (cref_fill_array): Call bfd_demangle rather than demangle.Alan Modra1-1/+2
* ldlang.c (lang_one_common): Likewise. * ldmisc.c (vfinfo): Likewise. (demangle): Delete. * ldmisc.h (demangle): Delete. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate.
2007-04-18ld/Alan Modra1-10/+9
* ldlang.h (enum section_type): Add overlay_section. * ldlang.c (lang_add_section): Handle flags for overlay_section as per normal_section. (lang_size_sections_1): When setting lma, detect overlays by os->sectype rather than by looking for overlapping vmas. (lang_enter_overlay_section): Use overlay_section type. (lang_leave_overlay): Set first overlay section to normal. ld/testsuite/ * ld-spu/ovl.lnk: Use OVERLAY keyword.
2007-04-10bfd/Richard Henderson1-0/+2
* elf64-alpha.c (struct alpha_elf_link_hash_table): Add relax_trip. (elf64_alpha_size_got_sections): Remove unused something_changed local. (elf64_alpha_size_plt_section): Return void. (elf64_alpha_size_rela_got_section): Likewise. (elf64_alpha_relax_section): Only regenerate got+plt if the relax_trip counter has changed. include/ * bfdlink.h (struct bfd_link_info): Add relax_trip. ld/ * ldlang.c (relax_sections): Initialize and increment link_info.relax_trip.
2007-03-29ld/Richard Sandiford1-0/+8
200x-xx-xx Richard Sandiford <richard@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com> * NEWS: Mention -l:foo. * ld.texinfo: Document it. * ldlang.c (new_afile): If a lang_input_file_is_l_enum entry as a name beginning with a coloh, convert it to a lang_input_file_is_search_file_enum entry without the colon. ld/testsuite/ * ld-libs/lib-1.s, ld-libs/lib-2.s, ld-libs/lib-2.d, * ld-libs/libs.exp: New files.
2007-03-26 * Makefile.am: Add dependency on ldemul-list.h for powerpc andAlan Modra1-2/+1
spu target emul files. * configure.in: Check for mkstemp and waitpid. * Makefile.in: Regenerate. * configure: Regenerate. * config.in: Regenerate. * ldlang.c (input_file_chain): Make global. (lang_add_input_file): Don't set lang_has_input_file here. * ldlang.h (input_file_chain): Declare. * emultempl/ppc32elf.em (ppc_recognized_file): New function. (LDEMUL_RECOGNIZED_FILE): Define. * emultempl/ppc64elf.em (ppc64_recognized_file): New function. (LDEMUL_RECOGNIZED_FILE): Define. * emultempl/spuelf.em (struct tflist): New. (tmp_file_list): New var.
2007-03-24ld/Alan Modra1-10/+14
* ldlang.c (lang_insert_orphan): Provide start/stop loadaddr syms rather than defining unconditionally. (lang_leave_overlay_section): Likewise. * ld.texinfo (Overlay Description): Update description and examples for start/stop syms. ld/testsuite/ * ld-elf/overlay.d: -u symbols we want to see in the output.
2007-03-16Use pc-relative relocation instead of an absolute relocation for ↵Nick Clifton1-7/+32
x86_64-pc-mingw32 target.
2007-03-08 * ldlang.c (lang_size_sections_1): Correct backwards dot moveAlan Modra1-7/+9
test to not trigger on overlays. Only warn on backwards move if non-default lma.
2007-02-21Take into account MEMORY regions when creating a segment map.Nick Clifton1-0/+36
2007-02-062007-02-06 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-1/+1
* ldlang.c (lang_size_sections_1): Add a missing `)'.
2007-02-06 * ldlang.c (lang_size_sections_1): Don't warn on backwards dotAlan Modra1-4/+8
move unless section size is non-zero.
2007-01-16bfd/H.J. Lu1-6/+27
2007-01-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/3831 * elf-bfd.h (bfd_elf_link_mark_dynamic_symbol): Add an argument, Elf_Internal_Sym *. * elflink.c (bfd_elf_link_mark_dynamic_symbol): Mark a data symbol dynamic if info->dynamic_data is TRUE. (bfd_elf_record_link_assignment): Updated call to bfd_elf_record_link_assignment. (_bfd_elf_merge_symbol): Likewise. Always call bfd_elf_link_mark_dynamic_symbol. include/ 2007-01-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/3831 * bfdlink.h (bfd_link_info): Rename dynamic to dynamic_list. Add dynamic and dynamic_data. ld/ 2007-01-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/3831 * NEWS: Mention -Bsymbolic-functions, --dynamic-list-data and --dynamic-list-cpp-new. * ld.texinfo: Document -Bsymbolic-functions, --dynamic-list-data and --dynamic-list-cpp-new. * ldlang.c (lang_append_dynamic_list_cpp_new): New. (lang_process): Change link_info.dynamic to link_info.dynamic_list. (lang_append_dynamic_list): Likewise. * ldmain.c (main): Likewise. Initialize link_info.dynamic and link_info.dynamic_data to FALSE. * ldlang.h (lang_append_dynamic_list_cpp_new): New. * lexsup.c (option_values): Add OPTION_DYNAMIC_LIST_DATA and OPTION_DYNAMIC_LIST_CPP_NEW. (ld_options): Add entries for -Bsymbolic-functions, --dynamic-list-data and --dynamic-list-cpp-new. Make -Bsymbolic-functions an alias of --dynamic-list-data. (parse_args): Change link_info.dynamic to link_info.dynamic_list. Set link_info.dynamic to TRUE for --dynamic-list and --dynamic-list-cpp-typeinfo. Handle --dynamic-list-data and --dynamic-list-cpp-new. ld/testsuite/ 2007-01-16 H.J. Lu <hongjiu.lu@intel.com> PR ld/3831 * ld-elf/del.cc: New. * ld-elf/dl5.cc: Likewise. * ld-elf/dl5.out: Likewise. * ld-elf/new.cc: Likewise. * ld-elf/shared.exp: Add tests for --dynamic-list-data and --dynamic-list-cpp-new.
2006-12-12 * ldlang.c (print_output_section_statement): Print load addressAlan Modra1-8/+2
when lma differs from vma. testsuite/ * ld-scripts/overlay-size-map.d: Update.
2006-10-30bfd/H.J. Lu1-4/+4
2006-10-30 H.J. Lu <hongjiu.lu@intel.com> PR ld/3111 * elf-bfd.h (elf_obj_tdata): Add symbuf. (_bfd_elf_section_already_linked): Add struct bfd_link_info *. (_bfd_elf_check_kept_section): Likewise. (bfd_elf_match_symbols_in_sections): Likewise. * elf.c (assign_section_numbers): Updated to add struct bfd_link_info *. (bfd_elf_match_symbols_in_sections): Updated. Cache symbol buffer if info->reduce_memory_overheads is false. * elflink.c (match_group_member): Updated to add struct bfd_link_info *. (_bfd_elf_check_kept_section): Likewise. (elf_link_input_bfd): Likewise. (_bfd_elf_section_already_linked): Likewise. (bfd_elf_final_link): Free symbol buffer if info->reduce_memory_overheads is false. * libbfd-in.h (_bfd_nolink_section_already_linked): Add struct bfd_link_info *. (_bfd_generic_section_already_linked): Likewise. * libbfd.h: Regenerated. * linker.c (bfd_section_already_linked): Add struct bfd_link_info *. (_bfd_generic_section_already_linked): Likewise. * targets.c (bfd_target): Add struct bfd_link_info * to _section_already_linked. * bfd-in2.h: Regenerated. include/ 2006-10-30 H.J. Lu <hongjiu.lu@intel.com> PR ld/3111 * bfdlink.h (bfd_link_info): Add reduce_memory_overheads. ld/ 2006-10-30 H.J. Lu <hongjiu.lu@intel.com> PR ld/3111 * ld.h (args_type): Remove reduce_memory_overheads. * ldlang.c (lang_map): Updated. (section_already_linked): Likewise. (print_input_section): Likewise. * ldmain.c (main): Likewise. * lexsup.c (parse_args): Likewise.
2006-10-27bfd/Alan Modra1-4/+5
* section.c (SEC_KEEP): Update comment. * bfd-in2.h: Regenerate. * elflink.c (bfd_elf_gc_sections): Ignore SEC_EXCLUDE sections. * merge.c (_bfd_merge_sections): Set SEC_KEEP on excluded sections. * stabs.c (_bfd_discard_section_stabs): Likewise. (_bfd_link_section_stabs): Likewise. Simplify abs_section check. ld/ * ldlang.c (lang_map): Don't say SEC_LINKER_CREATED and SEC_KEEP sections have been discarded. (lang_do_version_exports_section): Set SEC_KEEP on export section. * emultempl/elf32.em (before_allocation): Set SEC_KEEP on warning sections.
2006-10-25New Cell SPU port.Alan Modra1-3/+1
2006-10-19bfd/Alan Modra1-12/+6
* elf32-arm.c (bfd_elf32_arm_allocate_interworking_sect): Check, don't set, glue section size. (record_arm_to_thumb_glue): Set glue section size here. (record_thumb_to_arm_glue): Likewise. (bfd_elf32_arm_add_glue_sections_to_bfd): Formatting. (bfd_elf32_arm_process_before_allocation): Ignore exluded sections. ld/ * emultempl/armelf.em (arm_elf_before_allocation): Run gld${EMULATION_NAME}_before_allocation later. * ldlang.c (lang_size_sections_1): Revert 2006-09-15 change.
2006-10-17bfd/Alan Modra1-2/+2
* elf-bfd.h (struct elf_link_hash_table): Reorder. Add text_index_section and data_index_section. (struct elf_backend_data): Add elf_backend_init_index_section. (_bfd_elf_init_1_index_section): Declare. (_bfd_elf_init_2_index_sections): Declare. * elfxx-target.h (elf_backend_init_index_section): Define. (elfNN_bed): Init new field. * elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls section and text_index_section plus data_index_section. (_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections. (_bfd_elf_init_1_index_section): New function. (_bfd_elf_init_2_index_sections): New function. (bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section. (elf_link_input_bfd): When emitting relocs, use text_index_section and data_index_section for removed sections. * elf-m10300.c (elf_backend_omit_section_dynsym): Define. * elf32-i386.c: Likewise. * elf32-m32r.c: Likewise. * elf32-sh.c: Likewise. * elf32-xstormy16.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-mmix.c: Likewise. * elf64-sh64.c: Likewise. * elfxx-ia64.c: Likewise. * elf32-arm.c (elf32_arm_final_link_relocate): Use text_index_section and data_index_section sym for relocs against sections with no dynamic section sym. (elf_backend_init_index_section): Define. * elf32-cris.c: Similarly. * elf32-hppa.c: Similarly. * elf32-i370.c: Similarly. * elf32-m68k.c: Similarly. * elf32-mips.c: Similarly. * elf32-ppc.c: Similarly. * elf32-s390.c: Similarly. * elf32-sparc.c: Similarly. * elf32-vax.c: Similarly. * elf64-mips.c: Similarly. * elf64-ppc.c: Similarly. * elf64-s390.c: Similarly. * elf64-sparc.c: Similarly. * elf64-x86-64.c: Similarly. * elfn32-mips.c: Similarly. * elfxx-mips.c: Similarly. * elfxx-sparc.c: Similarly. * linker.c (fix_syms): Base symbols in removed sections on previous section in preference to using absolute section. ld/ * ldlang.c (strip_excluded_output_sections): Do strip sections that define syms, but don't ignore them. * ld.texinfo (Output Section Discarding): Revise. * emultempl/armcoff.em (gld${EMULATION_NAME}_finish): Always call finish_default. ld/testsuite/ Update for section sym changes.
2006-10-11 * ldlang.c (lang_append_dynamic_list): When appending, add all elementsJakub Jelinek1-1/+4
of the dynamic list rather than just the first entry.
2006-09-27bfd/H.J. Lu1-1/+10
2006-09-26 H.J. Lu <hongjiu.lu@intel.com> PR ld/3223 PR ld/3267 * elf.c (assign_file_positions_for_non_load_sections): Don't warn zero size allocated sections. ld/ 2006-09-26 H.J. Lu <hongjiu.lu@intel.com> PR ld/3223 PR ld/3267 * ld.texinfo: Updated Output Section Discarding. * ldlang.h (lang_output_section_statement_type): Add section_relative_symbol. * ldlang.c (strip_excluded_output_sections): Don't strip a section with a symbol relative to it. (lang_size_sections_1): Mark if an output section has a symbol symbol relative to it. ld/testsuite/ 2006-09-26 H.J. Lu <hongjiu.lu@intel.com> PR ld/3223 PR ld/3267 * ld-scripts/empty-address-1.d: New file. * ld-scripts/empty-address-1.s: Likewise. * ld-scripts/empty-address-1.t: Likewise. * ld-scripts/empty-address-2.s: Likewise. * ld-scripts/empty-address-2a.d: Likewise. * ld-scripts/empty-address-2a.t: Likewise. * ld-scripts/empty-address-2b.d: Likewise. * ld-scripts/empty-address-2b.t: Likewise. * ld-scripts/empty-address-3.s: Likewise. * ld-scripts/empty-address-3a.d: Likewise. * ld-scripts/empty-address-3a.t: Likewise. * ld-scripts/empty-address-3b.d: Likewise. * ld-scripts/empty-address-3b.t: Likewise. * ld-scripts/empty-address-3c.d: Likewise. * ld-scripts/empty-address-3c.t: Likewise. * ld-scripts/empty-address.exp: Likewise.
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.