about summary refs log tree commit diff
path: root/sysdeps/x86_64
diff options
context:
space:
mode:
authorFrédéric Bérat <fberat@redhat.com>2023-04-20 14:07:52 +0200
committerFrédéric Bérat <fberat@redhat.com>2023-07-05 16:59:48 +0200
commitdd8486ffc195f5fe150b2d3724c7712686cfddb0 (patch)
tree8c6a24a94d1884b92f9b48536b39847110a23564 /sysdeps/x86_64
parentba96ff24b253d0321508b8b462103bbaa2975bb5 (diff)
downloadglibc-dd8486ffc195f5fe150b2d3724c7712686cfddb0.tar.gz
glibc-dd8486ffc195f5fe150b2d3724c7712686cfddb0.tar.xz
glibc-dd8486ffc195f5fe150b2d3724c7712686cfddb0.zip
string: Ensure *_chk routines have their hidden builtin definition available
If libc_hidden_builtin_{def,proto} isn't properly set for *_chk routines,
there are unwanted PLT entries in libc.so.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r--sysdeps/x86_64/memcpy_chk.S1
-rw-r--r--sysdeps/x86_64/memmove_chk.S1
-rw-r--r--sysdeps/x86_64/mempcpy_chk.S1
-rw-r--r--sysdeps/x86_64/memset_chk.S1
-rw-r--r--sysdeps/x86_64/multiarch/memcpy_chk.c4
-rw-r--r--sysdeps/x86_64/multiarch/memmove_chk.c4
-rw-r--r--sysdeps/x86_64/multiarch/mempcpy_chk.c4
-rw-r--r--sysdeps/x86_64/multiarch/memset_chk.c4
8 files changed, 20 insertions, 0 deletions
diff --git a/sysdeps/x86_64/memcpy_chk.S b/sysdeps/x86_64/memcpy_chk.S
index 25cbeb37ee..43843a7abb 100644
--- a/sysdeps/x86_64/memcpy_chk.S
+++ b/sysdeps/x86_64/memcpy_chk.S
@@ -30,4 +30,5 @@ ENTRY (__memcpy_chk)
 	jb	__chk_fail
 	jmp	memcpy
 END (__memcpy_chk)
+libc_hidden_builtin_def (__memcpy_chk)
 #endif
diff --git a/sysdeps/x86_64/memmove_chk.S b/sysdeps/x86_64/memmove_chk.S
index 165d42cfa8..37e2c30ba8 100644
--- a/sysdeps/x86_64/memmove_chk.S
+++ b/sysdeps/x86_64/memmove_chk.S
@@ -30,4 +30,5 @@ ENTRY (__memmove_chk)
 	jb	__chk_fail
 	jmp	memmove
 END (__memmove_chk)
+libc_hidden_builtin_def (MEMMOVE_CHK)
 #endif
diff --git a/sysdeps/x86_64/mempcpy_chk.S b/sysdeps/x86_64/mempcpy_chk.S
index b60ee4ff08..facdac50d8 100644
--- a/sysdeps/x86_64/mempcpy_chk.S
+++ b/sysdeps/x86_64/mempcpy_chk.S
@@ -30,4 +30,5 @@ ENTRY (__mempcpy_chk)
 	jb	__chk_fail
 	jmp	__mempcpy
 END (__mempcpy_chk)
+libc_hidden_builtin_def (__mempcpy_chk)
 #endif
diff --git a/sysdeps/x86_64/memset_chk.S b/sysdeps/x86_64/memset_chk.S
index ed53b8927f..c927884b1a 100644
--- a/sysdeps/x86_64/memset_chk.S
+++ b/sysdeps/x86_64/memset_chk.S
@@ -30,4 +30,5 @@ ENTRY (__memset_chk)
 	jb	__chk_fail
 	jmp	memset
 END (__memset_chk)
+libc_hidden_builtin_def (__memset_chk)
 #endif
diff --git a/sysdeps/x86_64/multiarch/memcpy_chk.c b/sysdeps/x86_64/multiarch/memcpy_chk.c
index 5ac5cb1d7a..ec945dc91f 100644
--- a/sysdeps/x86_64/multiarch/memcpy_chk.c
+++ b/sysdeps/x86_64/multiarch/memcpy_chk.c
@@ -28,4 +28,8 @@
 
 libc_ifunc_redirected (__redirect_memcpy_chk, __memcpy_chk,
 		       IFUNC_SELECTOR ());
+# ifdef SHARED
+__hidden_ver1 (__memcpy_chk, __GI___memcpy_chk, __redirect_memcpy_chk)
+  __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__memcpy_chk);
+# endif
 #endif
diff --git a/sysdeps/x86_64/multiarch/memmove_chk.c b/sysdeps/x86_64/multiarch/memmove_chk.c
index 28161d3c27..55c7601d5d 100644
--- a/sysdeps/x86_64/multiarch/memmove_chk.c
+++ b/sysdeps/x86_64/multiarch/memmove_chk.c
@@ -28,4 +28,8 @@
 
 libc_ifunc_redirected (__redirect_memmove_chk, __memmove_chk,
 		       IFUNC_SELECTOR ());
+# ifdef SHARED
+__hidden_ver1 (__memmove_chk, __GI___memmove_chk, __redirect_memmove_chk)
+  __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__memmove_chk);
+# endif
 #endif
diff --git a/sysdeps/x86_64/multiarch/mempcpy_chk.c b/sysdeps/x86_64/multiarch/mempcpy_chk.c
index 36c81ae61a..83569cf9d9 100644
--- a/sysdeps/x86_64/multiarch/mempcpy_chk.c
+++ b/sysdeps/x86_64/multiarch/mempcpy_chk.c
@@ -28,4 +28,8 @@
 
 libc_ifunc_redirected (__redirect_mempcpy_chk, __mempcpy_chk,
 		       IFUNC_SELECTOR ());
+# ifdef SHARED
+__hidden_ver1 (__mempcpy_chk, __GI___mempcpy_chk, __redirect_mempcpy_chk)
+  __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__mempcpy_chk);
+# endif
 #endif
diff --git a/sysdeps/x86_64/multiarch/memset_chk.c b/sysdeps/x86_64/multiarch/memset_chk.c
index d81147a70c..1a7503858d 100644
--- a/sysdeps/x86_64/multiarch/memset_chk.c
+++ b/sysdeps/x86_64/multiarch/memset_chk.c
@@ -28,4 +28,8 @@
 
 libc_ifunc_redirected (__redirect_memset_chk, __memset_chk,
 		       IFUNC_SELECTOR ());
+# ifdef SHARED
+__hidden_ver1 (__memset_chk, __GI___memset_chk, __redirect_memset_chk)
+  __attribute__ ((visibility ("hidden"))) __attribute_copy__ (__memset_chk);
+# endif
 #endif