also enable __chk_fail and only try to call it when SSP is on
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
#include <features.h>
#ifdef __UCLIBC_SUSV3_LEGACY__
# define memset bzero
+# define __memset_chk __bzero_chk
# include "memset.S"
#endif
#if defined __PIC__ && !defined NOT_IN_libc
ENTRY (__memcpy_chk)
cmpq %rdx, %rcx
+#if defined __UCLIBC_HAS_SSP__
jb HIDDEN_JUMPTARGET (__chk_fail)
+#endif
END (__memcpy_chk)
#endif
ENTRY (BP_SYM (memcpy))
#define memcpy mempcpy
+#define __memcpy_chk __mempcpy_chk
#include "memcpy.S"
libc_hidden_def(mempcpy)
#define LARGE $120000
.text
-#if !BZERO_P && defined __PIC__ && !defined NOT_IN_libc
+#if defined __PIC__ && !defined NOT_IN_libc
ENTRY (__memset_chk)
cmpq %rdx, %rcx
+#if defined __UCLIBC_HAS_SSP__
jb HIDDEN_JUMPTARGET (__chk_fail)
+#endif
END (__memset_chk)
#endif
ENTRY (memset)
terminate();
}
-#if 0
void __chk_fail(void) attribute_noreturn;
void __chk_fail(void)
{
while(1)
terminate();
}
-#endif
+