debug: Increase tst-fortify checks for compiler without __va_arg_pack support

The fortify wrappers for varargs functions already add fallbacks to
builtins calls if __va_arg_pack is not supported.

Checked on aarch64, armhf, x86_64, and i686.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
This commit is contained in:
Adhemerval Zanella 2023-12-21 15:59:16 -03:00
parent 9556acd249
commit bf320000b4

View File

@ -130,7 +130,7 @@ static int num2 = 987654;
chk_fail_ok = 0; \ chk_fail_ok = 0; \
FAIL (); \ FAIL (); \
} }
#if __USE_FORTIFY_LEVEL >= 2 && (!defined __cplusplus || defined __va_arg_pack) #if __USE_FORTIFY_LEVEL >= 2
# define CHK_FAIL2_START CHK_FAIL_START # define CHK_FAIL2_START CHK_FAIL_START
# define CHK_FAIL2_END CHK_FAIL_END # define CHK_FAIL2_END CHK_FAIL_END
#else #else
@ -419,7 +419,6 @@ do_test (void)
stpncpy (buf + 6, "cd", l0 + 5); stpncpy (buf + 6, "cd", l0 + 5);
CHK_FAIL_END CHK_FAIL_END
# if !defined __cplusplus || defined __va_arg_pack
CHK_FAIL_START CHK_FAIL_START
sprintf (buf + 8, "%d", num1); sprintf (buf + 8, "%d", num1);
CHK_FAIL_END CHK_FAIL_END
@ -439,7 +438,6 @@ do_test (void)
CHK_FAIL_START CHK_FAIL_START
swprintf (wbuf + 8, l0 + 3, L"%d", num1); swprintf (wbuf + 8, l0 + 3, L"%d", num1);
CHK_FAIL_END CHK_FAIL_END
# endif
memcpy (buf, str1 + 2, 9); memcpy (buf, str1 + 2, 9);
CHK_FAIL_START CHK_FAIL_START
@ -550,7 +548,6 @@ do_test (void)
FAIL (); FAIL ();
} }
# if !defined __cplusplus || defined __va_arg_pack
CHK_FAIL_START CHK_FAIL_START
sprintf (a.buf1 + (O + 7), "%d", num1); sprintf (a.buf1 + (O + 7), "%d", num1);
CHK_FAIL_END CHK_FAIL_END
@ -562,7 +559,6 @@ do_test (void)
CHK_FAIL_START CHK_FAIL_START
snprintf (a.buf1 + (O + 7), l0 + 3, "%d", num2); snprintf (a.buf1 + (O + 7), l0 + 3, "%d", num2);
CHK_FAIL_END CHK_FAIL_END
# endif
memcpy (a.buf1, str1 + (3 - O), 8 + O); memcpy (a.buf1, str1 + (3 - O), 8 + O);
CHK_FAIL_START CHK_FAIL_START