Select Git revision
Forked from
Nettle / nettle
Source project has a limited visibility.
-
Intel Control-flow Enforcement Technology (CET): https://software.intel.com/en-us/articles/intel-sdm contains shadow stack (SHSTK) and indirect branch tracking (IBT). When CET is enabled, ELF object files must be marked with .note.gnu.property section. Also when IBT is enabled, all indirect branch targets must start with ENDBR instruction. This patch adds ASM_X86_ENDBR and the x86 CET marker to config.m4.in when CET is enabled. It updates PROLOGUE with ASM_X86_ENDBR. Tested on CET machine with i686 and x86-64. Signed-off-by:
H.J. Lu <hjl.tools@gmail.com>
Intel Control-flow Enforcement Technology (CET): https://software.intel.com/en-us/articles/intel-sdm contains shadow stack (SHSTK) and indirect branch tracking (IBT). When CET is enabled, ELF object files must be marked with .note.gnu.property section. Also when IBT is enabled, all indirect branch targets must start with ENDBR instruction. This patch adds ASM_X86_ENDBR and the x86 CET marker to config.m4.in when CET is enabled. It updates PROLOGUE with ASM_X86_ENDBR. Tested on CET machine with i686 and x86-64. Signed-off-by:
H.J. Lu <hjl.tools@gmail.com>
asm.m4 2.23 KiB
divert(-1)
changequote(<,>)dnl
dnl (progn (modify-syntax-entry ?< "(>") (modify-syntax-entry ?> ")<") )
dnl FORTRAN style comment character
define(<C>, <
dnl>)dnl
dnl Disable m4 comment processing, since the default, #, is used for
dnl constants on some architectures, in particular ARM.
changecom()dnl
dnl Including files from the srcdir
define(<include_src>, <include(srcdir/$1)>)dnl
dnl default definition, changed in fat builds
define(<fat_transform>, <$1>)
define(<C_NAME>, <SYMBOL_PREFIX<>fat_transform($1)>)
dnl Pseudo ops
define(<DECLARE_FUNC>,
<ifelse(ELF_STYLE,yes,
<.type $1,TYPE_FUNCTION>,
COFF_STYLE, yes,
<.def $1
.scl 2
.type 32
.endef>,
<>)>)
define(<GMP_NUMB_BITS>,<>)dnl
define(<PROLOGUE>,
<.globl C_NAME($1)
DECLARE_FUNC(C_NAME($1))
C_NAME($1): ASM_X86_ENDBR>)
define(<EPILOGUE>,
<ifelse(ELF_STYLE,yes,
<.size C_NAME($1), . - C_NAME($1)>,<>)>)
define(<m4_log2>, <m4_log2_internal($1,1,0)>)
define(<m4_log2_internal>,
<ifelse($3, 10, <not-a-power-of-two>,
$1, $2, $3,
<m4_log2_internal($1, eval(2*$2), eval(1 + $3))>)>)
dnl Argument to ALIGN is always in bytes, and converted to a
dnl logarithmic .align if necessary.
define(<ALIGN>,
<.align ifelse(ALIGN_LOG,yes,<m4_log2($1)>,$1)
>)
define(<IF_BE>, <ifelse(
WORDS_BIGENDIAN,yes,<$1>,
WORDS_BIGENDIAN,no,<$2>,
<errprint(<Unsupported endianness value>,WORDS_BIGENDIAN,<
>)
m4exit(1)>)>)
define(<IF_LE>, <IF_BE(<$2>, <$1>)>)
dnl Struct defining macros
dnl STRUCTURE(prefix)
define(<STRUCTURE>, <define(<SOFFSET>, 0)define(<SPREFIX>, <$1>)>)dnl
dnl STRUCT(name, size)
define(<STRUCT>,
<define(SPREFIX<_>$1, SOFFSET)dnl
define(<SOFFSET>, eval(SOFFSET + ($2)))>)dnl