aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/aarch64elf.em
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emultempl/aarch64elf.em')
-rw-r--r--ld/emultempl/aarch64elf.em17
1 files changed, 11 insertions, 6 deletions
diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
index d7e4eb7..91d58d8 100644
--- a/ld/emultempl/aarch64elf.em
+++ b/ld/emultempl/aarch64elf.em
@@ -44,6 +44,7 @@ static aarch64_protection_opts sw_protections = {
static aarch64_memtag_opts memtag_opts = {
.memtag_mode = AARCH64_MEMTAG_MODE_NONE,
+ .memtag_stack = 0,
};
#define COMPILE_TIME_STRLEN(s) \
@@ -447,22 +448,22 @@ aarch64_parse_gcs_option (const char *_optarg)
}
static bool
-aarch64_parse_memtag_mode_option (const char *optarg)
+aarch64_parse_memtag_mode_option (const char *_optarg)
{
#define MEMTAG_MODE "memtag-mode"
#define MEMTAG_MODE_LEN COMPILE_TIME_STRLEN (MEMTAG_MODE)
- if (strncmp (optarg, MEMTAG_MODE, MEMTAG_MODE_LEN) != 0)
+ if (strncmp (_optarg, MEMTAG_MODE, MEMTAG_MODE_LEN) != 0)
return false;
- if (strcmp (optarg + MEMTAG_MODE_LEN, "=none") == 0)
+ if (strcmp (_optarg + MEMTAG_MODE_LEN, "=none") == 0)
memtag_opts.memtag_mode = AARCH64_MEMTAG_MODE_NONE;
- else if (strcmp (optarg + MEMTAG_MODE_LEN, "=sync") == 0)
+ else if (strcmp (_optarg + MEMTAG_MODE_LEN, "=sync") == 0)
memtag_opts.memtag_mode = AARCH64_MEMTAG_MODE_SYNC;
- else if (strcmp (optarg + MEMTAG_MODE_LEN, "=async") == 0)
+ else if (strcmp (_optarg + MEMTAG_MODE_LEN, "=async") == 0)
memtag_opts.memtag_mode = AARCH64_MEMTAG_MODE_ASYNC;
else
- einfo (_("%X%P: error: unrecognized value '-z %s'\n"), optarg);
+ einfo (_("%X%P: error: unrecognized value '-z %s'\n"), _optarg);
return true;
@@ -557,6 +558,8 @@ PARSE_AND_LIST_OPTIONS='
sync: Enable precise exceptions when mismatched address and\n\
allocation tags detected on load/store operations.\n\
async: Enable imprecise exceptions.\n"));
+ fprintf (file, _("\
+ -z memtag-stack Mark program stack with MTE protection.\n"));
'
PARSE_AND_LIST_ARGS_CASE_Z_AARCH64='
@@ -574,6 +577,8 @@ PARSE_AND_LIST_ARGS_CASE_Z_AARCH64='
{}
else if (aarch64_parse_memtag_mode_option (optarg))
{}
+ else if (strcmp (optarg, "memtag-stack") == 0)
+ memtag_opts.memtag_stack = 1;
'
PARSE_AND_LIST_ARGS_CASE_Z="$PARSE_AND_LIST_ARGS_CASE_Z $PARSE_AND_LIST_ARGS_CASE_Z_AARCH64"