backend does not provide a function for creating dynamic sections
then fail.
(bfd_elf_final_link): Issue a warning message if a dynamic section
has the SHT_NOTE type.
(bfd_elf_final_link): Do not look for dynamic strings in a section
that does not have the SHT_STRTAB type or the name .dynstr.
* elf32-arm.c (elf32_arm_finish_dynamic_sections): Fail if the got
section is not in the output binary.
* elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Likewise.
* ld-elf/elf.exp: Add test for linking a shared library with a
broken linker script that marks dynamic sections as being notes.
* ld-elf/note-3.s: New test source file.
* ld-elf/note-3.t: New test linker script.
* ld-elf/note-3.l: Expected output from the linker.
* lib/ld-lib.exp (run_ld_link_tests): Improve description.
bfd/
* elf32-arm.c (elf32_arm_final_link_relocate): Only do bl conversion
for known functions.
(elf32_arm_swap_symbol_in): Only set ST_BRANCH_TO_ARM for function
symbols.
include/elf/
* arm.h (arm_st_branch_type): Add ST_BRANCH_UNKNOWN.
ld/testsuite/
* ld-arm/cortex-a8-far.d: Adjust expected output.
* ld-arm/arm-call1.s: Give function symbol correct type.
* ld-arm/arm-call2.s: Ditto.
* ld-arm/farcall-group4.s: Ditto.
* ld-arm/arm-elf.exp (cortex-a8-far): Define far symbols with correct
type via assembly file.
* ld-arm/cortex-a8-far-3.s: New file.
* ld-arm/abs-call-1.s: Add Thumb tests
* elflink.c (elf_link_add_object_symbols): Process .gnu.warning
sections when building shared libraries.
* lib/ld-lib.exp (run_cc_link_tests): Add an optional 8th
parameter - an expected warning message from the linker.
* ld-elf/shared.exp (build_tests): Expect a warning message when
building the libbarw.so library.
* ld-elf/shared.exp: Run library building tests even when not
building a native toolchain.
2011-05-16 H.J. Lu <hongjiu.lu@intel.com>
* ld-scripts/phdrs.exp: Replace --private with
--private-headers for objdump.
* ld-scripts/phdrs2.exp: Likewise.
* elfxx-mips.c (_bfd_mips_elf_check_relocs): Record both local and
global GOT entries for GOT_PAGE relocations against global symbols.
ld/testsuite/
* lib/ld-lib.exp (run_ld_link_tests): Simplify pass/fail logic.
Fail if the link command fails and if no test rules are defined.
* ld-mips-elf/reloc-6a.s, ld-mips-elf/reloc-6b.s: New tests.
* ld-mips-elf/mips-elf.exp: Run them.
default_ld_assemble.
(ld_assemble_flags): New function.
* ld-elf/frame.exp: Pass -mpic and -mpid flags to the assembler on
tic6x.
* ld-elf/exclude.exp: Likewise.
* lib/ld-lib.exp (default_ld_assemble): Take extra argument in_flags
and pass it to the assembler.
PR ld/12365
* cofflink.c (bfd_coff_link_input_bfd): Check for and warn about
references to symbols defined in discarded sections.
ld/ChangeLog:
PR ld/12365
* scripttempl/pe.sc (__rt_psrelocs_start): New symbol definition.
(__rt_psrelocs_end): Likewise.
(__rt_psrelocs_size): Likewise difference between the above.
(__RUNTIME_PSEUDO_RELOC_LIST_END__): Move outside .rdata section
immediately after end of pseudo-reloc data.
(___RUNTIME_PSEUDO_RELOC_LIST_END___): Likewise.
(__RUNTIME_PSEUDO_RELOC_LIST__): Move outside .rdata section and
calculate backward from list end.
(___RUNTIME_PSEUDO_RELOC_LIST___): Likewise.
* scripttempl/pep.sc: Likewise.
ld/testsuite/ChangeLog:
PR ld/12365
* ld-plugin/plugin-7.d: Allow underscore in error message.
* ld-plugin/plugin-8.d: Likewise.
* elf32-arm.c (cortex_a8_erratum_scan): If the stub is a Thumb
branch to a PLT entry, redirect it to the PLT's Thumb entry point.
ld/testsuite/
* ld-arm/cortex-a8-fix-b-plt.s, ld-arm/cortex-a8-fix-b-plt.d,
ld-arm/cortex-a8-fix-bcc-plt.s, ld-arm/cortex-a8-fix-bcc-plt.d,
ld-arm/cortex-a8-fix-bl-plt.s, ld-arm/cortex-a8-fix-bl-plt.d,
ld-arm/cortex-a8-fix-blx-plt.s, ld-arm/cortex-a8-fix-blx-plt.d,
ld-arm/cortex-a8-fix-plt.ld: New tests.
* ld-arm/arm-elf.exp: Run them.
* elf32-tic6x.c (elf32_tic6x_final_link): New function.
(elf32_tic6x_merge_attributes): Do not warn for PID or PIC
mismatch. Choose the lower of the two values.
(bfd_elf32_bfd_final_link): New macro.
ld/testsuite/
* ld-tic6x/shared-nopic.d: New test.
* ld-tic6x/shared-nopid.d: New test.
* ld-tic6x/attr-pid-21.d: Don't expect a warning; check readelf
output instead.
* ld-tic6x/attr-pid-12.d: Likewise.
* ld-tic6x/attr-pic-01.d: Likewise.
* ld-tic6x/attr-pic-10.d: Likewise.
* ld-tic6x/attr-pid-01.d: Likewise.
* ld-tic6x/attr-pid-10.d: Likewise.
* ld-tic6x/attr-pid-02.d: Likewise.
* ld-tic6x/attr-pid-20.d: Likewise.
* ld-tic6x/got-reloc-inrange.d: Pass -mpic and -mpid options to gas.
(dwcfi_hash): New static hash variable.
(get_debugseg_name): New.
(alloc_debugseg_item): New.
(make_debug_seg): New.
(dwcfi_hash_insert): New.
(dwcfi_hash_find): New.
(dwcfi_hash_find_or_make): New.
(cfi_insn_data): New member cur_seg.
(cie_entry): Likewise.
(fde_entry): New cseg and handled members.
(alloc_fde_entry): Initialize cseg member.
(alloc_cfi_insn_data): Initialize cur_seg member.
(dot_cfi_sections): Compare for beginning of
section names via strncmp.
(get_cfi_seg): New.
(cfi_finish): Treat link-once sections.
(is_now_linkonce_segment): New local helper.
(output_cie): Ignore cie entries not member of current
segment.
(output_fde): Likewise.
(select_cie_for_fde): Likewise.
(cfi_change_reg_numbers): Add new argument for current segment
and ignore insn elements, if not part of current segment.
* ehopt.c (get_cie_info): Use strncmp for
section name matching.
(heck_eh_frame): Likewise.
* coffcode.h (sec_to_styp_flags): Allow linkonce for
debugging sections.
* scripttempl/pe.sc: Handle .eh_frame($|.)* sections.
* scripttempl/pep.sc: Likewise.
* ld-pe/pe.exp: Add cfi/cfi32 tests.
* ld-pe/cfi.d: New.
* ld-pe/cfi32.d: New.
* ld-pe/cfia.s: New.
* ld-pe/cfib.s: New.