binutils-gdb/ld/testsuite/ld-ifunc
Will Newton 1419bbe571 aarch64: Add support for GNU indirect functions.
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-10-03 14:46:09 +00:00
..
binutils.exp bfd/ 2012-04-03 16:01:38 +00:00
ifunc-1-local-x86.d Adjust x86 IFUNC PLT. 2011-06-20 17:12:49 +00:00
ifunc-1-local-x86.s
ifunc-1-x86.d Adjust x86 IFUNC PLT. 2011-06-20 17:12:49 +00:00
ifunc-1-x86.s
ifunc-2-i386.d
ifunc-2-i386.s
ifunc-2-local-i386.d
ifunc-2-local-i386.s
ifunc-2-local-x86-64.d
ifunc-2-local-x86-64.s
ifunc-2-x86-64.d
ifunc-2-x86-64.s
ifunc-3-x86.s
ifunc-3a-x86.d Support x86_64-*-linux-gnux32 2012-05-04 20:01:03 +00:00
ifunc-3b-x86.d
ifunc-4-local-x86.d
ifunc-4-local-x86.s
ifunc-4-x86.d
ifunc-4-x86.s
ifunc-4a-x86.d
ifunc-5-i386.s
ifunc-5-local-i386.s
ifunc-5-local-x86-64.s
ifunc-5-x86-64.s
ifunc-5a-i386.d
ifunc-5a-local-i386.d
ifunc-5a-local-x86-64.d
ifunc-5a-x86-64.d
ifunc-5b-i386.d
ifunc-5b-local-i386.d
ifunc-5b-local-x86-64.d
ifunc-5b-x86-64.d
ifunc-5r-local-i386.d
ifunc-5r-local-x86-64.d
ifunc-6-i386.s
ifunc-6-x86-64.s
ifunc-6a-i386.d
ifunc-6a-x86-64.d
ifunc-6b-i386.d
ifunc-6b-x86-64.d
ifunc-7-i386.s
ifunc-7-x86-64.s
ifunc-7a-i386.d
ifunc-7a-x86-64.d
ifunc-7b-i386.d
ifunc-7b-x86-64.d
ifunc-8-i386.d
ifunc-8-x86-64.d
ifunc-8a-i386.s
ifunc-8a-x86-64.s
ifunc-8b-i386.s
ifunc-8b-x86-64.s
ifunc-9-x86.d
ifunc-9-x86.s
ifunc-10-i386.d Support garbage collection against STT_GNU_IFUNC symbols. 2010-07-13 16:59:14 +00:00
ifunc-10-i386.s Handle STT_GNU_IFUNC symols when building shared library. 2011-01-06 18:45:05 +00:00
ifunc-10-x86-64.d Support garbage collection against STT_GNU_IFUNC symbols. 2010-07-13 16:59:14 +00:00
ifunc-10-x86-64.s Handle STT_GNU_IFUNC symols when building shared library. 2011-01-06 18:45:05 +00:00
ifunc-11-i386.d Support garbage collection against STT_GNU_IFUNC symbols. 2010-07-13 16:59:14 +00:00
ifunc-11-i386.s Handle STT_GNU_IFUNC symols when building shared library. 2011-01-06 18:45:05 +00:00
ifunc-11-x86-64.d Support garbage collection against STT_GNU_IFUNC symbols. 2010-07-13 16:59:14 +00:00
ifunc-11-x86-64.s Handle STT_GNU_IFUNC symols when building shared library. 2011-01-06 18:45:05 +00:00
ifunc-12-i386.d Handle STT_GNU_IFUNC symols when building shared library. 2011-01-06 18:45:05 +00:00
ifunc-12-i386.s Handle STT_GNU_IFUNC symols when building shared library. 2011-01-06 18:45:05 +00:00
ifunc-12-x86-64.d Handle STT_GNU_IFUNC symols when building shared library. 2011-01-06 18:45:05 +00:00
ifunc-12-x86-64.s Handle STT_GNU_IFUNC symols when building shared library. 2011-01-06 18:45:05 +00:00
ifunc-13-i386.d Convert mov to lea in size_dynamic_sections 2012-08-31 20:41:41 +00:00
ifunc-13-x86-64.d Use .got.plt for IFUNC symbols if there are no GOT relocations. 2011-09-12 18:17:36 +00:00
ifunc-13a-i386.s * read.c (read_symbol_name): New function. Reads a symbol names. 2012-05-28 14:20:19 +00:00
ifunc-13a-x86-64.s Add missing "foo" after ".global" 2012-05-31 17:16:54 +00:00
ifunc-13b-i386.s Handle STT_GNU_IFUNC symols when building shared library. 2011-01-06 18:45:05 +00:00
ifunc-13b-x86-64.s Handle STT_GNU_IFUNC symols when building shared library. 2011-01-06 18:45:05 +00:00
ifunc-14a-i386.d Check local IFUNC calls 2012-12-13 21:07:16 +00:00
ifunc-14a-x86-64.d Check local IFUNC calls 2012-12-13 21:07:16 +00:00
ifunc-14a.s Skip local IFUNC symbols when checking dynamic relocs in read-only sections. 2011-04-21 22:25:39 +00:00
ifunc-14b-i386.d Check local IFUNC calls 2012-12-13 21:07:16 +00:00
ifunc-14b-x86-64.d Check local IFUNC calls 2012-12-13 21:07:16 +00:00
ifunc-14b.s Skip local IFUNC symbols when checking dynamic relocs in read-only sections. 2011-04-21 22:25:39 +00:00
ifunc-14c-i386.d Check local IFUNC calls 2012-12-13 21:07:16 +00:00
ifunc-14c-x86-64.d Check local IFUNC calls 2012-12-13 21:07:16 +00:00
ifunc-14c.s Properly adjust h->plt.refcount 2012-12-21 18:15:22 +00:00
ifunc-14d-i386.d Check local IFUNC calls 2012-12-13 21:07:16 +00:00
ifunc-14d-x86-64.d Check local IFUNC calls 2012-12-13 21:07:16 +00:00
ifunc-14e-i386.d Properly adjust h->plt.refcount 2012-12-21 18:15:22 +00:00
ifunc-14e-x86-64.d Properly adjust h->plt.refcount 2012-12-21 18:15:22 +00:00
ifunc-14f-i386.d Properly adjust h->plt.refcount 2012-12-21 18:15:22 +00:00
ifunc-14f-x86-64.d Properly adjust h->plt.refcount 2012-12-21 18:15:22 +00:00
ifunc-15-i386.d Use .got.plt for IFUNC symbols if there are no GOT relocations. 2011-09-12 18:17:36 +00:00
ifunc-15-i386.s * read.c (read_symbol_name): New function. Reads a symbol names. 2012-05-28 14:20:19 +00:00
ifunc-15-x86-64.d Use .got.plt for IFUNC symbols if there are no GOT relocations. 2011-09-12 18:17:36 +00:00
ifunc-15-x86-64.s Add missing "foo" after ".global" 2012-05-31 17:16:54 +00:00
ifunc-16-i386.d Put IRELATIVE relocations after JUMP_SLOT. 2011-10-21 15:13:37 +00:00
ifunc-16-x86-64.d Put IRELATIVE relocations after JUMP_SLOT. 2011-10-21 15:13:37 +00:00
ifunc-16-x86.s Put IRELATIVE relocations after JUMP_SLOT. 2011-10-21 15:13:37 +00:00
ifunc-17a-i386.d Properly handle common symbol and weak function 2012-09-19 00:53:30 +00:00
ifunc-17a-x86-64.d Properly handle common symbol and weak function 2012-09-19 00:53:30 +00:00
ifunc-17a.s Properly handle common symbol and weak function 2012-09-19 00:53:30 +00:00
ifunc-17b-i386.d Properly handle common symbol and weak function 2012-09-19 00:53:30 +00:00
ifunc-17b-x86-64.d Properly handle common symbol and weak function 2012-09-19 00:53:30 +00:00
ifunc-17b.s Properly handle common symbol and weak function 2012-09-19 00:53:30 +00:00
ifunc-18a-i386.d Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-18a-x86-64.d Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-18a.s Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-18b-i386.d Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-18b-x86-64.d Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-18b.s Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-19a-i386.d Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-19a-x86-64.d Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-19a.s Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-19b-i386.d Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-19b-x86-64.d Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-19b.s Also check local IFUNC references 2012-12-16 20:31:08 +00:00
ifunc-20-i386.d Check regular reference without non-GOT reference 2013-04-15 21:16:18 +00:00
ifunc-20-x86-64.d Check regular reference without non-GOT reference 2013-04-15 21:16:18 +00:00
ifunc-20.s Check regular reference without non-GOT reference 2013-04-15 21:16:18 +00:00
ifunc-common-1.out Properly handle common symbol and weak function 2012-09-19 00:53:30 +00:00
ifunc-common-1a.c Properly handle common symbol and weak function 2012-09-19 00:53:30 +00:00
ifunc-common-1b.c Properly handle common symbol and weak function 2012-09-19 00:53:30 +00:00
ifunc.exp aarch64: Add support for GNU indirect functions. 2013-10-03 14:46:09 +00:00
lib.c
prog.c
test-1.c
test-2.c