This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Using __chk_fail from libstdc++
On 06/01/2012 10:23 PM, Roland McGrath wrote:
Perhaps it is possible to express this in a test case?
Good point. It sounds to me like you or Mike just volunteered. ;-)
It turns out that there already is a test case which checks this
implicitly. I think adding a comment to it is sufficient.
2012-06-04 Florian Weimer <fweimer@redhat.com>
* debug/test-strcpy_chk.c: Mention __chk_fail ABI test.
--
Florian Weimer / Red Hat Product Security Team
diff --git a/debug/test-strcpy_chk.c b/debug/test-strcpy_chk.c
index 2536362..c8250b9 100644
--- a/debug/test-strcpy_chk.c
+++ b/debug/test-strcpy_chk.c
@@ -22,6 +22,9 @@
# define TEST_MAIN
# include "../string/test-string.h"
+/* This test case implicitly tests the availability of the __chk_fail
+ symbol, which is part of the public ABI and may be used
+ externally. */
extern void __attribute__ ((noreturn)) __chk_fail (void);
char *simple_strcpy_chk (char *, const char *, size_t);
extern char *normal_strcpy (char *, const char *, size_t)