binutils-gdb/ld/emultempl
Sudakshina Das 37c18eedff [BFD, LD, AArch64, 2/3] Add --force-bti to enable BTI and to select BTI enabled PLTs
This is part of the patch series to add support for BTI and
PAC in AArch64 linker.

1) This patch adds a new ld command line option: --force-bti.
In the presence of this option, the linker enables BTI with the
GNU_PROPERTY_AARCH64_FEATURE_1_BTI feature. This gives out warning
in case of missing gnu notes for BTI in inputs.
2) It also defines a new set of BTI enabled PLTs. These are used either
when all the inputs are marked with GNU_PROPERTY_AARCH64_FEATURE_1_BTI
or when the new --force-bti option is used. This required adding new
fields in elf_aarch64_link_hash_table so that we could make the PLT
related information more generic.
3) It also defines a dynamic tag DT_AARCH64_BTI_PLT. The linker uses
this whenever it picks BTI enabled PLTs.
All these are made according to the new AArch64 ELF ABI
https://developer.arm.com/docs/ihi0056/latest/elf-for-the-arm-64-bit-architecture-aarch64-abi-2018q4

*** bfd/ChangeLog ***

2019-03-13  Sudakshina Das  <sudi.das@arm.com>
	    Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* bfd-in.h (aarch64_plt_type, aarch64_enable_bti_type): New.
	(aarch64_bti_pac_info): New.
	(bfd_elf64_aarch64_set_options): Add aarch64_bti_pac_info argument.
	(bfd_elf32_aarch64_set_options): Likewise.
	* bfd-in2.h: Regenerate
	* elfnn-aarch64.c (PLT_BTI_ENTRY_SIZE): New.
	(PLT_BTI_SMALL_ENTRY_SIZE, PLT_BTI_TLSDESC_ENTRY_SIZE): New.
	(elfNN_aarch64_small_plt0_bti_entry): New.
	(elfNN_aarch64_small_plt_bti_entry): New.
	(elfNN_aarch64_tlsdesc_small_plt_bti_entry): New.
	(elf_aarch64_obj_tdata): Add no_bti_warn and plt_type fields.
	(elf_aarch64_link_hash_table): Add plt0_entry, plt_entry and
	tlsdesc_plt_entry_size fields.
	(elfNN_aarch64_link_hash_table_create): Initialise the new fields.
	(setup_plt_values): New helper function.
	(bfd_elfNN_aarch64_set_options): Use new bp_info to set plt sizes and
	bti enable type.
	(elfNN_aarch64_allocate_dynrelocs): Use new size members instead of
	fixed macros.
	(elfNN_aarch64_size_dynamic_sections): Likewise and add checks.
	(elfNN_aarch64_create_small_pltn_entry): Use new generic pointers
	to plt stubs instead of fixed ones and update filling them according
	to the need for bti.
	(elfNN_aarch64_init_small_plt0_entry): Likewise.
	(elfNN_aarch64_finish_dynamic_sections): Likewise.
	(get_plt_type, elfNN_aarch64_get_synthetic_symtab): New.
	(elfNN_aarch64_plt_sym_val): Update size accordingly.
	(elfNN_aarch64_link_setup_gnu_properties): Set up plts if BTI GNU NOTE
	is set.
	(bfd_elfNN_get_synthetic_symtab): Define.
	(elfNN_aarch64_merge_gnu_properties): Give out warning with --force-bti
	and mising BTI NOTE SECTION.

*** binutils/ChangeLog ***

2019-03-13  Sudakshina Das  <sudi.das@arm.com>
	    Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* readelf.c (get_aarch64_dynamic_type): New.
	(get_dynamic_type): Use above for EM_AARCH64.
	(dynamic_section_aarch64_val): New.
	(process_dynamic_section): Use above for EM_AARCH64.

*** include/ChangeLog ***

2019-03-13  Sudakshina Das  <sudi.das@arm.com>
	    Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* elf/aarch64.h (DT_AARCH64_BTI_PLT): New.

*** ld/ChangeLog ***

2019-03-13  Sudakshina Das  <sudi.das@arm.com>
	    Szabolcs Nagy  <szabolcs.nagy@arm.com>

	* NEWS: Document --force-bti.
	* emultempl/aarch64elf.em (plt_type, bti_type, OPTION_FORCE_BTI): New.
	(PARSE_AND_LIST_SHORTOPTS, PARSE_AND_LIST_OPTIONS): Add force-bti.
	(PARSE_AND_LIST_ARGS_CASES): Handle OPTION_FORCE_BTI.
	* testsuite/ld-aarch64/aarch64-elf.exp: Add all the tests below.
	* testsuite/ld-aarch64/bti-plt-1.d: New test.
	* testsuite/ld-aarch64/bti-plt-1.s: New test.
	* testsuite/ld-aarch64/bti-plt-2.s: New test.
	* testsuite/ld-aarch64/bti-plt-2.d: New test.
	* testsuite/ld-aarch64/bti-plt-3.d: New test.
	* testsuite/ld-aarch64/bti-plt-4.d: New test.
	* testsuite/ld-aarch64/bti-plt-5.d: New test.
	* testsuite/ld-aarch64/bti-plt-6.d: New test.
	* testsuite/ld-aarch64/bti-plt-7.d: New test.
	* testsuite/ld-aarch64/bti-plt-so.s: New test.
	* testsuite/ld-aarch64/bti-plt.ld: New test.
2019-03-13 11:47:07 +00:00
..
aarch64elf.em [BFD, LD, AArch64, 2/3] Add --force-bti to enable BTI and to select BTI enabled PLTs 2019-03-13 11:47:07 +00:00
aix.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
alphaelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
arclinux.em [ARC] don't force _init/_fini as DT_INIT/DT_FINI. 2019-02-09 11:07:42 +01:00
armcoff.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
armelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
astring.sed
avrelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
beos.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
bfin.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
cr16elf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
crxelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
cskyelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
elf32.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
elf-generic.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
epiphanyelf_4x4.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
genelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
generic.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
hppaelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ia64elf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
irix.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
linux.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
m68hc1xelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
m68kelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
metagelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
mipself.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
mmix-elfnmmo.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
mmixelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
mmo.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
msp430.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
nds32elf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
needrelax.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
netbsd.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
nios2elf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ostring.sed
pe.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
pep.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ppc32elf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ppc64elf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
pruelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
README Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
riscvelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
rxelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
s390.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
scoreelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
solaris2.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
spu_icache.o_c Regenerate spu overlay and icache manager files 2014-11-04 22:36:13 +10:30
spu_icache.S bfd/ 2009-03-17 12:46:19 +00:00
spu_ovl.o_c Regenerate spu_ovl.o_c 2016-10-15 12:53:57 +10:30
spu_ovl.S Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
spuelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
tic6xdsbt.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
ticoff.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
v850elf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
vanilla.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
vms.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
vxworks.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
xtensaelf.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
z80.em Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

The files in this directory are sourced by genscripts.sh, after
setting some variables to substitute in, to produce
C source files that contain jump tables for each emulation.

Copyright (C) 2012-2019 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.