about summary refs log tree commit diff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2021-10-11 11:14:02 -0700
committerFangrui Song <maskray@google.com>2021-10-11 11:14:02 -0700
commitbf433b849ae6f0cacf566a458c918bfd492ee732 (patch)
treeb84cb04c0e82799e0105a84a5765a7c095c4e1a2 /sysdeps/i386
parenteb73b87897798de981dbbf019aa957045d768adb (diff)
downloadglibc-bf433b849ae6f0cacf566a458c918bfd492ee732.tar.gz
glibc-bf433b849ae6f0cacf566a458c918bfd492ee732.tar.xz
glibc-bf433b849ae6f0cacf566a458c918bfd492ee732.zip
elf: Remove Intel MPX support (lazy PLT, ld.so profile, and LD_AUDIT)
Intel MPX failed to gain wide adoption and has been deprecated for a
while. GCC 9.1 removed Intel MPX support. Linux kernel removed MPX in
2019.

This patch removes the support code from the dynamic loader.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/configure27
-rw-r--r--sysdeps/i386/configure.ac15
-rw-r--r--sysdeps/i386/dl-trampoline.S21
-rw-r--r--sysdeps/i386/link-defines.sym2
4 files changed, 0 insertions, 65 deletions
diff --git a/sysdeps/i386/configure b/sysdeps/i386/configure
index bb482ca16c..ed46d53314 100644
--- a/sysdeps/i386/configure
+++ b/sysdeps/i386/configure
@@ -83,33 +83,6 @@ $as_echo "$libc_cv_ld_static_pie" >&6; }
   fi
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Intel MPX support" >&5
-$as_echo_n "checking for Intel MPX support... " >&6; }
-if ${libc_cv_asm_mpx+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.s <<\EOF
-        bndmov %bnd0,(%esp)
-EOF
-if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-  libc_cv_asm_mpx=yes
-else
-  libc_cv_asm_mpx=no
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_mpx" >&5
-$as_echo "$libc_cv_asm_mpx" >&6; }
-if test $libc_cv_asm_mpx = yes; then
-  $as_echo "#define HAVE_MPX_SUPPORT 1" >>confdefs.h
-
-fi
-
 $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
 
 
diff --git a/sysdeps/i386/configure.ac b/sysdeps/i386/configure.ac
index 5e43eb0adf..a6a0672835 100644
--- a/sysdeps/i386/configure.ac
+++ b/sysdeps/i386/configure.ac
@@ -53,21 +53,6 @@ rm -f conftest*])
   fi
 fi
 
-dnl Check whether asm supports Intel MPX
-AC_CACHE_CHECK(for Intel MPX support, libc_cv_asm_mpx, [dnl
-cat > conftest.s <<\EOF
-        bndmov %bnd0,(%esp)
-EOF
-if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
-  libc_cv_asm_mpx=yes
-else
-  libc_cv_asm_mpx=no
-fi
-rm -f conftest*])
-if test $libc_cv_asm_mpx = yes; then
-  AC_DEFINE(HAVE_MPX_SUPPORT)
-fi
-
 dnl It is always possible to access static and hidden symbols in an
 dnl position independent way.
 AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/sysdeps/i386/dl-trampoline.S b/sysdeps/i386/dl-trampoline.S
index b5ec0326df..5669ab18f5 100644
--- a/sysdeps/i386/dl-trampoline.S
+++ b/sysdeps/i386/dl-trampoline.S
@@ -19,12 +19,6 @@
 #include <sysdep.h>
 #include <link-defines.h>
 
-#ifdef HAVE_MPX_SUPPORT
-# define PRESERVE_BND_REGS_PREFIX bnd
-#else
-# define PRESERVE_BND_REGS_PREFIX .byte 0xf2
-#endif
-
 	.text
 	.globl _dl_runtime_resolve
 	.type _dl_runtime_resolve, @function
@@ -250,13 +244,6 @@ _dl_runtime_profile:
 	movl %edx, LRV_EDX_OFFSET(%esp)
 	fstpt LRV_ST0_OFFSET(%esp)
 	fstpt LRV_ST1_OFFSET(%esp)
-#ifdef HAVE_MPX_SUPPORT
-	bndmov %bnd0, LRV_BND0_OFFSET(%esp)
-	bndmov %bnd1, LRV_BND1_OFFSET(%esp)
-#else
-	.byte 0x66,0x0f,0x1b,0x44,0x24,LRV_BND0_OFFSET
-	.byte 0x66,0x0f,0x1b,0x4c,0x24,LRV_BND1_OFFSET
-#endif
 	pushl %esp
 	cfi_adjust_cfa_offset (4)
 	# Address of La_i86_regs area.
@@ -270,17 +257,9 @@ _dl_runtime_profile:
 	movl LRV_EDX_OFFSET(%esp), %edx
 	fldt LRV_ST1_OFFSET(%esp)
 	fldt LRV_ST0_OFFSET(%esp)
-#ifdef HAVE_MPX_SUPPORT
-	bndmov LRV_BND0_OFFSET(%esp), %bnd0
-	bndmov LRV_BND1_OFFSET(%esp), %bnd1
-#else
-	.byte 0x66,0x0f,0x1a,0x44,0x24,LRV_BND0_OFFSET
-	.byte 0x66,0x0f,0x1a,0x4c,0x24,LRV_BND1_OFFSET
-#endif
 	# Restore stack before return.
 	addl $(LRV_SIZE + 4 + LR_SIZE + 4), %esp
 	cfi_adjust_cfa_offset (-(LRV_SIZE + 4 + LR_SIZE + 4))
-	PRESERVE_BND_REGS_PREFIX
 	ret
 	cfi_endproc
 	.size _dl_runtime_profile, .-_dl_runtime_profile
diff --git a/sysdeps/i386/link-defines.sym b/sysdeps/i386/link-defines.sym
index 0995adb37f..a63dcb9218 100644
--- a/sysdeps/i386/link-defines.sym
+++ b/sysdeps/i386/link-defines.sym
@@ -16,5 +16,3 @@ LRV_EAX_OFFSET		offsetof (struct La_i86_retval, lrv_eax)
 LRV_EDX_OFFSET		offsetof (struct La_i86_retval, lrv_edx)
 LRV_ST0_OFFSET		offsetof (struct La_i86_retval, lrv_st0)
 LRV_ST1_OFFSET		offsetof (struct La_i86_retval, lrv_st1)
-LRV_BND0_OFFSET		offsetof (struct La_i86_retval, lrv_bnd0)
-LRV_BND1_OFFSET		offsetof (struct La_i86_retval, lrv_bnd1)