mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Joao Moreira <joao.moreira@intel.com>
To: musl@lists.openwall.com
Subject: [musl] [PATCH 2/4] Add ENDBRANCH64 and ENDBRANCH32 macro definitions
Date: Mon, 19 Oct 2020 15:43:40 -0700	[thread overview]
Message-ID: <20201019224342.53303-3-joao.moreira@intel.com> (raw)
In-Reply-To: <20201019224342.53303-1-joao.moreira@intel.com>

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 <joao.moreira@intel.com>
---
 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
-- 
2.27.0


  parent reply	other threads:[~2020-10-19 22:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 22:43 [musl] [PATCH 0/4] Add CET IBT Support to MUSL Joao Moreira
2020-10-19 22:43 ` [musl] [PATCH 1/4] Support ASFLAGS in configure and Makefile Joao Moreira
2020-10-19 22:43 ` Joao Moreira [this message]
2020-10-19 22:43 ` [musl] [PATCH 3/4] Add endbr64 to x86_64 assembly functions Joao Moreira
2020-10-19 22:43 ` [musl] [PATCH 4/4] Add endbr32 to i386 " Joao Moreira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201019224342.53303-3-joao.moreira@intel.com \
    --to=joao.moreira@intel.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).