x86: Add ENDBR at function entries
[mesa.git] / src / mapi / entry_x86_tls.h
index 58a27cef18ed539d41e2790af45531c93aafa2d9..bdaa97374ba6bc4a8715f60f499a2910d19256ff 100644 (file)
 
 #include <string.h>
 
+#ifdef __CET__
+#define ENDBR "endbr32\n\t"
+#else
+#define ENDBR
+#endif
+
 #ifdef HAVE_FUNC_ATTRIBUTE_VISIBILITY
 #define HIDDEN __attribute__((visibility("hidden")))
 #else
@@ -59,6 +65,7 @@ __asm__(".balign 16\n"
    func ":"
 
 #define STUB_ASM_CODE(slot)                                 \
+   ENDBR                                                    \
    "call 1f\n"                                              \
    "1:\n\t"                                                 \
    "popl %eax\n\t"                                          \