From patchwork Mon Oct 19 22:43:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/4] Add ENDBRANCH64 and ENDBRANCH32 macro definitions From: Joao Moreira X-Patchwork-Id: 13654 Message-Id: <20201019224342.53303-3-joao.moreira@intel.com> To: musl@lists.openwall.com Date: Mon, 19 Oct 2020 15:43:40 -0700 Define ENDBRANCH64 and ENDBRANCH32 macros to endbr64 and endbr32 instructions, respectively, in case the flag CET_IBT is set. If the flag is not set, the macros are defined to nothing. These macros will later be used to properly add endbranch instruction to x86 and i386 assembly functions. Signed-off-by: Joao Moreira --- src/include/ibt.s | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/include/ibt.s diff --git a/src/include/ibt.s b/src/include/ibt.s new file mode 100644 index 00000000..2f16006f --- /dev/null +++ b/src/include/ibt.s @@ -0,0 +1,13 @@ +.ifdef CET_IBT + .macro ENDBRANCH64 + endbr64 + .endm + .macro ENDBRANCH32 + endbr32 + .endm +.else + .macro ENDBRANCH64 + .endm + .macro ENDBRANCH32 + .endm +.endif