Commit Graph

164 Commits

Author SHA1 Message Date
Jan Kratochvil 273f4430f8 bfd/
* elf-eh-frame.c (REQUIRE_CLEARED_RELOCS) Remove.
	(_bfd_elf_parse_eh_frame): Do not check relocations for removed FDEs.

ld/testsuite/
	* ld-elf/eh-group2.s: New `.cfi_lsda' referencing `.gcc_except_table'.
	* ld-elf/eh-group.exp: New test and conditional defininiton of `ELF64'.
2009-02-01 12:05:25 +00:00
Nick Clifton ec0c103cff * config/tc-mep.h (DIFF_EXPR_OK): Do not define.
* gas/all/gas.exp: Expect forward test to fail for MeP.
        Expect relax test to fail for MeP.
        * gas/mep/relocs.d: Update expected disassembly.

        * lib/ld-lib.exp (check_gc_sections_available): Add MeP to list of
        targets which do not support garbage collection.
        * ld-srec/srec.exp (run_srec_test): Expect tests to fail for MeP.
        * ld-elf/group8a.d: Likewise.
        * ld-elf/group8b.d: Likewise.
        * ld-elf/group9a.d: Likewise.
        * ld-elf/group9b.d: Likewise.

        * binutils-all/objdump.W: Do not assume that high and low PC
        addresses will have been computed.
2009-01-29 09:03:13 +00:00
H.J. Lu 37034390c9 2009-01-19 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/group9.s: Replace .byte with .long.
2009-01-19 15:52:19 +00:00
H.J. Lu 258795f524 ld/
2009-01-16  H.J. Lu  <hongjiu.lu@intel.com>

	* lexsup.c (option_values): Add OPTION_TTEXT_SEGMENT.
	(ld_options): Add -Ttext-segment.
	(parse_args): Handle OPTION_TTEXT_SEGMENT.

	* ld.texinfo: Document -Ttext-segment.

	* NEWS: Mention -Ttext-segment.

	* scripttempl/elf.sc (TEXT_START_ADDR): Use SEGMENT_START.
	(SHLIB_TEXT_START_ADDR): Likewise.

ld/testsuite/

2009-01-16  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-elf/textaddr1.d: New.
	* ld-elf/textaddr2.d: Likewise.
2009-01-16 14:14:07 +00:00
H.J. Lu a33dafc30d bfd/
2009-01-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/9727
	* elflink.c (elf_gc_sweep): Exclude the group section if the
	first member of the section group is excluded.

ld/testsuite/

2009-01-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/9727
	* ld-elf/group8.s: New.
	* ld-elf/group8a.d: Likewise.
	* ld-elf/group8b.d: Likewise.
	* ld-elf/group9.s: Likewise.
	* ld-elf/group9a.d: Likewise.
	* ld-elf/group9b.d: Likewise.
2009-01-14 21:52:49 +00:00
Alan Modra e497069013 * ld-elf/elf.exp: Save and restore LDFLAGS.
* ld-scripts/default-script.exp: Likewise.
	* ld-scripts/empty-orphan.exp: Likewise, and add to LDFLAGS rather
	than replacing.
	* ld-scripts/include.exp: Set --local-store for SPU.
2009-01-12 13:57:59 +00:00
Jan Kratochvil 80c29487db bfd/
* elflink.c (_bfd_elf_section_already_linked): Handle g++-3.4
	relocations in `.gnu.linkonce.r.*' referencing its `.gnu.linkonce.t.*'.

ld/testsuite/
	* ld-elf/linkoncerdiff.d, ld-elf/linkoncerdiff1.s,
	ld-elf/linkoncerdiff2.s: New.
2009-01-11 21:09:49 +00:00
H.J. Lu 54ac0771d7 bfd/
2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/9679
	* elflink.c (elf_merge_st_other): New.
	(_bfd_elf_merge_symbol): Use it on skipped weak definitions and
	hide them if needed.
	(elf_link_add_object_symbols): Updated.

ld/testsuite/

2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/9679
	* ld-elf/pr9679-1.c: New.
	* ld-elf/pr9679-2.c: Likewise.
	* ld-elf/pr9679.rd: Likewise.

	* ld-elf/shared.exp (build_tests): Add test for libpr9679.so.
2009-01-02 19:29:38 +00:00
H.J. Lu d88805311b bfd/
2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/9676
	* elflink.c (elf_link_add_object_symbols): Update def_dynamic,
	ref_dynamic and dynamic_def fields when setting def_regular
	to 1.

ld/testsuite/

2009-01-02  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/9676
	* ld-elf/pr9676-1.c: New.
	* ld-elf/pr9676-2.c: Likewiswe.
	* ld-elf/pr9676-3.c: Likewiswe.
	* ld-elf/pr9676-4.c: Likewiswe.
	* ld-elf/pr9676.rd: Likewiswe.

	* ld-elf/shared.exp (build_tests): Add tests for libpr9676-1.a,
	libpr9676-2.a, libpr9676-3.so, libpr9676-4.so and
	libpr9676-4a.so.

	* lib/ld-lib.exp (ar_simple_create): New.
	(run_ld_link_tests): Support archive.
	(run_cc_link_tests): Likewiswe.
2009-01-02 16:48:11 +00:00
Nick Clifton 84e94c9023 Add LM32 port. 2008-12-23 19:10:25 +00:00
Nick Clifton 80c35038cb * dwarf.c (display_debug_frames): Change text for uniformity.
(process_debug_info): Likewise.
            (display_debug_aranges): Likewise.  Indent address output.
            (display_debug_pubnames): Print offset in hex.

            * binutils-all/objdump.W: Update.

            * gas/cfi/cfi-alpha-1.d, gas/cfi/cfi-alpha-3.d,
            gas/cfi/cfi-arm-1.d, gas/cfi/cfi-common-1.d,
            gas/cfi/cfi-common-2.d, gas/cfi/cfi-common-3.d,
            gas/cfi/cfi-common-4.d, gas/cfi/cfi-common-5.d,
            gas/cfi/cfi-common-6.d, gas/cfi/cfi-hppa-1.d,
            gas/cfi/cfi-i386-2.d, gas/cfi/cfi-i386.d, gas/cfi/cfi-m68k.d,
            gas/cfi/cfi-mips-1.d, gas/cfi/cfi-ppc-1.d, gas/cfi/cfi-s390-1.d,
            gas/cfi/cfi-s390x-1.d, gas/cfi/cfi-sh-1.d, gas/cfi/cfi-sparc-1.d,
            gas/cfi/cfi-sparc64-1.d, gas/cfi/cfi-x86_64.d: Update for readelf
            change.

            * ld-elf/eh1.d, ld-elf/eh2.d, ld-elf/eh3.d, ld-elf/eh4.d,
            ld-elf/eh5.d, ld-elf/eh6.d, ld-mips-elf/eh-frame1-n32.d,
            ld-mips-elf/eh-frame1-n64.d, ld-mips-elf/eh-frame2-n32.d,
            ld-mips-elf/eh-frame2-n64.d, ld-mips-elf/eh-frame3.d,
            ld-mips-elf/eh-frame4.d: Update for readelf change.
2008-10-06 16:27:35 +00:00
H.J. Lu 936e838972 2008-10-04 H.J. Lu <hongjiu.lu@intel.com>
PR ld/6931
	* ld-elf/group7.d: New.
2008-10-04 14:55:47 +00:00
H.J. Lu 388853f746 binutils/testsuite/
2008-10-03  H.J. Lu  <hongjiu.lu@intel.com>

	* binutils-all/group.s: Updated.
	* binutils-all/group-2.s: Likewise.
	* binutils-all/group-3.s: Likewise.
	* binutils-all/group-4.s: Likewise.
	* binutils-all/strip-7.d: Likewise.
	* binutils-all/strip-9.d: Likewise.

ld/testsuite/

2008-10-03  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-elf/group5.d: Updated.
	* ld-elf/group6.d: Likewise.
2008-10-03 15:08:22 +00:00
Tristan Gingold 5d54918415 2008-10-03 Tristan Gingold <gingold@adacore.com>
* ld-elf/stab.d: Don't run on alpha (to avoid relocation
        overflow on 64 bits targets whose stab values is 32 bits).
2008-10-03 14:13:37 +00:00
H.J. Lu 29b9ceead4 2008-10-03 H.J. Lu <hongjiu.lu@intel.com>
PR ld/6931
	* ld-elf/group4.d: New.
	* ld-elf/group5.d: Likewise.
	* ld-elf/group6.d: Likewise.
2008-10-03 14:08:38 +00:00
Alan Modra ceae84aacf bfd/
PR 6789
	* elf.c (assign_file_positions_for_load_sections): Call
	_bfd_elf_map_sections_to_segments, not elf_modify_segment_map.
	(get_program_header_size): Protect against NULL info.
	(_bfd_elf_map_sections_to_segments): Likewise.
	* elf32-spu.c (spu_elf_additional_program_headers): Likewise.
ld/testsuite/
	* ld-elf/extract-symbol-1sec.d: Correct section lma.
2008-09-29 14:12:02 +00:00
Alan Modra 68db4c759f * ld-elf/eh-group.exp: Only run on ELF targets.
* ld-elf/eh5b.s: Export main, start, __start.
2008-09-25 03:16:42 +00:00
Jan Kratochvil 33aa234e0c Provide virtual target "cfi" for targets supporting CFI.
* ld-elf/eh-frame-hdr.d: Replace target and xfail statements by single
	`target: cfi'.
	* ld-elf/eh-group.exp: Call check_as_cfi instead of is_elf_format.
	* ld-elf/eh-group1.s, elf/eh-group2.s: Use more compatible section
	flags prefix '%'.
	* ld-elf/eh5.d: Replace target statement by `target: cfi' with an Alpha
	exception.  Relax the `Code alignment factor' matching.
	* lib/ld-lib.exp: Rename istarget as istarget_ld.
	(istarget, check_as_cfi): New procedure.
	(run_dump_test): New comment for the virtual target `cfi'.
2008-09-20 08:42:53 +00:00
Jan Kratochvil 2a7b2e88e3 bfd/
PR 6893 - Do not consider FDEs for discarded sections as invalid.
	* elf-eh-frame.c (_bfd_elf_parse_eh_frame): New REQUIRE_CLEARED_RELOCS.
	Consider FDEs with cleared relocations as valid and ignorable.

ld/testsuite/
	* ld-elf/eh-group.exp, ld-elf/eh-group1.s, ld-elf/eh-group2.s: New test.

binutils/
	Suppress warnings on NONE relocations to discarded sections.
	* readelf.c (is_none_reloc): New function.
	(debug_apply_relocations): Ignore is_none_reloc() relocations.
2008-09-17 07:50:29 +00:00
H.J. Lu 0a36a439ee bfd/
2008-09-16  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/6877
	* elflink.c (_bfd_elf_merge_symbol): Allow a common symbol to
	override the function in a shared library.

ld/testsuite/

2008-09-16  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/6877
	* ld-elf/comm1.c: New.
	* ld-elf/func1.c: Likewise.

	* ld-elf/shared.exp: Add tests for libfunc1.so and comm1.
2008-09-16 14:09:34 +00:00
Nick Clifton 8ad82227d0 * ld-elf/sec-to-seg1.s: Shorten test data to align the section to
a 4-byte boundary.
2008-08-17 20:42:53 +00:00
Alan Modra 237dcb538f binutils/
* objcopy.c (copy_object): Don't setup_bfd_headers when extract_symbol.
	(setup_section): Don't zero vma and lma when extract_symbol.
	(copy_section): Discard relocations when extract_symbol.
	* doc/binutils.texi: Update --extract-symbol description.
ld/testsuite/
	* ld-elf/extract-symbol-1sec.d: Update.
2008-08-06 00:42:17 +00:00
Nick Clifton 2e658c8781 * ld-elf/sec-to-seg.exp: New test: Checks the assignment of
sections to segments.
        * ld-elf/sec-to-seg1.s: Test source file.
        * ld-elf/sec-to-seg2.s: Test source file.
        * ld-elf/sec-to-seg-script-same-page.t: Test linker script.
        * ld-elf/sec-to-seg-script-adjoining-pages.t: Test linker script.
        * ld-elf/sec-to-seg-script-disjoint-pages.t: Test linker script.
2008-07-30 10:28:31 +00:00
Alan Modra b26238c07d missed from last commit 2008-05-07 04:52:35 +00:00
Alan Modra 6766b6945a PR 6473
* ld-elf/lma.s, ld-elf/lma.lnk: New test.
	* ld-elf/binutils.exp: Run it.
2008-05-05 01:43:55 +00:00
Daniel Jacobowitz c183e9618c * ld-elf/flags1.d: Adjust for MIPS text alignment. 2008-03-26 16:02:25 +00:00
Alan Modra 4fbb74a605 include/elf/
PR 5900
	* common.h (SHN_BAD): Delete.
	(SHN_LORESERVE .. SHN_HIRESERVE): Move to..
	* external.h: ..here.
	* internal.h (SHN_LORESERVE, SHN_HIRESERVE): Define.
	(SHN_LOPROC, SHN_HIPROC, SHN_LOOS, SHN_HIOS): Define.
	(SHN_ABS, SHN_COMMON, SHN_XINDEX, SHN_BAD): Define.
bfd/
	PR 5900
	* elf-bfd.h: Include elf/internal.h after elf/external.h.
	* elfcode.h (elf_swap_symbol_in): Map reserved shndx range.
	(elf_swap_symbol_out): Adjust SHN_XINDEX test.
	(elf_swap_ehdr_out): Mask SHN_LORESERVE and SHN_XINDEX to values
	seen in external structs.
	(valid_section_index_p): Delete.
	(elf_object_p): Don't increment section numbers over reserved range.
	Simplify test for valid sh_link, sh_info and e_shstrndx fields.
	(elf_write_shdrs_and_ehdr): Mask SHN_LORESERVE and SHN_XINDEX to values
	seen in external structs.  Don't increment section numbers over
	reserved range.
	* elf.c (bfd_elf_sym_name): Remove redundant tests on st_shndx.
	(bfd_section_from_shdr): Likewise.
	(group_signature): Range check before accessing elf_elfsections.
	(_bfd_elf_setup_sections): Likewise.
	(bfd_section_from_shdr): Likewise.
	(bfd_section_from_shdr): Don't increment section number over
	reserved sections.
	(assign_file_positions_for_non_load_sections): Likewise.
	(assign_file_positions_except_relocs): Likewise.
	(_bfd_elf_write_object_contents): Likewise.
	(assign_section_numbers): Likewise.  Adjust for changed SHN_*.
	(prep_headers): Delete unused variable.
	* elflink.c (bfd_elf_link_record_local_dynamic_symbol): Adjust
	for changed SHN_* values.
	(check_dynsym, elf_link_input_bfd): Likewise.
	(bfd_elf_final_link): Likewise.  Don't skip over reserved section
	range.
	(elf_fixup_link_order): Check that sh_link field is valid.
	* elf-hppa.h (elf_hppa_add_symbol_hook): Make "index" unsigned.
	* elf32-arm.c (elf32_arm_gc_mark_extra_sections): Range check before
	accesssing elf_elfsections.
	* elf32-avr.c (elf32_avr_size_stubs): Likewise.
	* elf32-hppa.c (elf32_hppa_size_stubs): Likewise.
	* elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Likewise.
	* elf64-hppa.c (elf64_hppa_check_relocs): Adjust for changed
	SHN_* defines.  Test for SHN_BAD return from
	_bfd_elf_section_from_bfd_section
binutils/
	PR 5900
	* readelf.c (SECTION_HEADER_INDEX, SECTION_HEADER_NUM): Delete.
	Remove use throughout file.
	(SECTION_HEADER): Likewise.
	(dump_relocations): Don't adjust st_shndx for reserved range.
	(process_file_header): Mask SHN_XINDEX to values seen in external
	elf structs.  Simplify valid section index tests.
	(get_32bit_elf_symbols, get_64bit_elf_symbols): Mask SHN_XINDEX.
	Map reserved st_shndx to internal form.
	(process_section_groups): Test that group symbol st_shndx is in
	range, not just non-zero.  Delete reserved range check.
	(get_symbol_index_type): Mask "type" to 16 bits when printing PRC,
	OS or RSV.
gdb/
	PR 5900
	* elfread.c (elf_symtab_read): Make shndx an unsigned int.
	* mipsread.c: Include elf/internal.h.
	(read_alphacoff_dynamic_symtab): Map external reserved sym_shndx
	to internal range.
ld/testsuite/
	PR 5900
	* ld-elf/sec64k.exp: Update.
2008-03-12 08:37:09 +00:00
Mark Mitchell 142b237ba9 ld/testsuite/
* ld-elf/seg.d: Expect .reginfo section on MIPS.
2008-02-22 23:10:45 +00:00
Bob Wilson f8a52b5923 2008-01-31 Marc Gauthier <marc@tensilica.com>
bfd/
	* config.bfd (xtensa*-*-*): Recognize processor variants.
gas/
	* configure.tgt (xtensa*-*-*): Recognize processor variants.
gas/testsuite/
	* gas/all/gas.exp: Recognize Xtensa processor variants.
	* gas/elf/elf.exp: Likewise.
	* gas/lns/lns.exp: Likewise.
ld/
	* configure.tgt (xtensa*-*-*): Recognize processor variants.
ld/testsuite/
	* ld-elf/merge.d: Recognize Xtensa processor variants.
	* ld-xtensa/coalesce.exp: Likewise.
	* ld-xtensa/lcall.exp: Likewise.
2008-02-01 17:58:48 +00:00
H.J. Lu 2dc4cec1f3 binutils/
2008-01-28  H.J. Lu  <hongjiu.lu@intel.com>

	* dwarf.c: Include "elf/common.h".
	(eh_addr_size): Changed to int.
	(dwarf_regnames_i386): New.
	(dwarf_regnames_x86_64): Likewise.
	(dwarf_regnames): Likewise.
	(dwarf_regnames_count): Likewise.
	(init_dwarf_regnames): Likewise.
	(regname): Likewise.
	(frame_display_row): Properly support different address size.
	Call regname to get register name.
	(display_debug_frames): Call regname to get register name.
	Display DW_CFA_def_cfa_register as DW_CFA_def_cfa_register
	instead of DW_CFA_def_cfa_reg.

	* dwarf.h (init_dwarf_regnames): New.

	* objdump.c: Include "elf-bfd.h".
	(dump_dwarf): Call init_dwarf_regnames on ELF input.

	* readelf.c (guess_is_rela): Change argument to int.
	(parse_args): Remove the undocumented upper case options for
	-wX.
	(process_file_header): Call init_dwarf_regnames if
	do_dwarf_register is true.

gas/testsuite/

2008-01-28  H.J. Lu  <hongjiu.lu@intel.com>

	* gas/cfi/cfi-alpha-1.d: Replace DW_CFA_def_cfa_reg with
	DW_CFA_def_cfa_register.
	* gas/cfi/cfi-alpha-3.d: Likewise.
	* gas/cfi/cfi-hppa-1.d: Likewise.
	* gas/cfi/cfi-i386.d: Likewise.
	* gas/cfi/cfi-m68k.d: Likewise.
	* gas/cfi/cfi-mips-1.d: Likewise.
	* gas/cfi/cfi-sh-1.d: Likewise.
	* gas/cfi/cfi-sparc-1.d: Likewise.
	* gas/cfi/cfi-sparc64-1.d: Likewise.
	* gas/cfi/cfi-x86_64.d: Likewise.

	* gas/cfi/cfi-common-1.d: Updated for i386/x86-64 register
	names.
	* gas/cfi/cfi-common-2.d: Likewise.
	* gas/cfi/cfi-common-5.d: Likewise.
	* gas/cfi/cfi-i386.d: Likewise.
	* gas/cfi/cfi-x86_64.d: Likewise.

ld/testsuite/

2008-01-28  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-elf/eh1.d: Replace DW_CFA_def_cfa_reg with
	DW_CFA_def_cfa_register. Updated for i386/x86-64 register
	names.
	* ld-elf/eh2.d: Likewise.
	* ld-elf/eh3.d: Likewise.
	* ld-elf/eh4.d: Likewise.
	* ld-elf/eh5.d: Likewise.
2008-01-28 15:15:32 +00:00
Alan Modra 8ee35d562f * ld-elf/loadaddr.t: New, extracted from..
* ld-elf/loadaddr1.t: ..here.  Use insert.
	* ld-elf/loadaddr2.t: Likewise.
	* ld-elf/loadaddr1.d: Update.
	* ld-elf/loadaddr2.d: Update.
2008-01-26 02:57:06 +00:00
Richard Sandiford 184d07da89 bfd/
PR ld/5526
	* elf-bfd.h (eh_cie_fde): Add u.cie.u.full_cie and u.cie.merged
	fields.  Rename u.cie.u.merged to u.cie.u.merged_with.
	(eh_frame_sec_info): Add a cies field.
	(eh_frame_hdr_info): Add a merge_cies field.
	* elf-eh-frame.c (cie): Add a reloc_index member to the personality
	union.
	(_bfd_elf_begin_eh_frame_parsing): Set hdr_info->merge_cies instead
	of hdr_info->cies.
	(_bfd_elf_parse_eh_frame): Remove tmp_cie.  Ccreate an array of
	cie structures in all cases and use it instead of extended_cies.
	If merging, store the cie array in sec_info->cies and point each
	CIE's eh_fde_cie at the associated element.  Do not try to
	calculate the value of the personality routine here; record the
	offset of the relocation instead.  Do not merge CIEs here.
	(_bfd_elf_end_eh_frame_parsing): Do not free hdr_info->cies here...
	(_bfd_elf_discard_section_eh_frame_hdr): ...do it here instead.
	(_bfd_elf_gc_mark_fdes): Mark the original (unmerged) CIE.
	(find_merged_cie): New function.
	(_bfd_elf_gc_mark_fdes): Use it.  Free sec_info->cies.

ld/testsuite/
	PR ld/5526
	* ld-elf/eh6.s, ld-elf/eh6.d: New test.
2008-01-09 09:36:11 +00:00
H.J. Lu ace7938838 bfd/
2008-01-07  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/5522
	* elflink.c (elf_link_input_bfd): Don't write out a section if
	its output section is marked with SEC_NEVER_LOAD.

ld/testsuite/

2008-01-07  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/5522
	* ld-elf/noload-3.d: New file.
	* ld-elf/noload-3.s: Likewise.
	* ld-elf/noload-3.t: Likewise.
2008-01-07 16:45:35 +00:00
Nick Clifton e9e9cead3f * ld-elf/flags1.d: Add xfails for ports for which the test will work.
* ld-mn10300/i143317.s: New test - checks linker relaxation when  symbols
  are in a merged section.
* ld-mn10300/i143317.d: Expected disassembly.
* ld-mn10300/i143317.t: Linker map.
* ld-mn10300/mn10300.exp (mn10300_tests): Add the i143317 test.
2007-12-31 11:29:01 +00:00
H.J. Lu 0efc80c807 bfd/
2007-12-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/5488
	* elf.c (IS_NOTE): New.
	(IS_COREFILE_NOTE): Use IS_NOTE.
	(IS_SECTION_IN_INPUT_SEGMENT): Use IS_NOTE instead of
	IS_COREFILE_NOTE.

ld/testsuite/

2007-12-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/5488
	* ld-elf/note-2.d: New.
	* ld-elf/note-2.s: Likewise.
	* ld-elf/note-2.t: Likewise.
2007-12-24 16:58:23 +00:00
Hans-Peter Nilsson 63c2c2877b * ld-elf/seg.d: Restrict to linux and vxworks. 2007-12-20 11:36:56 +00:00
H.J. Lu 4be84a55a2 2007-12-19 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/seg.d: Adjusted for 64bit targets.
2007-12-19 15:54:06 +00:00
Nathan Sidwell d3cfff61d7 * ld-elf/seg.t: New.
* ld-elf/seg.d: New.
	* ld-elf/seg.s: New.
2007-12-19 10:22:02 +00:00
Nick Clifton 592d601cd7 oops - omitted from previous delta 2007-11-20 16:58:47 +00:00
Nick Clifton 430a16a51d * elflink.c (elf_link_output_extsym): Weaken assertion: if --gc-section is set, there may be no TLS segment.
* lib/ld-lib.exp (check_gc_sections_available): New proc, based on the version in gcc/testsuite/lib/target-supports.exp.
* ld-elf/eld.exp: Use check_gc_sections_available.
2007-11-20 15:08:25 +00:00
Hans-Peter Nilsson 69b7238f06 * ld-elf/flags1.d: Generalize regexp for section size. 2007-11-14 10:11:12 +00:00
H.J. Lu e6760bcc53 2007-11-13 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/5233
	* ld-elf/flags1.d: New.
	* ld-elf/flags1.ld: Likewise.
	* ld-elf/flags1.s: Likewise.
2007-11-13 13:20:02 +00:00
Alan Modra 9a5e27bd96 * ld-elf/merge3.d, ld-elf/merge3.s: Delete. 2007-11-05 02:14:50 +00:00
Joseph Myers e6c6c8f39c bfd:
* merge.c (sec_merge_hash_lookup): Add parameter sec_end.  Check
	for unterminated strings.  All callers changed.
	(record_section): Add parameter abfd.  Give error message for
	unterminated strings.
	(_bfd_merge_sections): Update call to record_section.
	(_bfd_write_merged_section, _bfd_merged_section_offset): Handle
	NULL secinfo from merge failures.

ld/testsuite:
	* ld-elf/merge3.d, ld-elf/merge3.s: New.
2007-11-01 11:45:20 +00:00
H.J. Lu 6bd1a22c3e binutils/
2007-10-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/4476
	* readelf.c (print_dynamic_symbol): New.
	(process_symbol_table): Handle DT_GNU_HASH for dynamic symbols.

ld/testsuite/

2007-10-09  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/4476
	* ld-elf/hash.d: Check "-s -D" for readelf.
2007-10-09 13:32:50 +00:00
H.J. Lu b10a8ae01c bfd/
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-09-18 00:25:07 +00:00
Joseph Myers 7f6a71ffb6 bfd:
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-08-28 13:21:58 +00:00
Alan Modra 48f2ff543d ld/
* 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-29 12:33:38 +00:00
Richard Sandiford eb07545517 Remove unnecessary symbols from last commit. 2007-07-23 10:04:01 +00:00
Richard Sandiford a26587bab5 bfd/
* elflink.c (_bfd_elf_fix_symbol_flags): Only assert the type
	of weakdef->root.type if weakdef has no regular definition.

ld/testsuite/
	* ld-elf/weak-dyn-1a.s, ld-elf/weak-dyn-1b.s, ld-elf/weak-dyn-1.ld,
	* ld-elf/weak-dyn-1.rd: New test.
	* ld-elf/elf.exp: Run it.
2007-07-23 09:56:19 +00:00