aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
AgeCommit message (Collapse)AuthorFilesLines
2013-10-03aarch64: Add support for GNU indirect functions.Will Newton72-1/+919
Add support for STT_GNU_IFUNC symbols to the AArch64 bfd backend. The tests are ported from the ld-ifunc tests but are enabled for cross builds so can be run easily without hardware or a simulator. bfd/ChangeLog: 2013-10-03 Will Newton <will.newton@linaro.org> * configure: Regenerate. * configure.in: Build elf-ifunc.o for AArch64. * elfnn-aarch64.c: Include objalloc.h. (elfNN_aarch64_local_htab_hash): New function. (elfNN_aarch64_local_htab_eq): New function. (elfNN_aarch64_get_local_sym_hash): New function. (elfNN_aarch64_link_hash_table_create): Initialize local STT_GNU_IFUNC symbol hash. (elfNN_aarch64_hash_table_free): Free local STT_GNU_IFUNC symbol hash. (elfNN_aarch64_final_link_relocate): Add sym argument. Add support for handling STT_GNU_IFUNC symbols. (elfNN_aarch64_gc_sweep_hook): Add support for garbage collecting references to STT_GNU_IFUNC symbols. (elfNN_aarch64_adjust_dynamic_symbol): Add support for handling STT_GNU_IFUNC symbols. (elfNN_aarch64_check_relocs): Add support for handling STT_GNU_IFUNC symbols. Ensure we don't increase plt.refcount from -1 to 0. (elfNN_aarch64_post_process_headers): Call _bfd_elf_set_osabi. (elfNN_aarch64_is_function_type): Remove function. (elfNN_aarch64_allocate_dynrelocs): Handle STT_GNU_IFUNC symbols. (elfNN_aarch64_allocate_ifunc_dynrelocs): New function. (elfNN_aarch64_allocate_local_dynrelocs): New function. (elfNN_aarch64_allocate_local_ifunc_dynrelocs): New function. (elfNN_aarch64_size_dynamic_sections): Call elfNN_aarch64_allocate_local_dynrelocs. (elfNN_aarch64_create_small_pltn_entry): Add info argument. Add support for creating .iplt entries for STT_GNU_IFUNC symbols. (elfNN_aarch64_finish_dynamic_symbol): Add support for handling STT_GNU_IFUNC symbols and .iplt. (elfNN_aarch64_finish_local_dynamic_symbol): New function. (elfNN_aarch64_finish_dynamic_sections): Call elfNN_aarch64_finish_local_dynamic_symbol. ld/ChangeLog: 2013-10-03 Will Newton <will.newton@linaro.org> * emulparams/aarch64elf.sh: Add IREL_IN_PLT. * emulparams/aarch64elf32.sh: Likewise. ld/testsuite/ChangeLog: 2013-10-03 Will Newton <will.newton@linaro.org> * ld-ifunc/ifunc.exp: Enable ifunc tests for AArch64. * ld-aarch64/aarch64-elf.exp: Run ifunc tests. * ld-aarch64/ifunc-1-local.d: New file. * ld-aarch64/ifunc-1-local.s: Likewise. * ld-aarch64/ifunc-1.d: Likewise. * ld-aarch64/ifunc-1.s: Likewise. * ld-aarch64/ifunc-10.d: Likewise. * ld-aarch64/ifunc-10.s: Likewise. * ld-aarch64/ifunc-11.d: Likewise. * ld-aarch64/ifunc-11.s: Likewise. * ld-aarch64/ifunc-12.d: Likewise. * ld-aarch64/ifunc-12.s: Likewise. * ld-aarch64/ifunc-13.d: Likewise. * ld-aarch64/ifunc-13a.s: Likewise. * ld-aarch64/ifunc-13b.s: Likewise. * ld-aarch64/ifunc-14a.d: Likewise. * ld-aarch64/ifunc-14a.s: Likewise. * ld-aarch64/ifunc-14b.d: Likewise. * ld-aarch64/ifunc-14b.s: Likewise. * ld-aarch64/ifunc-14c.d: Likewise. * ld-aarch64/ifunc-14c.s: Likewise. * ld-aarch64/ifunc-14d.d: Likewise. * ld-aarch64/ifunc-14e.d: Likewise. * ld-aarch64/ifunc-14f.d: Likewise. * ld-aarch64/ifunc-15.d: Likewise. * ld-aarch64/ifunc-15.s: Likewise. * ld-aarch64/ifunc-16.d: Likewise. * ld-aarch64/ifunc-16.s: Likewise. * ld-aarch64/ifunc-17a.d: Likewise. * ld-aarch64/ifunc-17a.s: Likewise. * ld-aarch64/ifunc-17b.d: Likewise. * ld-aarch64/ifunc-17b.s: Likewise. * ld-aarch64/ifunc-18a.d: Likewise. * ld-aarch64/ifunc-18a.s: Likewise. * ld-aarch64/ifunc-18b.d: Likewise. * ld-aarch64/ifunc-18b.s: Likewise. * ld-aarch64/ifunc-19a.d: Likewise. * ld-aarch64/ifunc-19a.s: Likewise. * ld-aarch64/ifunc-19b.d: Likewise. * ld-aarch64/ifunc-19b.s: Likewise. * ld-aarch64/ifunc-2-local.d: Likewise. * ld-aarch64/ifunc-2-local.s: Likewise. * ld-aarch64/ifunc-2.d: Likewise. * ld-aarch64/ifunc-2.s: Likewise. * ld-aarch64/ifunc-20.d: Likewise. * ld-aarch64/ifunc-20.s: Likewise. * ld-aarch64/ifunc-3.s: Likewise. * ld-aarch64/ifunc-3a.d: Likewise. * ld-aarch64/ifunc-3b.d: Likewise. * ld-aarch64/ifunc-4.d: Likewise. * ld-aarch64/ifunc-4.s: Likewise. * ld-aarch64/ifunc-4a.d: Likewise. * ld-aarch64/ifunc-5-local.s: Likewise. * ld-aarch64/ifunc-5.s: Likewise. * ld-aarch64/ifunc-5a-local.d: Likewise. * ld-aarch64/ifunc-5a.d: Likewise. * ld-aarch64/ifunc-5b-local.d: Likewise. * ld-aarch64/ifunc-5b.d: Likewise. * ld-aarch64/ifunc-5r-local.d: Likewise. * ld-aarch64/ifunc-6.s: Likewise. * ld-aarch64/ifunc-6a.d: Likewise. * ld-aarch64/ifunc-6b.d: Likewise. * ld-aarch64/ifunc-7.s: Likewise. * ld-aarch64/ifunc-7a.d: Likewise. * ld-aarch64/ifunc-7b.d: Likewise. * ld-aarch64/ifunc-7c.d: Likewise. * ld-aarch64/ifunc-8.d: Likewise. * ld-aarch64/ifunc-8a.s: Likewise. * ld-aarch64/ifunc-8b.s: Likewise. * ld-aarch64/ifunc-9.d: Likewise. * ld-aarch64/ifunc-9.s: Likewise.
2013-09-24bfd/Richard Sandiford39-114/+139
2013-09-24 Gregory Fong <gregory.0xf0@gmail.com> * elfxx-mips.c (mips_elf_create_got_section): Hide _GLOBAL_OFFSET_TABLE_. ld/testsuite/ 2013-09-24 Gregory Fong <gregory.0xf0@gmail.com> * ld-mips-elf/eh-frame5.d, ld-mips-elf/jalx-2.dd, ld-mips-elf/mips-elf.exp, ld-mips-elf/mips16-pic-2.ad, ld-mips-elf/mips16-pic-2.nd, ld-mips-elf/pic-and-nonpic-3a.dd, ld-mips-elf/pic-and-nonpic-3b.ad, ld-mips-elf/pic-and-nonpic-3b.dd, ld-mips-elf/pic-and-nonpic-3b.nd, ld-mips-elf/pic-and-nonpic-4b.ad, ld-mips-elf/pic-and-nonpic-4b.nd, ld-mips-elf/pic-and-nonpic-4b.rd, ld-mips-elf/pic-and-nonpic-5b.ad, ld-mips-elf/pic-and-nonpic-5b.nd, ld-mips-elf/pic-and-nonpic-6-n32.ad, ld-mips-elf/pic-and-nonpic-6-n32.dd, ld-mips-elf/pic-and-nonpic-6-n32.nd, ld-mips-elf/pic-and-nonpic-6-n64.ad, ld-mips-elf/pic-and-nonpic-6-n64.dd, ld-mips-elf/pic-and-nonpic-6-n64.nd, ld-mips-elf/pic-and-nonpic-6-o32.ad, ld-mips-elf/pic-and-nonpic-6-o32.dd, ld-mips-elf/pic-and-nonpic-6-o32.nd, ld-mips-elf/rel32-n32.d, ld-mips-elf/rel32-o32.d, ld-mips-elf/rel64.d, ld-mips-elf/tls-multi-got-1.got, ld-mips-elf/tls-multi-got-1.r, ld-mips-elf/tlsdyn-o32-1.d, ld-mips-elf/tlsdyn-o32-1.got, ld-mips-elf/tlsdyn-o32-2.d, ld-mips-elf/tlsdyn-o32-2.got, ld-mips-elf/tlsdyn-o32-3.d, ld-mips-elf/tlsdyn-o32-3.got, ld-mips-elf/tlsdyn-o32.d, ld-mips-elf/tlsdyn-o32.got, ld-mips-elf/tlslib-o32-ver.got, ld-mips-elf/tlslib-o32.got: Update for removal of _GLOBAL_OFFSET_TABLE_ from .dynsym.
2013-09-182013-09-18 Kyrylo Tkachov <kyrylo.tkachov@arm.com>Kyrylo Tkachov2-4/+9
* ld-aarch64/eh-frame.d: Update expected output to allow for 64-bit addresses.
2013-09-12 * dwarf.c (dwarf_vmatoa): Rename to dwarf_vmatoa_1 and add aNick Clifton10-262/+275
precision parameter. (dwarf_vmatoa): New wrapper for dwarf_vmatoa_1. (print_dwarf_vma): Use dwarf_vmatoa_1. (SAFE_BYTE_GET): Add check that VAL is big enough to contain AMOUNT bytes. (process_debug_info): Use an unsigned int for the offset size. (process_debug_pubnames): Likewise. (display_debug_aranges): Likewise. (struct Frame_Chunk): Use dwarf_vma type for pc_begin and pc_range fields. (frame_display_row): Use print_dwarf_vma to display dwarf_vma values. (display_debug_frames): Likewise. * binutils-all/x86-64/compressed-1a.d: Update expected output to allow for 64-bit addresses. * ld-elf/eh1.d: Update expected output to allow for 64-bit addresses. * ld-elf/eh2.d: Likewise. * ld-elf/eh3.d: Likewise. * ld-elf/eh4.d: Likewise. * ld-elf/eh5.d: Likewise. * ld-elf/eh6.d: Likewise. * ld-mips-elf/eh-frame1-n64.d: Likewise. * ld-mips-elf/eh-frame2-n64.d: Likewise. * ld-mips-elf/eh-frame3.d: Likewise. * gas/cfi/cfi-alpha-1.d: Update expected output to allow for 64-bit addresses. * gas/cfi/cfi-alpha-3.d: Likewise. * gas/cfi/cfi-arm-1.d: Likewise. * gas/cfi/cfi-common-1.d: Likewise. * gas/cfi/cfi-common-2.d: Likewise. * gas/cfi/cfi-common-3.d: Likewise. * gas/cfi/cfi-common-4.d: Likewise. * gas/cfi/cfi-common-5.d: Likewise. * gas/cfi/cfi-common-6.d: Likewise. * gas/cfi/cfi-common-7.d: Likewise. * gas/cfi/cfi-hppa-1.d: Likewise. * gas/cfi/cfi-i386-2.d: Likewise. * gas/cfi/cfi-i386.d: Likewise. * gas/cfi/cfi-m68k.d: Likewise. * gas/cfi/cfi-mips-1.d: Likewise. * gas/cfi/cfi-ppc-1.d: Likewise. * gas/cfi/cfi-s390-1.d: Likewise. * gas/cfi/cfi-s390x-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.
2013-09-04ld/testsuite/Yufeng Zhang2-1/+5
2013-09-04 Vidya Praveen <vidyapraveen@arm.com> * ld-arm/export-class.exp: Fix the condition.
2013-08-29 * elf64-x86-64.c (elf_x86_64_check_tls_transition): AllowJakub Jelinek12-12/+435
64-bit -mcmodel=large -fpic TLS GD and LD sequences. (elf_x86_64_relocate_section): Handle -mcmodel=large -fpic TLS GD and LD sequences in GD->LE, GD->IE and LD->LE transitions. ld/testsuite/ * ld-x86-64/x86-64.exp: Add tlsld3, tlsgd7 and tlsgd8 tests. * ld-x86-64/tlspic1.s: Add -mcmodel=large -fpic TLS GD and LD sequences. * ld-x86-64/tlspic.dd: Adjusted. * ld-x86-64/tlspic.rd: Adjusted. * ld-x86-64/tlspic-nacl.rd: Adjusted. * ld-x86-64/tlsld3.dd: New test. * ld-x86-64/tlsld3.s: New file. * ld-x86-64/tlsgd7.dd: New test. * ld-x86-64/tlsgd7.s: New file. * ld-x86-64/tlsgd8.dd: New test. * ld-x86-64/tlsgd8.s: New file.
2013-08-26bfd/Roland McGrath8-9/+21
* archures.c (bfd_mach_i386_nacl, bfd_mach_i386_i386_nacl): New macros. (bfd_mach_x86_64_nacl, bfd_mach_x64_32_nacl): New macros. * cpu-i386.c (bfd_arch_i386_onebyte_nop_fill): New function. (bfd_i386_nacl_arch): New variable. (bfd_x86_64_nacl_arch, bfd_x64_32_nacl_arch): New variables. (bfd_x64_32_arch_intel_syntax): Link them into the list. * bfd-in2.h: Regenerate. ld/ * emulparams/elf_i386_nacl.sh (ARCH): Set to i386:nacl. * emulparams/elf_x86_64_nacl.sh (ARCH): Set to i386:x86-64:nacl. * emulparams/elf32_x86_64_nacl.sh (ARCH): Set to i386:x64-32:nacl. ld/testsuite/ * ld-x86-64/x86-64.exp (Mixed x86_64 and i386 input test 1): Loosen string match to admit i386:x86-64*. (Mixed x86_64 and i386 input test 2): Likewise. * ld-x86-64/ilp32-2.d: Likewise. * ld-x86-64/ilp32-3.d: Likewise. * ld-x86-64/lp64-2.d: Likewise. * ld-x86-64/lp64-3.d: Likewise. * ld-x86-64/ia32-2.d: Likewise, and i386.* too. * ld-x86-64/ia32-3.d: Likewise.
2013-08-26bfd/Roland McGrath6-5/+22
* elf-nacl.c (nacl_modify_segment_map): Fix logic reordering the elf_segment_map list. If an executable segment is page-aligned but does not end with a full page, then append a fake section into the segment map entry that pads out the page. (nacl_final_write_processing): New function. Write the code fill laid out in nacl_modify_segment_map. * elf-nacl.h: Declare it. * elf32-arm.c (elf32_arm_nacl_final_write_processing): New function. (elf_backend_final_write_processing): Define it for NaCl backend. * elf32-i386.c (elf_backend_final_write_processing): Likewise. * elf64-x86-64.c (elf_backend_final_write_processing): Likewise. * elf-nacl.c (segment_eligible_for_headers): Rename MAXPAGESIZE parameter to MINPAGESIZE. (nacl_modify_segment_map): Use minpagesize instead of maxpagesize. * elf32-arm.c (ELF_MINPAGESIZE, ELF_COMMONPAGESIZE): Set to 0x10000 for NaCl targets. ld/testsuite/ * ld-x86-64/ilp32-4-nacl.d: Loosen .shstrtab line regexp to match any file offset. * ld-x86-64/tlsbin-nacl.rd: Update expected code segment PT_LOAD. * ld-x86-64/tlsbindesc-nacl.rd: Likewise. * ld-scripts/rgn-at3.d: XFAIL for *-*-nacl* targets. * ld-scripts/rgn-over8-ok.d: Likewise.
2013-08-24 * ld-elf/comm-data.exp: Use check_shared_lib_support rather thanMaciej W. Rozycki9-21/+96
explicit patterns for test target qualification. Define extra tool flags for *-*-hpux* and tic6x-*-* targets. Link with a linker script. Use alternative patterns for targets that do not eliminate copy relocs, currently mn10300-*-* and vax-*-*. * ld-elf/comm-data2.s: Handle HPUX's `.comm' syntax. * ld-elf/comm-data2.ld: New test linker script. * ld-elf/comm-data2.xd: Match section's VMA too. Ignore ASCII data dump. * ld-elf/comm-data2r.rd: New test pattern. * ld-elf/comm-data2r.sd: New test pattern. * ld-elf/comm-data2r.xd: New test pattern. * ld-mips-elf/comm-data.exp: Use check_shared_lib_support rather than an explicit pattern for test target qualification. Link with a linker script.
2013-08-24 * ld-arm/export-class.exp: Handle non-EABI targets.Maciej W. Rozycki2-3/+13
2013-08-23ld/testsuite/Roland McGrath6-10/+18
* ld-x86-64/ilp32-4-nacl.d: Update for 2013-05-31 gas alignment change. * ld/testsuite/ld-x86-64/tlsbin-nacl.rd: Likewise. * ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd: Likewise. * ld/testsuite/ld-x86-64/tlsdesc-nacl.rd: Likewise. * ld/testsuite/ld-x86-64/tlspic-nacl.rd: Likewise.
2013-08-23 PR binutils/15834Nick Clifton2-1/+6
Fix typos: --- bfd/bfdio.c | 2 +- bfd/elf32-spu.c | 2 +- bfd/elfnn-aarch64.c | 2 +- binutils/od-xcoff.c | 2 +- config/tcl.m4 | 2 +- gas/config/tc-ia64.c | 2 +- gas/config/tc-sparc.c | 2 +- gas/config/tc-z80.c | 12 ++++++------ gas/doc/c-i386.texi | 6 +++--- gas/doc/c-m32r.texi | 2 +- gas/testsuite/gas/d10v/instruction_packing.d | 2 +- gas/testsuite/gas/z80/atend.d | 2 +- gold/object.h | 2 +- include/gdb/remote-sim.h | 2 +- include/opcode/ChangeLog | 2 +- include/opcode/i960.h | 2 +- ld/testsuite/ld-mips-elf/mips16-pic-1.inc | 2 +- opcodes/aarch64-asm.c | 2 +- opcodes/aarch64-dis.c | 2 +- opcodes/msp430-dis.c | 2 +-
2013-08-22 * ld-powerpc/powerpc.exp: Substitute for le in options_regsub(ld).Alan Modra17-71/+93
Correct ppc64elftests option replacement. (supports_ppc64): Match elf64lppc too. * ld-powerpc/relbrlt.d: Update for little-endian. * ld-powerpc/symtocbase.d: Likewise. * ld-powerpc/tls.t: Likewise. * ld-powerpc/tlsexetoc.g: Likewise. * ld-powerpc/tlsso.d: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlstoc.t: Likewise. * ld-powerpc/tlstocso.d: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-powerpc/tlstocso.t: Likewise. * ld-powerpc/tocopt.d: Likewise. * ld-powerpc/tocopt2.d: Likewise. * ld-powerpc/tocopt3.d: Likewise. * ld-powerpc/tocopt4.d: Likewise. * ld-powerpc/tocopt5.d: Likewise.
2013-08-15 * ldexp.c: Add LOG2CEIL() builtin function to linker script languageNick Clifton4-0/+49
* ldgram.y: Likewise * ldlex.l: Likewise * NEWS: Mention the new feature. * ld.texinfo: Document the new feature. * ld-scripts/log2.exp: New: Run the new log2 test. * ld-scripts/log2.s: Source for the new test. * ld-scripts/log2.t: Linker script for new test.
2013-08-14 PR ld/15787Nick Clifton12-25/+61
* elf32-arm.c (elf32_arm_final_link_relocate): Use origin of output segment containing the relocating symbol instead of assuming 0 for sb group relocations. * ld-arm/group-relocs-ldr-bad.s: Redefine bar into foo section beyond 16 bit offset width. * ld-arm/group-relocs-ldrs-bad.s: Likewise. * ld-arm/group-relocs-ldr-bad.d: Adjust expected result. * ld-arm/group-relocs-ldrs-bad.d: Likewise. * ld-arm/group-relocs.s: Add comments. Move symbols used for sb group relocations into .data section. Drop section zero. Use pc/r0 as base register when pc/sb group relocations are used. * ld-arm/group-relocs.d: Adjust expected result. * ld-arm/group-relocs-alu-bad-2.d: New test for sb group relocation. * ld-arm/group-relocs-ldc-bad-2.d: Likewise. * ld-arm/group-relocs-ldr-bad-2.d: New test for pc group relocation. * ld-arm/group-relocs-ldrs-bad-2.d: Likewise. * ld-arm/unresolved-2.d: Add sb relocation failure test. * ld-arm/group-relocs-alu-bad-2.s: New test source. * ld-arm/group-relocs-ldr-bad-2.s: Likewise. * ld-arm/group-relocs-ldrs-bad-2.s: Likewise. * ld-arm/group-relocs-ldc-bad-2.s: Likewise. * ld-arm/unresolved-2.s: Likewise. * ld-arm/arm-elf.exp: For group-relocs, drop section zero start definition. Run the new tests.
2013-08-09 * elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if G10Nick Clifton2-0/+6
flag bits do not match. (rl78_elf_print_private_bfd_data): Describe G10 flag. * readelf.c (get_machine_flags): Handle RL78 G10 flag. * config/tc-rl78.c (elf_flags): New variable. (enum options): Add OPTION_G10. (md_longopts): Add mg10. (md_parse_option): Parse -mg10. (rl78_elf_final_processing): New function. * config/tc-rl78.c (tc_final_processing): Define. * doc/c-rl78.texi: Document -mg10 option. * rl78.c (E_FLAG_RL78_G10): Define. * lib/ld-lib.exp (check_shared_lib_support): Note that the RL78 does not support shared library generation.
2013-07-31 PR ld/15787Nick Clifton16-43/+164
* elf32-arm.c (elf32_arm_final_link_relocate): Base SB on the output section VMA. * ld-arm/group-relocs-alu-bad-2.d; New. * ld-arm/group-relocs-alu-bad-2.s: New. * ld-arm/group-relocs-ldc-bad-2.d: New. * ld-arm/group-relocs-ldc-bad-2.s: New. * ld-arm/group-relocs-ldr-bad-2.d: New. * ld-arm/group-relocs-ldr-bad-2.s: New. * ld-arm/group-relocs-ldrs-bad-2.d: New. * ld-arm/group-relocs-ldrs-bad-2: New. * ld-arm/arm-elf.exp: Add the new tests. * ld-arm/group-relocs-ldr-bad.d: Update expected output. * ld-arm/group-relocs-ldr-bad.s: Likewise. * ld-arm/group-relocs-ldrs-bad.d: Likewise. * ld-arm/group-relocs-ldrs-bad.s: Likewise. * ld-arm/group-relocs.d: Likewise. * ld-arm/group-relocs.s: Likewise.
2013-07-27 * ld-vax-elf/export-class-call.dd: New test.Maciej W. Rozycki15-0/+262
* ld-vax-elf/export-class-call.rd: New test. * ld-vax-elf/export-class-call.xd: New test. * ld-vax-elf/export-class-data.dd: New test. * ld-vax-elf/export-class-data.rd: New test. * ld-vax-elf/export-class-data.xd: New test. * ld-vax-elf/export-class.ld: New test linker script. * ld-vax-elf/export-class-call.s: New test source. * ld-vax-elf/export-class-data.s: New test source. * ld-vax-elf/export-class-def.s: New test source. * ld-vax-elf/vax-elf.exp: Run the new tests. * ld-vax-elf/vax-export-class.rd: New test. * ld-vax-elf/vax-export-class.xd: New test. * ld-vax-elf/export-class.exp: New test script.
2013-07-27 bfd/Maciej W. Rozycki7-0/+78
* elf32-vax.c (elf_vax_check_relocs) <R_VAX_GOT32, R_VAX_PLT32>: Don't check symbol visibility here. Remove a check already asserted for. (elf_vax_instantiate_got_entries): Use SYMBOL_REFERENCES_LOCAL instead of individual checks. (elf_vax_relocate_section) <R_VAX_GOT32, R_VAX_PLT32>: Only check the offset to decide if produce a GOT or PLT entry. Remove redundant assertions. Remove code to produce GOT entries for local symbols. Remove a duplicate comment and add a comment on GOT relocations. (elf_vax_finish_dynamic_symbol): Remove code to produce RELATIVE dynamic relocs. ld/testsuite/ * ld-vax-elf/got-local-exe.xd: New test. * ld-vax-elf/got-local-lib.xd: New test. * ld-vax-elf/got-local-aux.s: New test source. * ld-vax-elf/got-local-def.s: New test source. * ld-vax-elf/got-local-ref.s: New test source. * ld-vax-elf/vax-elf.exp: Run the new tests.
2013-07-24Check .gnu.warning section in shared libraryH.J. Lu4-5/+18
PR ld/15762 * ld-elf/shared.exp (build_tests): Check .gnu.warning section in the libbarw.so library. * ld-elf/libbarw.rd: New. * lib/ld-lib.exp (run_cc_link_tests): Support checking on output with warning message.
2013-07-23oops - omitted from previous deltaNick Clifton1-0/+3
2013-07-22oops - omitted fromn previous deltaNick Clifton4-0/+12
2013-07-22 * ld-scripts/script.exp: Use run_dump_test instead ofNick Clifton2-13/+12
ld_simple_link to check the error message. * ld-scripts/align-with-input.d: New file. * ld-scripts/region-alias-1.d: Likewise. * ld-scripts/region-alias-2.d: Likewise. * ld-scripts/region-alias-3.d: Likewise. * ld-scripts/region-alias-4.d: Likewise.
2013-07-19oops - omitted from previous deltaNick Clifton1-0/+12
2013-07-19 * ldgram.y: Add ALIGN_WITH_INPUT output section attribute.Nick Clifton4-2/+30
* ldlang.c: Likewise. * ldlang.h: Likewise. * ldlex.l: Likewise. * mri.c: Likewise. * ld.texinfo: Document new feature. * NEWS: Mention new feature. * ld-scripts/script.exp: Run align with input test. * ld-scripts/align-with-input.t: New file. * ld-scripts/rgn-at8.d: Likewise. * ld-scripts/rgn-at8.t: Likewise.
2013-07-18 * elf32-arm.c (arm_type_of_stub): Don't use ST_BRANCH_TO_ARM forNick Clifton3-2/+7
thumb only targets. (elf32_arm_final_link_relocate): Likewise. * ld-arm/thumb-b-lks-sym.d: Updated to be more flexible. * ld-arm/thumb-bl-lks-sym.d: Likewise.
2013-07-18 * elf32-arm.c (elf32_arm_stub_long_branch_arm_nacl): New variable.Nick Clifton5-171/+283
(elf32_arm_stub_long_branch_arm_nacl_pic): New variable. (arm_build_one_stub): Increase MAXRELOCS to 3. (arm_type_of_stub): Use them if GLOBALS->nacl_p. (struct elf32_arm_link_hash_table): Give add_stub_section member's pointee type a third argument. (elf32_arm_create_or_find_stub_sec): Update caller. (elf32_arm_size_stubs): Update argument type. * bfd-in.h (elf32_arm_size_stubs): Update decl. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * emultempl/armelf.em (elf32_arm_add_stub_section): Take third argument ALIGNMENT_POWER, use it instead of constant 3. * ld-arm/farcall-arm-nacl.d: New file. * ld-arm/farcall-arm-nacl-pic.d: New file. * ld-arm/farcall-data-nacl.d: New file. * ld-arm/arm-elf.exp (armeabitests_common): Add extra element to "action" lists for those cases to use a different dump file for NaCl targets. Massage $armeabitests_common to drop the extra element or the one before it, depending on [istarget "arm*-*-nacl*"]. * ld-arm/arm-elf.exp (armelftests_common): Move all "Cortex-A8 erratum fix", Thumb-only and interworking cases to ... (armelftests_nonacl): ... here. (armeabitests_common): Move all "erratum 760522 fix", Thumb-only and interworking cases to ... (armeabitests_nonacl): ... here.
2013-07-12 include/elf/Maciej W. Rozycki8-0/+51
* mips.h (EF_MIPS_NAN2008): New macro. bfd/ * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Handle EF_MIPS_NAN2008. (_bfd_mips_elf_print_private_bfd_data): Likewise. binutils/ * readelf.c (get_machine_flags): Handle EF_MIPS_NAN2008. gas/ * config/tc-mips.c (mips_flag_nan2008): New variable. (options): Add OPTION_NAN enum value. (md_longopts): Handle it. (md_parse_option): Likewise. (s_nan): New function. (mips_elf_final_processing): Handle EF_MIPS_NAN2008. (md_show_usage): Add -mnan. * doc/as.texinfo (Overview): Add -mnan. * doc/c-mips.texi (MIPS Opts): Document -mnan. (MIPS NaN Encodings): New node. Document .nan directive. (MIPS-Dependent): List the new node. gas/testsuite/ * gas/mips/nan-2008-1.d: New test. * gas/mips/nan-2008-2.d: New test. * gas/mips/nan-2008-3.d: New test. * gas/mips/nan-2008-4.d: New test. * gas/mips/nan-legacy-1.d: New test. * gas/mips/nan-legacy-2.d: New test. * gas/mips/nan-legacy-3.d: New test. * gas/mips/nan-legacy-4.d: New test. * gas/mips/nan-legacy-5.d: New test. * gas/mips/nan-error-1.l: New list test. * gas/mips/nan-error-2.l: New list test. * gas/mips/nan-2008-override.s: New test source. * gas/mips/nan-2008.s: New test source. * gas/mips/nan-legacy-override.s: New test source. * gas/mips/nan-legacy.s: New test source. * gas/mips/nan-error-1.s: New test source. * gas/mips/nan-error-2.s: New test source. * gas/mips/mips.exp: Run the new tests. ld/testsuite/ * ld-mips-elf/nan-2008.d: New test. * ld-mips-elf/nan-legacy.d: New test. * ld-mips-elf/nan-mixed-1.d: New test. * ld-mips-elf/nan-mixed-2.d: New test. * ld-mips-elf/nan-2008.s: New test source. * ld-mips-elf/nan-legacy.s: New test source.
2013-07-052013-07-05 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>Andreas Krebbel5-0/+49
bfd/ * elf32-s390.c: Rewrite GOT accesses using larl if possible. * elf64-s390.c: Likewise. ld/testsuite/ * ld-s390/gotreloc-1.s: New file. * ld-s390/gotreloc-1.ver: New file. * ld-s390/gotreloc_31-1.dd: New file. * ld-s390/gotreloc_64-1.dd: New file. * ld-s390/s390.exp: Run the new tests. Run 31 bit tests also on 64 bit.
2013-07-03[PATCH, COMMITTED] [AArch64] Replace the :got_prel19: address modifier with ↵Marcus Shawcroft3-3/+7
:got:
2013-07-02[AArch64] Fix creation of .got and placement of _GLOBAL_OFFSET_TABLE_Marcus Shawcroft8-17/+27
2013-07-02[AArch64] Adjust testcases for move of &_DYNAMIC to got[0].Marcus Shawcroft9-15/+15
2013-07-01Adjust ld-x86-64/tlsg.sdH.J. Lu2-1/+5
* ld-x86-64/tlsg.sd: Adjusted.
2013-06-28Handle R_X86_64_DTPOFF64H.J. Lu3-1/+8
bfd/ PR ld/15685 * elf64-x86-64.c (elf_x86_64_relocate_section): Handle R_X86_64_DTPOFF64. ld/testsuite/ PR ld/15685 * ld-x86-64/tlsg.s: Add a test for R_X86_64_DTPOFF64. * ld-x86-64/tlsg.sd: Updated.
2013-06-24 bfd/Maciej W. Rozycki13-27/+49
* elfxx-mips.h (_bfd_mips_elf_get_synthetic_symtab): New prototype. * elf32-mips.c (elf_backend_plt_sym_val): Remove macro. (bfd_elf32_get_synthetic_symtab): New macro. * elfxx-mips.c (plt_entry): New structure. (mips_elf_link_hash_entry): Add use_plt_entry member. (mips_elf_link_hash_table): Rename plt_entry_size member to plt_mips_entry_size. Add plt_comp_entry_size, plt_mips_offset, plt_comp_offset, plt_got_index entries and plt_header_is_comp members. (STUB_LW_MICROMIPS, STUB_MOVE_MICROMIPS): New macros. (STUB_LUI_MICROMIPS, STUB_JALR_MICROMIPS): Likewise. (STUB_ORI_MICROMIPS, STUB_LI16U_MICROMIPS): Likewise. (STUB_LI16S_MICROMIPS): Likewise. (MICROMIPS_FUNCTION_STUB_NORMAL_SIZE): Likewise. (MICROMIPS_FUNCTION_STUB_BIG_SIZE): Likewise. (micromips_o32_exec_plt0_entry): New variable. (mips16_o32_exec_plt_entry): Likewise. (micromips_o32_exec_plt_entry): Likewise. (mips_elf_link_hash_newfunc): Initialize use_plt_entry. (mips_elf_output_extsym): Update to use gotplt_union's plist member rather than offset. (mips_elf_gotplt_index): Likewise. Remove the VxWorks restriction. Use MIPS_ELF_GOT_SIZE to calculate GOT address. (mips_elf_count_got_symbols): Update to use gotplt_union's plist member rather than offset. (mips_elf_calculate_relocation): Handle MIPS16/microMIPS PLT entries. (_bfd_mips_elf_create_dynamic_sections): Don't set PLT sizes here. (mips_elf_make_plt_record): New function. (_bfd_mips_elf_check_relocs): Update comment. Record occurences of JAL relocations that might need a PLT entry. (_bfd_mips_elf_adjust_dynamic_symbol): Update to use gotplt_union's plist member rather than offset. Set individual PLT entry sizes here. Handle MIPS16/microMIPS PLT entries. Don't set the symbol's value in the symbol table for PLT references here. Don't set the PLT or PLT GOT section sizes here. (mips_elf_estimate_stub_size): Handle microMIPS stubs. (mips_elf_allocate_lazy_stub): Likewise. (mips_elf_lay_out_lazy_stubs): Likewise. Define a _MIPS_STUBS_ magic symbol. (mips_elf_set_plt_sym_value): New function. (_bfd_mips_elf_size_dynamic_sections): Set PLT header size and PLT and PLT GOT section sizes here. Set the symbol values in the symbol table for PLT references here. Handle microMIPS annotation of the _PROCEDURE_LINKAGE_TABLE_ magic symbol. (_bfd_mips_elf_finish_dynamic_symbol): Update to use gotplt_union's plist member rather than offset. Handle MIPS16/microMIPS PLT entries. Handle microMIPS stubs. (_bfd_mips_vxworks_finish_dynamic_symbol): Update to use gotplt_union's plist member rather than offset. Use MIPS_ELF_GOT_SIZE to calculate GOT address. (mips_finish_exec_plt): Handle microMIPS PLT. Return status. (_bfd_mips_elf_finish_dynamic_sections): Handle result from mips_finish_exec_plt. (_bfd_mips_elf_link_hash_table_create): Update to use gotplt_union's plist member rather than offset. (_bfd_mips_elf_get_synthetic_symtab): New function. include/elf/ * mips.h (ELF_ST_IS_MIPS_PLT): Respect STO_MIPS16 setting. (ELF_ST_SET_MIPS_PLT): Likewise. gdb/ * mips-tdep.c (mips_elf_make_msymbol_special): Handle MIPS16 and microMIPS synthetic symbols. ld/ * emulparams/elf32btsmip.sh: Arrange for .got.plt to be placed as close to .plt as possible. * scripttempl/elf.sc: Handle $INITIAL_READWRITE_SECTIONS and $PLT_NEXT_DATA variables. ld/testsuite/ * ld-mips-elf/jalx-2.dd: Update for microMIPS PLT support. * ld-mips-elf/pic-and-nonpic-3a.dd: Update for the _MIPS_STUBS_ magic symbol. * ld-mips-elf/pic-and-nonpic-3b.dd: Likewise. * ld-mips-elf/pic-and-nonpic-6-n32.dd: Likewise. * ld-mips-elf/pic-and-nonpic-6-n64.dd: Likewise. * ld-mips-elf/pic-and-nonpic-6-o32.dd: Likewise. * ld-mips-elf/stub-dynsym-1-10000.d: Likewise. * ld-mips-elf/stub-dynsym-1-2fe80.d: Likewise. * ld-mips-elf/stub-dynsym-1-7fff.d: Likewise. * ld-mips-elf/stub-dynsym-1-8000.d: Likewise. * ld-mips-elf/stub-dynsym-1-fff0.d: Likewise. * ld-mips-elf/tlslib-o32.d: Likewise. opcodes/ * mips-dis.c (is_mips16_plt_tail): New function. (print_insn_mips16): Handle MIPS16 PLT entry's GOT slot address word. (is_compressed_mode_p): Handle MIPS16/microMIPS PLT entries.
2013-06-19aarch64: Revert AArch64 ifunc changes.Will Newton72-845/+75
The AArch64 ifunc patch introduced a regression caused by incorrect PLT layout. Revert it until a fix is verified. bfd/ChangeLog: 2013-06-19 Will Newton <will.newton@linaro.org> * configure: Regenerated. * configure.in: Remove aarch64 dependency on elf-ifunc.c. * elf64-aarch64.c: Remove objalloc.h include. (elf64_aarch64_howto_dynrelocs): Remove R_AARCH64_IRELATIVE howto. (struct elf64_aarch64_link_hash_table): Remove ifunc related members. (elf_aarch64_local_htab_hash): Remove function. (elf_aarch64_local_htab_eq): Remove function. (elf_aarch64_get_local_sym_hash): Remove function. (elf64_aarch64_link_hash_table_create): Remove local hash table initialization. (elf64_aarch64_final_link_relocate): Remove sym argument and handling of ifunc symbols. (elf64_aarch64_relocate_section): Don't pass sym argument to elf64_aarch64_final_link_relocate. (elf64_aarch64_gc_sweep_hook): Remove handling of ifunc symbols. (elf64_aarch64_adjust_dynamic_symbol): Likewise. (elf64_aarch64_check_relocs): Likewise. (elf64_aarch64_post_process_headers): Remove call to _bfd_elf_set_osabi. (elf64_aarch64_is_function_type): New function. (elf64_aarch64_allocate_dynrelocs): Remove handling of ifunc symbols. (elf_aarch64_allocate_local_dynrelocs): Remove function. (elf64_aarch64_size_dynamic_sections): Remove call to elf_aarch64_allocate_local_dynrelocs. (elf64_aarch64_create_small_pltn_entry): Remove info argument. Remove creation of R_AARCH64_IRELATIVE dynamic relocs. (elf64_aarch64_finish_dynamic_symbol): Remove handling of ifunc symbols. (elf_aarch64_finish_local_dynamic_symbol): Remove function. (elf64_aarch64_finish_dynamic_sections): Remove call to elf_aarch64_finish_local_dynamic_symbol. (elf64_aarch64_add_symbol_hook): Remove function. include/elf/ChangeLog: 2013-06-19 Will Newton <will.newton@linaro.org> * aarch64.h: Remove R_AARCH64_IRELATIVE. ld/ChangeLog: 2013-06-19 Will Newton <will.newton@linaro.org> * emulparams/aarch64elf.sh: Remove IREL_IN_PLT. ld/testsuite/ChangeLog: 2013-06-19 Will Newton <will.newton@linaro.org> * ld-aarch64/aarch64-elf.exp: Remove ifunc tests. * ld-ifunc/ifunc.exp: Disable ifunc tests on AArch64. * ld-aarch64/ifunc-1-local.d: Remove. * ld-aarch64/ifunc-1-local.s: Likewise. * ld-aarch64/ifunc-1.d: Likewise. * ld-aarch64/ifunc-1.s: Likewise. * ld-aarch64/ifunc-10.d: Likewise. * ld-aarch64/ifunc-10.s: Likewise. * ld-aarch64/ifunc-11.d: Likewise. * ld-aarch64/ifunc-11.s: Likewise. * ld-aarch64/ifunc-12.d: Likewise. * ld-aarch64/ifunc-12.s: Likewise. * ld-aarch64/ifunc-13.d: Likewise. * ld-aarch64/ifunc-13a.s: Likewise. * ld-aarch64/ifunc-13b.s: Likewise. * ld-aarch64/ifunc-14a.d: Likewise. * ld-aarch64/ifunc-14a.s: Likewise. * ld-aarch64/ifunc-14b.d: Likewise. * ld-aarch64/ifunc-14b.s: Likewise. * ld-aarch64/ifunc-14c.d: Likewise. * ld-aarch64/ifunc-14c.s: Likewise. * ld-aarch64/ifunc-14d.d: Likewise. * ld-aarch64/ifunc-14e.d: Likewise. * ld-aarch64/ifunc-14f.d: Likewise. * ld-aarch64/ifunc-15.d: Likewise. * ld-aarch64/ifunc-15.s: Likewise. * ld-aarch64/ifunc-16.d: Likewise. * ld-aarch64/ifunc-16.s: Likewise. * ld-aarch64/ifunc-17a.d: Likewise. * ld-aarch64/ifunc-17a.s: Likewise. * ld-aarch64/ifunc-17b.d: Likewise. * ld-aarch64/ifunc-17b.s: Likewise. * ld-aarch64/ifunc-18a.d: Likewise. * ld-aarch64/ifunc-18a.s: Likewise. * ld-aarch64/ifunc-18b.d: Likewise. * ld-aarch64/ifunc-18b.s: Likewise. * ld-aarch64/ifunc-19a.d: Likewise. * ld-aarch64/ifunc-19a.s: Likewise. * ld-aarch64/ifunc-19b.d: Likewise. * ld-aarch64/ifunc-19b.s: Likewise. * ld-aarch64/ifunc-2-local.d: Likewise. * ld-aarch64/ifunc-2-local.s: Likewise. * ld-aarch64/ifunc-2.d: Likewise. * ld-aarch64/ifunc-2.s: Likewise. * ld-aarch64/ifunc-20.d: Likewise. * ld-aarch64/ifunc-20.s: Likewise. * ld-aarch64/ifunc-3.s: Likewise. * ld-aarch64/ifunc-3a.d: Likewise. * ld-aarch64/ifunc-3b.d: Likewise. * ld-aarch64/ifunc-4.d: Likewise. * ld-aarch64/ifunc-4.s: Likewise. * ld-aarch64/ifunc-4a.d: Likewise. * ld-aarch64/ifunc-5-local.s: Likewise. * ld-aarch64/ifunc-5.s: Likewise. * ld-aarch64/ifunc-5a-local.d: Likewise. * ld-aarch64/ifunc-5a.d: Likewise. * ld-aarch64/ifunc-5b-local.d: Likewise. * ld-aarch64/ifunc-5b.d: Likewise. * ld-aarch64/ifunc-5r-local.d: Likewise. * ld-aarch64/ifunc-6.s: Likewise. * ld-aarch64/ifunc-6a.d: Likewise. * ld-aarch64/ifunc-6b.d: Likewise. * ld-aarch64/ifunc-7.s: Likewise. * ld-aarch64/ifunc-7a.d: Likewise. * ld-aarch64/ifunc-7b.d: Likewise. * ld-aarch64/ifunc-7c.d: Likewise. * ld-aarch64/ifunc-8.d: Likewise. * ld-aarch64/ifunc-8a.s: Likewise. * ld-aarch64/ifunc-8b.s: Likewise. * ld-aarch64/ifunc-9.d: Likewise. * ld-aarch64/ifunc-9.s: Likewise.
2013-06-17ld/testsuite: Enable ifunc tests on AArch64 big-endian.Will Newton40-39/+81
ld/testsuite/ChangeLog: 2013-06-17 Will Newton <will.newton@linaro.org> * ld-aarch64/ifunc-1-local.d: Enable test on aarch64_be. * ld-aarch64/ifunc-1.d: Likewise. * ld-aarch64/ifunc-10.d: Likewise. * ld-aarch64/ifunc-11.d: Likewise. * ld-aarch64/ifunc-12.d: Likewise. * ld-aarch64/ifunc-13.d: Likewise. * ld-aarch64/ifunc-14a.d: Likewise. * ld-aarch64/ifunc-14b.d: Likewise. * ld-aarch64/ifunc-14c.d: Likewise. * ld-aarch64/ifunc-14d.d: Likewise. * ld-aarch64/ifunc-14e.d: Likewise. * ld-aarch64/ifunc-14f.d: Likewise. * ld-aarch64/ifunc-15.d: Likewise. * ld-aarch64/ifunc-16.d: Likewise. * ld-aarch64/ifunc-17a.d: Likewise. * ld-aarch64/ifunc-17b.d: Likewise. * ld-aarch64/ifunc-18a.d: Likewise. * ld-aarch64/ifunc-18b.d: Likewise. * ld-aarch64/ifunc-19a.d: Likewise. * ld-aarch64/ifunc-19b.d: Likewise. * ld-aarch64/ifunc-2-local.d: Likewise. * ld-aarch64/ifunc-2.d: Likewise. * ld-aarch64/ifunc-20.d: Likewise. * ld-aarch64/ifunc-3a.d: Likewise. * ld-aarch64/ifunc-3b.d: Likewise. * ld-aarch64/ifunc-4.d: Likewise. * ld-aarch64/ifunc-4a.d: Likewise. * ld-aarch64/ifunc-5a-local.d: Likewise. * ld-aarch64/ifunc-5a.d: Likewise. * ld-aarch64/ifunc-5b-local.d: Likewise. * ld-aarch64/ifunc-5b.d: Likewise. * ld-aarch64/ifunc-5r-local.d: Likewise. * ld-aarch64/ifunc-6a.d: Likewise. * ld-aarch64/ifunc-6b.d: Likewise. * ld-aarch64/ifunc-7a.d: Likewise. * ld-aarch64/ifunc-7b.d: Likewise. * ld-aarch64/ifunc-8.d: Likewise. * ld-aarch64/ifunc-9.d: Likewise. * ld-ifunc/ifunc.exp: Likewise.
2013-06-14bfd/Yufeng Zhang3-0/+25
* elf64-aarch64.c (elf64_aarch64_final_link_relocate): Call aarch64_resolve_relocation and bfd_elf_aarch64_put_addend to handle the relocations of R_AARCH64_JUMP26, R_AARCH64_CALL26, R_AARCH64_LD64_GOT_LO12_NC, R_AARCH64_ADR_GOT_PAGE and R_AARCH64_GOT_LD_PREL19. ld/testsuite/ * ld-aarch64/aarch64-elf.exp: Add 'ifunc-7c'. * ld-aarch64/ifunc-7c.d: New test.
2013-06-14ld/Yufeng Zhang7-10/+18
* emulparams/aarch64elf.sh: Add IREL_IN_PLT. ld/testsuite/ * ld-aarch64/ifunc-1-local.d: Replace hard-coded immediate offset with regexp. * ld-aarch64/ifunc-1.d: Likewise. * ld-aarch64/ifunc-2-local.d: Likewise. * ld-aarch64/ifunc-2.d: Likewise. * ld-aarch64/ifunc-3a.d: Likewise. * ld-aarch64/ifunc-2-local.s: Change not to declare __GI_foo and foo global.
2013-06-13 PR ld/15302Nick Clifton7-2/+72
* elf32-arm.c (allocate_dynrelocs_for_symbol): Transform ST_BRANCH_TO_ARM into ST_BRANCH_TO_THUMB if the target only supports thumb instructions. PR ld/15302 * ld-arm/branch-lks-sym.ld: New script. * ld-arm/thumb-b-lks-sym.s: New test. * ld-arm/thumb-b-lks-sym.d: Expected disassembly. * ld-arm/thumb-bl-lks-sym.s: New test. * ld-arm/thumb-bl-lks-sym.d: Expected disassembly. * ld-arm/arm-elf.exp: Run the new tests.
2013-06-07aarch64: Add support for GNU indirect functions.Will Newton71-1/+901
Add support for STT_GNU_IFUNC symbols to the AArch64 bfd backend. The tests are ported from the ld-ifunc tests but are enabled for cross builds so can be run easily without hardware or a simulator. bfd/ChangeLog: 2013-06-07 Will Newton <will.newton@linaro.org> * configure: Regenerate. * configure.in: Build elf-ifunc.o for AArch64. * elf64-aarch64.c: Include objalloc.h. (elf64_aarch64_howto_dynrelocs): Add R_AARCH64_IRELATIVE howto. (struct elf64_aarch64_link_hash_table): Add members for handling R_AARCH64_IRELATIVE relocations. (elf_aarch64_local_htab_hash): New function. (elf_aarch64_local_htab_eq): New function. (elf_aarch64_get_local_sym_hash): New function. (elf64_aarch64_link_hash_table_create): Initialize local STT_GNU_IFUNC symbol hash. (elf64_aarch64_hash_table_free): Free local STT_GNU_IFUNC symbol hash. (elf64_aarch64_final_link_relocate): Add sym argument. Add support for handling STT_GNU_IFUNC symbols. (elf64_aarch64_gc_sweep_hook): Add support for garbage collecting references to STT_GNU_IFUNC symbols. (elf64_aarch64_adjust_dynamic_symbol): Add support for handling STT_GNU_IFUNC symbols. (elf64_aarch64_check_relocs): Add support for handling STT_GNU_IFUNC symbols. Ensure we don't increase plt.refcount from -1 to 0. (elf64_aarch64_post_process_headers): Call _bfd_elf_set_osabi. (elf64_aarch64_is_function_type): Remove function. (elf64_aarch64_allocate_dynrelocs): Call _bfd_elf_allocate_ifunc_dyn_relocs for STT_GNU_IFUNC symbols. (elf_aarch64_allocate_local_dynrelocs): New function. (elf64_aarch64_size_dynamic_sections): Call elf_aarch64_allocate_local_dynrelocs. Initialize next_irelative_index. (elf64_aarch64_create_small_pltn_entry): Add info argument. Add support for creating .iplt entries for STT_GNU_IFUNC symbols. (elf64_aarch64_finish_dynamic_symbol): Add support for handling STT_GNU_IFUNC symbols and .iplt. (elf_aarch64_finish_local_dynamic_symbol): New function. (elf64_aarch64_finish_dynamic_sections): Call elf_aarch64_finish_local_dynamic_symbol. (elf64_aarch64_add_symbol_hook): New function. include/elf/ChangeLog: 2013-06-07 Will Newton <will.newton@linaro.org> * aarch64.h: Add R_AARCH64_IRELATIVE reloc. ld/ChangeLog: 2013-06-07 Will Newton <will.newton@linaro.org> * emulparams/aarch64elf.sh: Add IREL_IN_PLT. ld/testsuite/ChangeLog: 2013-06-07 Will Newton <will.newton@linaro.org> * ld-ifunc/ifunc.exp: Enable ifunc tests for AArch64. * ld-aarch64/aarch64-elf.exp: Add ifunc tests. * ld-aarch64/ifunc-1-local.d: New file. * ld-aarch64/ifunc-1-local.s: Likewise. * ld-aarch64/ifunc-1.d: Likewise. * ld-aarch64/ifunc-1.s: Likewise. * ld-aarch64/ifunc-10.d: Likewise. * ld-aarch64/ifunc-10.s: Likewise. * ld-aarch64/ifunc-11.d: Likewise. * ld-aarch64/ifunc-11.s: Likewise. * ld-aarch64/ifunc-12.d: Likewise. * ld-aarch64/ifunc-12.s: Likewise. * ld-aarch64/ifunc-13.d: Likewise. * ld-aarch64/ifunc-13a.s: Likewise. * ld-aarch64/ifunc-13b.s: Likewise. * ld-aarch64/ifunc-14a.d: Likewise. * ld-aarch64/ifunc-14a.s: Likewise. * ld-aarch64/ifunc-14b.d: Likewise. * ld-aarch64/ifunc-14b.s: Likewise. * ld-aarch64/ifunc-14c.d: Likewise. * ld-aarch64/ifunc-14c.s: Likewise. * ld-aarch64/ifunc-14d.d: Likewise. * ld-aarch64/ifunc-14e.d: Likewise. * ld-aarch64/ifunc-14f.d: Likewise. * ld-aarch64/ifunc-15.d: Likewise. * ld-aarch64/ifunc-15.s: Likewise. * ld-aarch64/ifunc-16.d: Likewise. * ld-aarch64/ifunc-16.s: Likewise. * ld-aarch64/ifunc-17a.d: Likewise. * ld-aarch64/ifunc-17a.s: Likewise. * ld-aarch64/ifunc-17b.d: Likewise. * ld-aarch64/ifunc-17b.s: Likewise. * ld-aarch64/ifunc-18a.d: Likewise. * ld-aarch64/ifunc-18a.s: Likewise. * ld-aarch64/ifunc-18b.d: Likewise. * ld-aarch64/ifunc-18b.s: Likewise. * ld-aarch64/ifunc-19a.d: Likewise. * ld-aarch64/ifunc-19a.s: Likewise. * ld-aarch64/ifunc-19b.d: Likewise. * ld-aarch64/ifunc-19b.s: Likewise. * ld-aarch64/ifunc-2-local.d: Likewise. * ld-aarch64/ifunc-2-local.s: Likewise. * ld-aarch64/ifunc-2.d: Likewise. * ld-aarch64/ifunc-2.s: Likewise. * ld-aarch64/ifunc-20.d: Likewise. * ld-aarch64/ifunc-20.s: Likewise. * ld-aarch64/ifunc-3.s: Likewise. * ld-aarch64/ifunc-3a.d: Likewise. * ld-aarch64/ifunc-3b.d: Likewise. * ld-aarch64/ifunc-4.d: Likewise. * ld-aarch64/ifunc-4.s: Likewise. * ld-aarch64/ifunc-4a.d: Likewise. * ld-aarch64/ifunc-5-local.s: Likewise. * ld-aarch64/ifunc-5.s: Likewise. * ld-aarch64/ifunc-5a-local.d: Likewise. * ld-aarch64/ifunc-5a.d: Likewise. * ld-aarch64/ifunc-5b-local.d: Likewise. * ld-aarch64/ifunc-5b.d: Likewise. * ld-aarch64/ifunc-5r-local.d: Likewise. * ld-aarch64/ifunc-6.s: Likewise. * ld-aarch64/ifunc-6a.d: Likewise. * ld-aarch64/ifunc-6b.d: Likewise. * ld-aarch64/ifunc-7.s: Likewise. * ld-aarch64/ifunc-7a.d: Likewise. * ld-aarch64/ifunc-7b.d: Likewise. * ld-aarch64/ifunc-8.d: Likewise. * ld-aarch64/ifunc-8a.s: Likewise. * ld-aarch64/ifunc-8b.s: Likewise. * ld-aarch64/ifunc-9.d: Likewise. * ld-aarch64/ifunc-9.s: Likewise.
2013-06-04ld/testsuite/Roland McGrath12-85/+108
* ld-size/size.exp: For *-*-nacl* targets, use options_regsub(ld) to massage -m arguments into _nacl variants. * ld/testsuite/ld-size/size32-1-i386.d: Loosen regexps so they don't care what the exact addresses are. * ld/testsuite/ld-size/size32-1-x32.d: Likewise. * ld/testsuite/ld-size/size32-1-x86-64.d: Likewise. * ld/testsuite/ld-size/size32-2-i386.d: Likewise. * ld/testsuite/ld-size/size32-2-x32.d: Likewise. * ld/testsuite/ld-size/size32-2-x86-64.d: Likewise. * ld/testsuite/ld-size/size64-1-x32.d: Likewise. * ld/testsuite/ld-size/size64-1-x86-64.d: Likewise. * ld/testsuite/ld-size/size64-2-x32.d: Likewise. * ld/testsuite/ld-size/size64-2-x86-64.d: Likewise.
2013-06-04Update x86 nacl tests for section alignment changeH.J. Lu3-7/+13
* ld-i386/tlsbindesc-nacl.rd: Updated for text/data/bss section alignment change. * ld-x86-64/split-by-file-nacl.rd: Likewise.
2013-05-31Don't align text/data/bss sections for ELFH.J. Lu17-49/+60
binutils/testsuite/ * binutils-all/i386/compressed-1b.d: Updated for text/data/bss section alignment change. * binutils-all/i386/compressed-1c.d: Likewise. * binutils-all/x86-64/compressed-1b.d: Likewise. * binutils-all/x86-64/compressed-1c.d: Likewise. gas/ * config/tc-i386.c (md_begin): Don't align text/data/bss sections for ELF. gas/testsuite/ * gas/i386/size-3.d: Updated for text/data/bss section alignment change. * gas/i386/x86-64-size-1.d: Likewise. * gas/i386/x86-64-unwind.d: Likewise. * gas/i386/ilp32/x86-64-size-1.d: Likewise. * gas/i386/ilp32/x86-64-size-5.d: Likewise. * gas/i386/ilp32/x86-64-unwind.d: Likewise. ld/testsuite/ * ld-i386/pr12718.d: Updated for text/data/bss section alignment change. * ld-i386/tlsbindesc.dd: Likewise. * ld-i386/tlsbindesc.rd: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlspic.dd: Likewise. * ld-x86-64/ilp32-4.d: Likewise. * ld-x86-64/pr12718.d: Likewise. * ld-x86-64/split-by-file.rd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-x86-64/tlsbindesc.dd: Likewise. * ld-x86-64/tlsbindesc.rd: Likewise. * ld-x86-64/tlsdesc.dd: Likewise. * ld-x86-64/tlsdesc.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlspic.rd: Likewise.
2013-05-29 gas/Maciej W. Rozycki4-0/+38
* write.c (resolve_reloc_expr_symbols): On REL targets don't convert relocs who have no relocatable field either. Rephrase the conditional so that the PC-relative check is only applied for REL targets. gas/testsuite/ * gas/mips/jalr3.d: New test. * gas/mips/jalr3-n32.d: New test. * gas/mips/jalr3-n64.d: New test. * gas/mips/jalr3.s: New test source. * gas/mips/mips.exp: Run the new tests. ld/testsuite/ * ld-mips-elf/jalr3.dd: New test. * ld-mips-elf/jalr3.ld: New test linker script. * ld-mips-elf/mips-elf.exp: Run the new test.
2013-05-21 PR ld/12982Alan Modra2-1/+7
* ld-plugin/pr12982.d: Fail if RWE GNU_STACK present.
2013-05-21 * ld-powerpc/export-class.exp (supports_ppc64): Delete.Alan Modra3-31/+29
(powerpc_export_class_test): Add "endian" param. (abis): Add little-endian targets and test. * ld-powerpc/powerpc-64-export-class.xd: Update for little-endian.
2013-05-10XCOFF/AIX: Remove SEC_ALLOC flags for unmapped sections.Joel Brobecker4-3/+9
The .except, .loader and .typchk are not mapped to memory, so do not set their SEC_ALLOC flag. bfd/ChangeLog: * coffcode.h (styp_to_sec_flags) [RS6000COFF_C]: Add handling of STYP_EXCEPT, STYP_LOADER and STYP_TYPCHK sections. ld/testsuite/ChangeLog: * ld-powerpc/aix-core-sec-1.hd, ld-powerpc/aix-core-sec-2.hd, ld-powerpc/aix-core-sec-3.hd: Adjust expected section flags for section .loader.
2013-05-03 gold/Maciej W. Rozycki9-1/+92
PR ld/15365 * layout.cc (Layout::finalize): Make __ehdr_start STV_HIDDEN. ld/ PR ld/15365 * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Restrict __ehdr_start's export class to no less than STV_HIDDEN. ld/testsuite/ PR ld/15365 * ld-elf/ehdr_start.d: Expect __ehdr_start to be STB_LOCAL. * ld-mips-elf/ehdr_start-1.nd: New test. * ld-mips-elf/ehdr_start-2.nd: New test. * ld-mips-elf/ehdr_start-1.ld: New test linker script. * ld-mips-elf/ehdr_start-2.ld: New test linker script. * ld-mips-elf/ehdr_start-new.s: New test source. * ld-mips-elf/ehdr_start-o32.s: New test source. * ld-mips-elf/mips-elf.exp: Run the new tests.
2013-05-03 * ld-elf/provide-hidden-s.nd: New test.Maciej W. Rozycki16-0/+274
* ld-elf/provide-hidden-abs.nd: New test. * ld-elf/provide-hidden-def.nd: New test. * ld-elf/provide-hidden-dyn.nd: New test. * ld-elf/provide-hidden-sec.nd: New test. * ld-elf/provide-hidden-dynabs.nd: New test. * ld-elf/provide-hidden-dynsec.nd: New test. * ld-elf/provide-hidden-s.ld: New test linker script. * ld-elf/provide-hidden-1.ld: New test linker script. * ld-elf/provide-hidden-2.ld: New test linker script. * ld-elf/provide-hidden-1.s: New test source. * ld-elf/provide-hidden-2.s: New test source. * ld-elf/provide-hidden-3.s: New test source. * ld-elf/provide-hidden-4.s: New test source. * ld-elf/provide-hidden.exp: New test script.