aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorSudakshina Das <sudi.das@arm.com>2019-06-06 12:21:14 +0100
committerSudakshina Das <sudi.das@arm.com>2019-06-06 12:21:14 +0100
commit8bf6d176b0a442a8091d338d4af971591d19922c (patch)
treeaa7c82ae70d416ec87d5bd5e70efbf82d657c86a /ld
parent811731b21b0a5b5459b33bfcbe26f40c6d9bc7c0 (diff)
downloadbinutils-8bf6d176b0a442a8091d338d4af971591d19922c.zip
binutils-8bf6d176b0a442a8091d338d4af971591d19922c.tar.gz
binutils-8bf6d176b0a442a8091d338d4af971591d19922c.tar.bz2
[LD, AArch64] Move ELF options behind -z
This patch moves the current AArch64 ld options of --force-bti and --pac-plt to -z force-bti and -z pac-plt since these are ELF specific options. *** bfd/ChangeLog *** 2019-06-06 Sudakshina Das <sudi.das@arm.com> * bfd-in.h: Change comment. * bfd-in2.h: Regenerate. * elfnn-aarch64.c (elfNN_aarch64_merge_gnu_properties): Update warning. * elfxx-aarch64.c (_bfd_aarch64_elf_link_setup_gnu_properties): Likwise. *** ld/ChangeLog *** 2019-06-06 Sudakshina Das <sudi.das@arm.com> * NEWS: Update options names. * emultempl/aarch64elf.em (OPTION_FORCE_BTI, OPTION_PAC_PLT): Remove. (PARSE_AND_LIST_LONGOPTS): Remove force-bti and pac-plt. (PARSE_AND_LIST_OPTIONS): Update to -z. (PARSE_AND_LIST_ARGS_CASE_Z_AARCH64): New. (PARSE_AND_LIST_ARGS_CASE_Z): Add PARSE_AND_LIST_ARGS_CASE_Z_AARCH64. (PARSE_AND_LIST_ARGS_CASES): Move cases for these options. * testsuite/ld-aarch64/bti-pac-plt-1.d: Update option. * testsuite/ld-aarch64/bti-pac-plt-2.d: Likewise. * testsuite/ld-aarch64/bti-plt-1.d: Likewise. * testsuite/ld-aarch64/bti-plt-2.d: Likewise. * testsuite/ld-aarch64/bti-plt-3.d: Likewise. * testsuite/ld-aarch64/bti-plt-4.d: Likewise. * testsuite/ld-aarch64/bti-plt-6.d: Likewise. * testsuite/ld-aarch64/bti-plt-7.d: Likewise. * testsuite/ld-aarch64/bti-warn.d: Likewise. * testsuite/ld-aarch64/pac-plt-1.d: Likewise. * testsuite/ld-aarch64/pac-plt-2.d: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog21
-rw-r--r--ld/NEWS4
-rw-r--r--ld/emultempl/aarch64elf.em28
-rw-r--r--ld/testsuite/ld-aarch64/bti-pac-plt-1.d2
-rw-r--r--ld/testsuite/ld-aarch64/bti-pac-plt-2.d2
-rw-r--r--ld/testsuite/ld-aarch64/bti-plt-1.d4
-rw-r--r--ld/testsuite/ld-aarch64/bti-plt-2.d4
-rw-r--r--ld/testsuite/ld-aarch64/bti-plt-3.d4
-rw-r--r--ld/testsuite/ld-aarch64/bti-plt-4.d4
-rw-r--r--ld/testsuite/ld-aarch64/bti-plt-6.d4
-rw-r--r--ld/testsuite/ld-aarch64/bti-plt-7.d6
-rw-r--r--ld/testsuite/ld-aarch64/bti-warn.d6
-rw-r--r--ld/testsuite/ld-aarch64/pac-plt-1.d2
-rw-r--r--ld/testsuite/ld-aarch64/pac-plt-2.d2
14 files changed, 56 insertions, 37 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 70e7241..4d747af 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,24 @@
+2019-06-06 Sudakshina Das <sudi.das@arm.com>
+
+ * NEWS: Update options names.
+ * emultempl/aarch64elf.em (OPTION_FORCE_BTI, OPTION_PAC_PLT): Remove.
+ (PARSE_AND_LIST_LONGOPTS): Remove force-bti and pac-plt.
+ (PARSE_AND_LIST_OPTIONS): Update to -z.
+ (PARSE_AND_LIST_ARGS_CASE_Z_AARCH64): New.
+ (PARSE_AND_LIST_ARGS_CASE_Z): Add PARSE_AND_LIST_ARGS_CASE_Z_AARCH64.
+ (PARSE_AND_LIST_ARGS_CASES): Move cases for these options.
+ * testsuite/ld-aarch64/bti-pac-plt-1.d: Update option.
+ * testsuite/ld-aarch64/bti-pac-plt-2.d: Likewise.
+ * testsuite/ld-aarch64/bti-plt-1.d: Likewise.
+ * testsuite/ld-aarch64/bti-plt-2.d: Likewise.
+ * testsuite/ld-aarch64/bti-plt-3.d: Likewise.
+ * testsuite/ld-aarch64/bti-plt-4.d: Likewise.
+ * testsuite/ld-aarch64/bti-plt-6.d: Likewise.
+ * testsuite/ld-aarch64/bti-plt-7.d: Likewise.
+ * testsuite/ld-aarch64/bti-warn.d: Likewise.
+ * testsuite/ld-aarch64/pac-plt-1.d: Likewise.
+ * testsuite/ld-aarch64/pac-plt-2.d: Likewise.
+
2019-05-30 Nick Clifton <nickc@redhat.com>
PR 24627
diff --git a/ld/NEWS b/ld/NEWS
index 3a41e9f..f66b35a 100644
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -18,11 +18,11 @@ Changes in 2.33:
* Add support for GNU_PROPERTY_AARCH64_FEATURE_1_PAC in ELF GNU program
properties in the AArch64 ELF linker.
-* Add --force-bti for AArch64 to enable GNU_PROPERTY_AARCH64_FEATURE_1_BTI
+* Add -z force-bti for AArch64 to enable GNU_PROPERTY_AARCH64_FEATURE_1_BTI
on output while warning about missing GNU_PROPERTY_AARCH64_FEATURE_1_BTI
on inputs and use PLTs protected with BTI.
-* Add --pac-plt for AArch64 to pick PAC enabled PLTs.
+* Add -z pac-plt for AArch64 to pick PAC enabled PLTs.
Changes in 2.32:
diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
index b59623e..4c13f26 100644
--- a/ld/emultempl/aarch64elf.em
+++ b/ld/emultempl/aarch64elf.em
@@ -372,8 +372,6 @@ PARSE_AND_LIST_PROLOGUE='
#define OPTION_FIX_ERRATUM_835769 313
#define OPTION_FIX_ERRATUM_843419 314
#define OPTION_NO_APPLY_DYNAMIC_RELOCS 315
-#define OPTION_FORCE_BTI 316
-#define OPTION_PAC_PLT 317
'
PARSE_AND_LIST_SHORTOPTS=p
@@ -387,8 +385,6 @@ PARSE_AND_LIST_LONGOPTS='
{ "fix-cortex-a53-835769", no_argument, NULL, OPTION_FIX_ERRATUM_835769},
{ "fix-cortex-a53-843419", optional_argument, NULL, OPTION_FIX_ERRATUM_843419},
{ "no-apply-dynamic-relocs", no_argument, NULL, OPTION_NO_APPLY_DYNAMIC_RELOCS},
- { "force-bti", no_argument, NULL, OPTION_FORCE_BTI},
- { "pac-plt", no_argument, NULL, OPTION_PAC_PLT},
'
PARSE_AND_LIST_OPTIONS='
@@ -419,10 +415,21 @@ PARSE_AND_LIST_OPTIONS='
instruction into an ADR. As such the workaround will always use a\n\
veneer and this will give you both a performance and size overhead.\n"));
fprintf (file, _(" --no-apply-dynamic-relocs Do not apply link-time values for dynamic relocations\n"));
- fprintf (file, _(" --force-bti Turn on Branch Target Identification mechanism and generate PLTs with BTI. Generate warnings for missing BTI on inputs\n"));
- fprintf (file, _(" --pac-plt Protect PLTs with Pointer Authentication.\n"));
+ fprintf (file, _(" -z force-bti Turn on Branch Target Identification mechanism and generate PLTs with BTI. Generate warnings for missing BTI on inputs\n"));
+ fprintf (file, _(" -z pac-plt Protect PLTs with Pointer Authentication.\n"));
'
+PARSE_AND_LIST_ARGS_CASE_Z_AARCH64='
+ else if (strcmp (optarg, "force-bti") == 0)
+ {
+ plt_type |= PLT_BTI;
+ bti_type = BTI_WARN;
+ }
+ else if (strcmp (optarg, "pac-plt") == 0)
+ plt_type |= PLT_PAC;
+'
+PARSE_AND_LIST_ARGS_CASE_Z="$PARSE_AND_LIST_ARGS_CASE_Z $PARSE_AND_LIST_ARGS_CASE_Z_AARCH64"
+
PARSE_AND_LIST_ARGS_CASES='
case '\'p\'':
/* Only here for backwards compatibility. */
@@ -464,15 +471,6 @@ PARSE_AND_LIST_ARGS_CASES='
no_apply_dynamic_relocs = 1;
break;
- case OPTION_FORCE_BTI:
- plt_type |= PLT_BTI;
- bti_type = BTI_WARN;
- break;
-
- case OPTION_PAC_PLT:
- plt_type |= PLT_PAC;
- break;
-
case OPTION_STUBGROUP_SIZE:
{
const char *end;
diff --git a/ld/testsuite/ld-aarch64/bti-pac-plt-1.d b/ld/testsuite/ld-aarch64/bti-pac-plt-1.d
index 1ac2806..e1c6eb7 100644
--- a/ld/testsuite/ld-aarch64/bti-pac-plt-1.d
+++ b/ld/testsuite/ld-aarch64/bti-pac-plt-1.d
@@ -1,6 +1,6 @@
#source: bti-plt-1.s
#as: -mabi=lp64
-#ld: -shared --force-bti --pac-plt -T bti-plt.ld
+#ld: -shared -z force-bti -z pac-plt -T bti-plt.ld
#objdump: -dr -j .plt
[^:]*: *file format elf64-.*aarch64
diff --git a/ld/testsuite/ld-aarch64/bti-pac-plt-2.d b/ld/testsuite/ld-aarch64/bti-pac-plt-2.d
index e0ac1df1..0c67615 100644
--- a/ld/testsuite/ld-aarch64/bti-pac-plt-2.d
+++ b/ld/testsuite/ld-aarch64/bti-pac-plt-2.d
@@ -1,6 +1,6 @@
#source: bti-plt-1.s
#as: -mabi=lp64
-#ld: --force-bti --pac-plt -e _start -T bti-plt.ld -L./tmpdir -lbti-plt-so
+#ld: -z force-bti -z pac-plt -e _start -T bti-plt.ld -L./tmpdir -lbti-plt-so
#objdump: -dr -j .plt
[^:]*: *file format elf64-.*aarch64
diff --git a/ld/testsuite/ld-aarch64/bti-plt-1.d b/ld/testsuite/ld-aarch64/bti-plt-1.d
index 618a6a9..f8414a0 100644
--- a/ld/testsuite/ld-aarch64/bti-plt-1.d
+++ b/ld/testsuite/ld-aarch64/bti-plt-1.d
@@ -1,7 +1,7 @@
-#name: Check --force-bti emits BTI PLT (shared)
+#name: Check -z force-bti emits BTI PLT (shared)
#source: bti-plt-1.s
#as: -mabi=lp64
-#ld: -shared --force-bti -T bti-plt.ld
+#ld: -shared -z force-bti -T bti-plt.ld
#objdump: -dr -j .plt
[^:]*: *file format elf64-.*aarch64
diff --git a/ld/testsuite/ld-aarch64/bti-plt-2.d b/ld/testsuite/ld-aarch64/bti-plt-2.d
index c26e47a..bddefe9 100644
--- a/ld/testsuite/ld-aarch64/bti-plt-2.d
+++ b/ld/testsuite/ld-aarch64/bti-plt-2.d
@@ -1,8 +1,8 @@
-#name: Check --force-bti emits BTI feature (shared)
+#name: Check -z force-bti emits BTI feature (shared)
#source: bti-plt-1.s
#source: bti-plt-2.s
#as: -mabi=lp64
-#ld: -shared --force-bti -T bti-plt.ld
+#ld: -shared -z force-bti -T bti-plt.ld
#readelf: -n
Displaying notes found in: .note.gnu.property
diff --git a/ld/testsuite/ld-aarch64/bti-plt-3.d b/ld/testsuite/ld-aarch64/bti-plt-3.d
index 08914de..82f08a9 100644
--- a/ld/testsuite/ld-aarch64/bti-plt-3.d
+++ b/ld/testsuite/ld-aarch64/bti-plt-3.d
@@ -1,7 +1,7 @@
-#name: Check --force-bti emits BTI PLT (exec)
+#name: Check -z force-bti emits BTI PLT (exec)
#source: bti-plt-1.s
#as: -mabi=lp64
-#ld: --force-bti -e _start -T bti-plt.ld -L./tmpdir -lbti-plt-so
+#ld: -z force-bti -e _start -T bti-plt.ld -L./tmpdir -lbti-plt-so
#objdump: -dr -j .plt
[^:]*: *file format elf64-.*aarch64
diff --git a/ld/testsuite/ld-aarch64/bti-plt-4.d b/ld/testsuite/ld-aarch64/bti-plt-4.d
index 90aeed2..936c24d 100644
--- a/ld/testsuite/ld-aarch64/bti-plt-4.d
+++ b/ld/testsuite/ld-aarch64/bti-plt-4.d
@@ -1,7 +1,7 @@
-#name: Check --force-bti emits BTI feature (exec)
+#name: Check -z force-bti emits BTI feature (exec)
#source: bti-plt-1.s
#as: -mabi=lp64
-#ld: --force-bti -e _start -T bti-plt.ld -L./tmpdir -lbti-plt-so
+#ld: -z force-bti -e _start -T bti-plt.ld -L./tmpdir -lbti-plt-so
#readelf: -n
Displaying notes found in: .note.gnu.property
diff --git a/ld/testsuite/ld-aarch64/bti-plt-6.d b/ld/testsuite/ld-aarch64/bti-plt-6.d
index 30d225d..27958c5 100644
--- a/ld/testsuite/ld-aarch64/bti-plt-6.d
+++ b/ld/testsuite/ld-aarch64/bti-plt-6.d
@@ -2,8 +2,8 @@
#source: property-bti-pac2.s
#source: property-bti-pac1.s
#as: -mabi=lp64 -defsym __property_pac__=1
-#ld: -shared --force-bti
-#warning: .*property-bti-pac2.*: warning: BTI turned on by --force-bti.*$
+#ld: -shared -z force-bti
+#warning: .*property-bti-pac2.*: warning: BTI turned on by -z force-bti.*$
#readelf: -n
# Should warn about the missing input BTI NOTE but should
diff --git a/ld/testsuite/ld-aarch64/bti-plt-7.d b/ld/testsuite/ld-aarch64/bti-plt-7.d
index e8fa0d3..644290a 100644
--- a/ld/testsuite/ld-aarch64/bti-plt-7.d
+++ b/ld/testsuite/ld-aarch64/bti-plt-7.d
@@ -2,9 +2,9 @@
#source: property-bti-pac2.s
#source: plt_mapping_symbol.s
#as: -mabi=lp64
-#ld: -shared --force-bti
-#warning: .*plt_mapping_symbol.*: warning: BTI turned on by --force-bti.*
-#warning: .*property-bti-pac2.*: warning: BTI turned on by --force-bti.*
+#ld: -shared -z force-bti
+#warning: .*plt_mapping_symbol.*: warning: BTI turned on by -z force-bti.*
+#warning: .*property-bti-pac2.*: warning: BTI turned on by -z force-bti.*
#readelf: -n
# Should warn about the missing input BTI NOTE but should
diff --git a/ld/testsuite/ld-aarch64/bti-warn.d b/ld/testsuite/ld-aarch64/bti-warn.d
index c2edccf..f22fd60 100644
--- a/ld/testsuite/ld-aarch64/bti-warn.d
+++ b/ld/testsuite/ld-aarch64/bti-warn.d
@@ -2,9 +2,9 @@
#source: property-bti-pac2.s
#source: bti-plt-1.s
#as: -mabi=lp64 --defsym __guard_property_bti__=1 --defsym __property_pac__=1
-#ld: -shared --force-bti
-#warning: .*property-bti-pac2.*: warning: BTI turned on by --force-bti.*
-#warning: .*bti-plt-1.*: warning: BTI turned on by --force-bti.*
+#ld: -shared -z force-bti
+#warning: .*property-bti-pac2.*: warning: BTI turned on by -z force-bti.*
+#warning: .*bti-plt-1.*: warning: BTI turned on by -z force-bti.*
#readelf: -n
# Should warn about the missing input BTI NOTE but should
diff --git a/ld/testsuite/ld-aarch64/pac-plt-1.d b/ld/testsuite/ld-aarch64/pac-plt-1.d
index 9c4a676..06278ef 100644
--- a/ld/testsuite/ld-aarch64/pac-plt-1.d
+++ b/ld/testsuite/ld-aarch64/pac-plt-1.d
@@ -1,6 +1,6 @@
#source: bti-plt-1.s
#as: -mabi=lp64 --defsym __guard_property_bti__=1
-#ld: -shared --pac-plt -T bti-plt.ld
+#ld: -shared -z pac-plt -T bti-plt.ld
#objdump: -dr -j .plt
[^:]*: *file format elf64-.*aarch64
diff --git a/ld/testsuite/ld-aarch64/pac-plt-2.d b/ld/testsuite/ld-aarch64/pac-plt-2.d
index 7ebc81d..b5cf43d 100644
--- a/ld/testsuite/ld-aarch64/pac-plt-2.d
+++ b/ld/testsuite/ld-aarch64/pac-plt-2.d
@@ -1,5 +1,5 @@
#source: tls-desc-ie.s
-#ld: -shared --pac-plt -T bti-plt.ld
+#ld: -shared -z pac-plt -T bti-plt.ld
#objdump: -dr -j .plt
#...
Disassembly of section .plt: