From de54b33a3df1de0a2fd0197bec9ab9397298d39a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 19 Oct 2012 22:02:47 -0700 Subject: Add debug IFUNC tests --- ChangeLog | 9 +++++++++ debug/Makefile | 3 +++ debug/test-stpcpy_chk-ifunc.c | 20 ++++++++++++++++++++ debug/test-stpcpy_chk.c | 3 ++- debug/test-strcpy_chk-ifunc.c | 20 ++++++++++++++++++++ debug/test-strcpy_chk.c | 3 ++- 6 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 debug/test-stpcpy_chk-ifunc.c create mode 100644 debug/test-strcpy_chk-ifunc.c diff --git a/ChangeLog b/ChangeLog index eb60959bec..5caa361627 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-10-20 H.J. Lu + + * debug/Makefile (tests-ifunc): New variable. + (tests): Add $(tests-ifunc). + * debug/test-stpcpy_chk.c (TEST_NAME): New macro. + * debug/test-strcpy_chk.c (TEST_NAME): Likewise. + * debug/test-stpcpy_chk-ifunc.c: New file. + * debug/test-strcpy_chk-ifunc.c: Likewise. + 2012-10-20 Siddhesh Poyarekar [BZ #13601] diff --git a/debug/Makefile b/debug/Makefile index ae5b674a96..04dd79981a 100644 --- a/debug/Makefile +++ b/debug/Makefile @@ -126,6 +126,9 @@ tests = backtrace-tst tst-longjmp_chk tst-chk1 tst-chk2 tst-chk3 \ tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6 \ tst-longjmp_chk2 +tests-ifunc := $(stpcpy_chk strcpy_chk:%=test-%-ifunc) +tests += $(tests-ifunc) + extra-libs = libSegFault libpcprofile extra-libs-others = $(extra-libs) diff --git a/debug/test-stpcpy_chk-ifunc.c b/debug/test-stpcpy_chk-ifunc.c new file mode 100644 index 0000000000..1b2bad1576 --- /dev/null +++ b/debug/test-stpcpy_chk-ifunc.c @@ -0,0 +1,20 @@ +/* Test and measure IFUNC implementations of stpcpy checking function. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define TEST_IFUNC 1 +#include "test-stpcpy_chk.c" diff --git a/debug/test-stpcpy_chk.c b/debug/test-stpcpy_chk.c index f7f9a54636..8e2d2d9e02 100644 --- a/debug/test-stpcpy_chk.c +++ b/debug/test-stpcpy_chk.c @@ -1,5 +1,5 @@ /* Test and measure stpcpy checking functions. - Copyright (C) 1999, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 1999-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek , 1999. @@ -19,6 +19,7 @@ #define STRCPY_RESULT(dst, len) ((dst) + (len)) #define TEST_MAIN +#define TEST_NAME "stpcpy_chk" #include "../string/test-string.h" extern void __attribute__ ((noreturn)) __chk_fail (void); diff --git a/debug/test-strcpy_chk-ifunc.c b/debug/test-strcpy_chk-ifunc.c new file mode 100644 index 0000000000..73ed226d5a --- /dev/null +++ b/debug/test-strcpy_chk-ifunc.c @@ -0,0 +1,20 @@ +/* Test and measure IFUNC implementations of strcpy checking function. + Copyright (C) 2012 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define TEST_IFUNC 1 +#include "test-strcpy_chk.c" diff --git a/debug/test-strcpy_chk.c b/debug/test-strcpy_chk.c index 2536362893..fb9bc78d45 100644 --- a/debug/test-strcpy_chk.c +++ b/debug/test-strcpy_chk.c @@ -1,5 +1,5 @@ /* Test and measure __strcpy_chk functions. - Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1999-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Jakub Jelinek , 1999. @@ -20,6 +20,7 @@ #ifndef STRCPY_RESULT # define STRCPY_RESULT(dst, len) dst # define TEST_MAIN +# define TEST_NAME "strcpy_chk" # include "../string/test-string.h" extern void __attribute__ ((noreturn)) __chk_fail (void); -- cgit 1.4.1