aboutsummaryrefslogtreecommitdiff
path: root/ld/emulparams
diff options
context:
space:
mode:
Diffstat (limited to 'ld/emulparams')
-rw-r--r--ld/emulparams/cet.sh14
-rw-r--r--ld/emulparams/elf_x86_64.sh1
-rw-r--r--ld/emulparams/x86-64-lam.sh69
3 files changed, 77 insertions, 7 deletions
diff --git a/ld/emulparams/cet.sh b/ld/emulparams/cet.sh
index f9a83ec..d9e81df 100644
--- a/ld/emulparams/cet.sh
+++ b/ld/emulparams/cet.sh
@@ -19,15 +19,15 @@ PARSE_AND_LIST_ARGS_CASE_Z_CET='
else if (strncmp (optarg, "cet-report=", 11) == 0)
{
if (strcmp (optarg + 11, "none") == 0)
- params.cet_report = cet_report_none;
+ params.cet_report = prop_report_none;
else if (strcmp (optarg + 11, "warning") == 0)
- params.cet_report = (cet_report_warning
- | cet_report_ibt
- | cet_report_shstk);
+ params.cet_report = (prop_report_warning
+ | prop_report_ibt
+ | prop_report_shstk);
else if (strcmp (optarg + 11, "error") == 0)
- params.cet_report = (cet_report_error
- | cet_report_ibt
- | cet_report_shstk);
+ params.cet_report = (prop_report_error
+ | prop_report_ibt
+ | prop_report_shstk);
else
einfo (_("%F%P: invalid option for -z cet-report=: %s\n"),
optarg + 11);
diff --git a/ld/emulparams/elf_x86_64.sh b/ld/emulparams/elf_x86_64.sh
index 5996055..664ff18 100644
--- a/ld/emulparams/elf_x86_64.sh
+++ b/ld/emulparams/elf_x86_64.sh
@@ -5,6 +5,7 @@ source_sh ${srcdir}/emulparams/reloc_overflow.sh
source_sh ${srcdir}/emulparams/call_nop.sh
source_sh ${srcdir}/emulparams/cet.sh
source_sh ${srcdir}/emulparams/x86-64-level.sh
+source_sh ${srcdir}/emulparams/x86-64-lam.sh
source_sh ${srcdir}/emulparams/static.sh
SCRIPT_NAME=elf
ELFSIZE=64
diff --git a/ld/emulparams/x86-64-lam.sh b/ld/emulparams/x86-64-lam.sh
new file mode 100644
index 0000000..40ddb05
--- /dev/null
+++ b/ld/emulparams/x86-64-lam.sh
@@ -0,0 +1,69 @@
+PARSE_AND_LIST_OPTIONS_LAM='
+ fprintf (file, _("\
+ -z lam-u48 Generate GNU_PROPERTY_X86_FEATURE_1_LAM_U48\n"));
+ fprintf (file, _("\
+ -z lam-u48-report=[none|warning|error] (default: none)\n\
+ Report missing LAM_U48 property\n"));
+ fprintf (file, _("\
+ -z lam-u57 Generate GNU_PROPERTY_X86_FEATURE_1_LAM_U57\n"));
+ fprintf (file, _("\
+ -z lam-u57-report=[none|warning|error] (default: none)\n\
+ Report missing LAM_U57 property\n"));
+ fprintf (file, _("\
+ -z lam-report=[none|warning|error] (default: none)\n\
+ Report missing LAM_U48 and LAM_U57 properties\n"));
+'
+PARSE_AND_LIST_ARGS_CASE_Z_LAM='
+ else if (strcmp (optarg, "lam-u48") == 0)
+ params.lam_u48 = TRUE;
+ else if (strncmp (optarg, "lam-u48-report=", 15) == 0)
+ {
+ if (strcmp (optarg + 15, "none") == 0)
+ params.lam_u48_report = prop_report_none;
+ else if (strcmp (optarg + 15, "warning") == 0)
+ params.lam_u48_report = prop_report_warning;
+ else if (strcmp (optarg + 15, "error") == 0)
+ params.lam_u48_report = prop_report_error;
+ else
+ einfo (_("%F%P: invalid option for -z lam-u48-report=: %s\n"),
+ optarg + 15);
+ }
+ else if (strcmp (optarg, "lam-u57") == 0)
+ params.lam_u57 = TRUE;
+ else if (strncmp (optarg, "lam-u57-report=", 15) == 0)
+ {
+ if (strcmp (optarg + 15, "none") == 0)
+ params.lam_u57_report = prop_report_none;
+ else if (strcmp (optarg + 15, "warning") == 0)
+ params.lam_u57_report = prop_report_warning;
+ else if (strcmp (optarg + 15, "error") == 0)
+ params.lam_u57_report = prop_report_error;
+ else
+ einfo (_("%F%P: invalid option for -z lam-u57-report=: %s\n"),
+ optarg + 15);
+ }
+ else if (strncmp (optarg, "lam-report=", 11) == 0)
+ {
+ if (strcmp (optarg + 11, "none") == 0)
+ {
+ params.lam_u48_report = prop_report_none;
+ params.lam_u57_report = prop_report_none;
+ }
+ else if (strcmp (optarg + 11, "warning") == 0)
+ {
+ params.lam_u48_report = prop_report_warning;
+ params.lam_u57_report = prop_report_warning;
+ }
+ else if (strcmp (optarg + 11, "error") == 0)
+ {
+ params.lam_u48_report = prop_report_error;
+ params.lam_u57_report = prop_report_error;
+ }
+ else
+ einfo (_("%F%P: invalid option for -z lam-report=: %s\n"),
+ optarg + 11);
+ }
+'
+
+PARSE_AND_LIST_OPTIONS="$PARSE_AND_LIST_OPTIONS $PARSE_AND_LIST_OPTIONS_LAM"
+PARSE_AND_LIST_ARGS_CASE_Z="$PARSE_AND_LIST_ARGS_CASE_Z $PARSE_AND_LIST_ARGS_CASE_Z_LAM"