about summary refs log tree commit diff
path: root/sysdeps/x86_64
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-01-10 08:48:47 -0800
committerH.J. Lu <hjl.tools@gmail.com>2024-01-11 20:35:24 -0800
commitf2b65a44714e8fa13c7637cd9413169590795879 (patch)
tree8365442e1989ac5f3635013d4e3cfcadaba97b23 /sysdeps/x86_64
parentdb57da5be27a0887ce5131c071e2240f5c17aae1 (diff)
downloadglibc-f2b65a44714e8fa13c7637cd9413169590795879.tar.gz
glibc-f2b65a44714e8fa13c7637cd9413169590795879.tar.xz
glibc-f2b65a44714e8fa13c7637cd9413169590795879.zip
x86-64/cet: Make CET feature check specific to Linux/x86
CET feature bits in TCB, which are Linux specific, are used to check if
CET features are active.  Move CET feature check to Linux/x86 directory.
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r--sysdeps/x86_64/dl-machine.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sysdeps/x86_64/dl-machine.h b/sysdeps/x86_64/dl-machine.h
index 2d2ce503a5..6d605d0d32 100644
--- a/sysdeps/x86_64/dl-machine.h
+++ b/sysdeps/x86_64/dl-machine.h
@@ -587,10 +587,11 @@ x86_64_rewrite_plt (struct link_map *map, ElfW(Addr) plt_rewrite)
   const ElfW(Rela) *reloc = (const void *) start;
   const ElfW(Rela) *reloc_end = (const void *) (start + size);
 
-  unsigned int feature_1 = THREAD_GETMEM (THREAD_SELF,
-					  header.feature_1);
-  bool ibt_enabled_p
-    = (feature_1 & GNU_PROPERTY_X86_FEATURE_1_IBT) != 0;
+# ifdef __CET__
+  bool ibt_enabled_p = dl_cet_ibt_enabled ();
+# else
+  bool ibt_enabled_p = false;
+# endif
 
   if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
     _dl_debug_printf ("\nchanging PLT in '%s' to direct branch\n",