diff mbox series

[v2,10/20] aarch64: Allow building without kernel support for BTI

Message ID 20240323173301.151066-11-bugaevc@gmail.com
State New
Headers show
Series aarch64-gnu port & GNU/Hurd on AArch64 progress | expand

Commit Message

Sergey Bugaev March 23, 2024, 5:32 p.m. UTC
If PROT_BTI is not defined, turn _dl_bti_protect () into a no-op.

We intend to support BTI & PROT_BTI on the Hurd eventually, but we're
not there yet.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
 sysdeps/aarch64/dl-bti.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/sysdeps/aarch64/dl-bti.c b/sysdeps/aarch64/dl-bti.c
index fd0d308a..4cf85630 100644
--- a/sysdeps/aarch64/dl-bti.c
+++ b/sysdeps/aarch64/dl-bti.c
@@ -28,6 +28,7 @@ 
 
 /* Enable BTI protection for MAP.  */
 
+#ifdef PROT_BTI
 void
 _dl_bti_protect (struct link_map *map, int fd)
 {
@@ -59,6 +60,15 @@  _dl_bti_protect (struct link_map *map, int fd)
       }
 }
 
+#else /* PROT_BTI */
+void
+_dl_bti_protect (struct link_map *map, int fd)
+{
+  (void) map;
+  (void) fd;
+}
+#endif
+
 
 static void
 bti_failed (struct link_map *l, const char *program)