mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-08 14:20:07 +00:00
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>
This commit is contained in:
parent
ba96ff24b2
commit
dd8486ffc1
@ -28,3 +28,4 @@ __memcpy_chk (void *dstpp, const void *srcpp, size_t len, size_t dstlen)
|
||||
|
||||
return memcpy (dstpp, srcpp, len);
|
||||
}
|
||||
libc_hidden_builtin_def (__memcpy_chk)
|
||||
|
@ -32,3 +32,4 @@ MEMMOVE_CHK (void *dest, const void *src, size_t len, size_t destlen)
|
||||
|
||||
return memmove (dest, src, len);
|
||||
}
|
||||
libc_hidden_builtin_def (MEMMOVE_CHK)
|
||||
|
@ -29,3 +29,4 @@ __mempcpy_chk (void *dstpp, const void *srcpp, size_t len, size_t dstlen)
|
||||
|
||||
return __mempcpy (dstpp, srcpp, len);
|
||||
}
|
||||
libc_hidden_builtin_def (__mempcpy_chk)
|
||||
|
@ -26,3 +26,4 @@ __memset_chk (void *dstpp, int c, size_t len, size_t dstlen)
|
||||
|
||||
return memset (dstpp, c, len);
|
||||
}
|
||||
libc_hidden_builtin_def (__memset_chk)
|
||||
|
@ -32,3 +32,4 @@ __stpcpy_chk (char *dest, const char *src, size_t destlen)
|
||||
|
||||
return memcpy (dest, src, len + 1) + len;
|
||||
}
|
||||
libc_hidden_builtin_def (__stpcpy_chk)
|
||||
|
@ -208,6 +208,13 @@ extern char *__strcat_chk (char *__restrict __dest,
|
||||
extern char *__strncat_chk (char *__restrict __dest,
|
||||
const char *__restrict __src,
|
||||
size_t __len, size_t __destlen) __THROW;
|
||||
|
||||
libc_hidden_builtin_proto (__memcpy_chk)
|
||||
libc_hidden_builtin_proto (__memmove_chk)
|
||||
libc_hidden_builtin_proto (__mempcpy_chk)
|
||||
libc_hidden_builtin_proto (__memset_chk)
|
||||
libc_hidden_builtin_proto (__stpcpy_chk)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -32,6 +32,7 @@ ENTRY (__memcpy_chk)
|
||||
cmpl %eax, 16(%esp)
|
||||
jb HIDDEN_JUMPTARGET (__chk_fail)
|
||||
END (__memcpy_chk)
|
||||
libc_hidden_builtin_def (__memcpy_chk)
|
||||
#endif
|
||||
ENTRY (memcpy)
|
||||
|
||||
|
@ -33,6 +33,7 @@ ENTRY (__memset_chk)
|
||||
cmpl %eax, 16(%esp)
|
||||
jb HIDDEN_JUMPTARGET (__chk_fail)
|
||||
END (__memset_chk)
|
||||
libc_hidden_builtin_def (__memset_chk)
|
||||
#endif
|
||||
ENTRY (memset)
|
||||
|
||||
|
@ -33,6 +33,7 @@ ENTRY_CHK (__memcpy_chk)
|
||||
cmpl %eax, 16(%esp)
|
||||
jb HIDDEN_JUMPTARGET (__chk_fail)
|
||||
END_CHK (__memcpy_chk)
|
||||
libc_hidden_builtin_def (__memcpy_chk)
|
||||
#endif
|
||||
ENTRY (memcpy)
|
||||
|
||||
|
@ -35,6 +35,7 @@ ENTRY_CHK (__memmove_chk)
|
||||
cmpl %eax, 16(%esp)
|
||||
jb HIDDEN_JUMPTARGET (__chk_fail)
|
||||
END_CHK (__memmove_chk)
|
||||
libc_hidden_builtin_def (__memmove_chk)
|
||||
#endif
|
||||
|
||||
ENTRY (memmove)
|
||||
|
@ -33,6 +33,7 @@ ENTRY_CHK (__mempcpy_chk)
|
||||
cmpl %eax, 16(%esp)
|
||||
jb HIDDEN_JUMPTARGET (__chk_fail)
|
||||
END_CHK (__mempcpy_chk)
|
||||
libc_hidden_builtin_def (__mempcpy_chk)
|
||||
#endif
|
||||
ENTRY (__mempcpy)
|
||||
|
||||
|
@ -33,6 +33,7 @@ ENTRY_CHK (__memset_chk)
|
||||
cmpl %eax, 16(%esp)
|
||||
jb HIDDEN_JUMPTARGET (__chk_fail)
|
||||
END_CHK (__memset_chk)
|
||||
libc_hidden_builtin_def (__memset_chk)
|
||||
#endif
|
||||
ENTRY (memset)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -28,5 +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
|
||||
|
@ -31,4 +31,5 @@ ENTRY (__memcpy_chk)
|
||||
jb __chk_fail
|
||||
jmp memcpy
|
||||
END (__memcpy_chk)
|
||||
libc_hidden_builtin_def (__memcpy_chk)
|
||||
#endif
|
||||
|
@ -30,4 +30,5 @@ ENTRY (__memmove_chk)
|
||||
jb __chk_fail
|
||||
jmp memmove
|
||||
END (__memmove_chk)
|
||||
libc_hidden_builtin_def (MEMMOVE_CHK)
|
||||
#endif
|
||||
|
@ -30,4 +30,5 @@ ENTRY (__mempcpy_chk)
|
||||
jb __chk_fail
|
||||
jmp __mempcpy
|
||||
END (__mempcpy_chk)
|
||||
libc_hidden_builtin_def (__mempcpy_chk)
|
||||
#endif
|
||||
|
@ -30,4 +30,5 @@ ENTRY (__memset_chk)
|
||||
jb __chk_fail
|
||||
jmp memset
|
||||
END (__memset_chk)
|
||||
libc_hidden_builtin_def (__memset_chk)
|
||||
#endif
|
||||
|
@ -30,4 +30,5 @@ ENTRY (__memcpy_chk)
|
||||
jb __chk_fail
|
||||
jmp memcpy
|
||||
END (__memcpy_chk)
|
||||
libc_hidden_builtin_def (__memcpy_chk)
|
||||
#endif
|
||||
|
@ -30,4 +30,5 @@ ENTRY (__memmove_chk)
|
||||
jb __chk_fail
|
||||
jmp memmove
|
||||
END (__memmove_chk)
|
||||
libc_hidden_builtin_def (MEMMOVE_CHK)
|
||||
#endif
|
||||
|
@ -30,4 +30,5 @@ ENTRY (__mempcpy_chk)
|
||||
jb __chk_fail
|
||||
jmp __mempcpy
|
||||
END (__mempcpy_chk)
|
||||
libc_hidden_builtin_def (__mempcpy_chk)
|
||||
#endif
|
||||
|
@ -30,4 +30,5 @@ ENTRY (__memset_chk)
|
||||
jb __chk_fail
|
||||
jmp memset
|
||||
END (__memset_chk)
|
||||
libc_hidden_builtin_def (__memset_chk)
|
||||
#endif
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user