1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

string: Enable __FORTIFY_LEVEL=3

This change enhances fortified string functions to use
__builtin_dynamic_object_size under _FORTIFY_SOURCE=3 whenever the
compiler supports it.
This commit is contained in:
Siddhesh Poyarekar
2020-12-30 11:09:58 +05:30
parent c43c579612
commit 2a3224c536
3 changed files with 25 additions and 15 deletions

View File

@@ -22,13 +22,15 @@
__fortify_function void
__NTH (bcopy (const void *__src, void *__dest, size_t __len))
{
(void) __builtin___memmove_chk (__dest, __src, __len, __bos0 (__dest));
(void) __builtin___memmove_chk (__dest, __src, __len,
__glibc_objsize0 (__dest));
}
__fortify_function void
__NTH (bzero (void *__dest, size_t __len))
{
(void) __builtin___memset_chk (__dest, '\0', __len, __bos0 (__dest));
(void) __builtin___memset_chk (__dest, '\0', __len,
__glibc_objsize0 (__dest));
}
#endif