mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
279d901e5a
Add Intel Linear Address Masking (LAM) property support. LAM modifies the checking that is applied to 64-bit linear addresses, allowing software to use of the untranslated address bits for metadata. bfd/ * elf-linker-x86.h (elf_x86_cet_report): Renamed to ... (elf_x86_prop_report): This. (elf_linker_x86_params): Add lam_u48, lam_u57, lam_u48_report and lam_u57_report. * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Support GNU_PROPERTY_X86_FEATURE_1_LAM_U48 and GNU_PROPERTY_X86_FEATURE_1_LAM_U57. (_bfd_x86_elf_link_fixup_gnu_properties): Keep LAM features only for 64-bit output. binutils/ * NEWS: Mention LAM_U48 and LAM_U57 support. * elfedit.c (elf_x86_feature): Support lam_u48 and lam_u57. (usage): Add lam_u48 and lam_u57. * readelf.c (decode_x86_feature_1): Support LAM_U48 and LAM_U57. * doc/binutils.texi: Update elfedit with lam_u48 and lam_u57 support. * testsuite/binutils-all/x86-64/lam-u48.d: New file. * testsuite/binutils-all/x86-64/lam-u48.s: Likewise. * testsuite/binutils-all/x86-64/lam-u57.d: Likewise. * testsuite/binutils-all/x86-64/lam-u57.s: Likewise. include/ * elf/common.h (GNU_PROPERTY_X86_FEATURE_1_LAM_U48): New. (GNU_PROPERTY_X86_FEATURE_1_LAM_U57): Likewise. ld/ * NEWS: Mention LAM_U48 and LAM_U57 support. * ld.texi: Document LAM_U48 and LAM_U57 support. * emulparams/cet.sh: Updated. * emulparams/elf_x86_64.sh: Source x86-64-lam.sh. * emulparams/x86-64-lam.sh: New file. * testsuite/ld-x86-64/property-x86-lam-u48-1a.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-1b.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-2.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-3a.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-3b.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-4.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48-5.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u48.s: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-1a.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-1b.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-2.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-3a.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-3b.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-4.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57-5.d: Likewise. * testsuite/ld-x86-64/property-x86-lam-u57.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run LAM tests.
39 lines
1.4 KiB
Bash
39 lines
1.4 KiB
Bash
PARSE_AND_LIST_OPTIONS_CET='
|
|
fprintf (file, _("\
|
|
-z ibtplt Generate IBT-enabled PLT entries\n"));
|
|
fprintf (file, _("\
|
|
-z ibt Generate GNU_PROPERTY_X86_FEATURE_1_IBT\n"));
|
|
fprintf (file, _("\
|
|
-z shstk Generate GNU_PROPERTY_X86_FEATURE_1_SHSTK\n"));
|
|
fprintf (file, _("\
|
|
-z cet-report=[none|warning|error] (default: none)\n\
|
|
Report missing IBT and SHSTK properties\n"));
|
|
'
|
|
PARSE_AND_LIST_ARGS_CASE_Z_CET='
|
|
else if (strcmp (optarg, "ibtplt") == 0)
|
|
params.ibtplt = TRUE;
|
|
else if (strcmp (optarg, "ibt") == 0)
|
|
params.ibt = TRUE;
|
|
else if (strcmp (optarg, "shstk") == 0)
|
|
params.shstk = TRUE;
|
|
else if (strncmp (optarg, "cet-report=", 11) == 0)
|
|
{
|
|
if (strcmp (optarg + 11, "none") == 0)
|
|
params.cet_report = prop_report_none;
|
|
else if (strcmp (optarg + 11, "warning") == 0)
|
|
params.cet_report = (prop_report_warning
|
|
| prop_report_ibt
|
|
| prop_report_shstk);
|
|
else if (strcmp (optarg + 11, "error") == 0)
|
|
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);
|
|
}
|
|
'
|
|
|
|
PARSE_AND_LIST_OPTIONS="$PARSE_AND_LIST_OPTIONS $PARSE_AND_LIST_OPTIONS_CET"
|
|
PARSE_AND_LIST_ARGS_CASE_Z="$PARSE_AND_LIST_ARGS_CASE_Z $PARSE_AND_LIST_ARGS_CASE_Z_CET"
|