From f2b65a44714e8fa13c7637cd9413169590795879 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 10 Jan 2024 08:48:47 -0800 Subject: 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 --- sysdeps/x86_64/dl-machine.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sysdeps/x86_64') 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", -- cgit 1.4.1