|
Packit Service |
e58aae |
/* Helper header for test-audit-threads.
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
Copyright (C) 2018 Free Software Foundation, Inc.
|
|
Packit Service |
e58aae |
This file is part of the GNU C Library.
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
e58aae |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
e58aae |
License as published by the Free Software Foundation; either
|
|
Packit Service |
e58aae |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
e58aae |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
e58aae |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
e58aae |
Lesser General Public License for more details.
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
e58aae |
License along with the GNU C Library; if not, see
|
|
Packit Service |
e58aae |
<http://www.gnu.org/licenses/>. */
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
/* We use this helper to create a large number of functions, all of
|
|
Packit Service |
e58aae |
which will be resolved lazily and thus have their PLT updated.
|
|
Packit Service |
e58aae |
This is done to provide enough functions that we can statistically
|
|
Packit Service |
e58aae |
observe a thread vs. PLT resolution failure if one exists. */
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
#define CONCAT(a, b) a ## b
|
|
Packit Service |
e58aae |
#define NUM(x, y) CONCAT (x, y)
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
#define FUNC10(x) \
|
|
Packit Service |
e58aae |
FUNC (NUM (x, 0)); \
|
|
Packit Service |
e58aae |
FUNC (NUM (x, 1)); \
|
|
Packit Service |
e58aae |
FUNC (NUM (x, 2)); \
|
|
Packit Service |
e58aae |
FUNC (NUM (x, 3)); \
|
|
Packit Service |
e58aae |
FUNC (NUM (x, 4)); \
|
|
Packit Service |
e58aae |
FUNC (NUM (x, 5)); \
|
|
Packit Service |
e58aae |
FUNC (NUM (x, 6)); \
|
|
Packit Service |
e58aae |
FUNC (NUM (x, 7)); \
|
|
Packit Service |
e58aae |
FUNC (NUM (x, 8)); \
|
|
Packit Service |
e58aae |
FUNC (NUM (x, 9))
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
#define FUNC100(x) \
|
|
Packit Service |
e58aae |
FUNC10 (NUM (x, 0)); \
|
|
Packit Service |
e58aae |
FUNC10 (NUM (x, 1)); \
|
|
Packit Service |
e58aae |
FUNC10 (NUM (x, 2)); \
|
|
Packit Service |
e58aae |
FUNC10 (NUM (x, 3)); \
|
|
Packit Service |
e58aae |
FUNC10 (NUM (x, 4)); \
|
|
Packit Service |
e58aae |
FUNC10 (NUM (x, 5)); \
|
|
Packit Service |
e58aae |
FUNC10 (NUM (x, 6)); \
|
|
Packit Service |
e58aae |
FUNC10 (NUM (x, 7)); \
|
|
Packit Service |
e58aae |
FUNC10 (NUM (x, 8)); \
|
|
Packit Service |
e58aae |
FUNC10 (NUM (x, 9))
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
#define FUNC1000(x) \
|
|
Packit Service |
e58aae |
FUNC100 (NUM (x, 0)); \
|
|
Packit Service |
e58aae |
FUNC100 (NUM (x, 1)); \
|
|
Packit Service |
e58aae |
FUNC100 (NUM (x, 2)); \
|
|
Packit Service |
e58aae |
FUNC100 (NUM (x, 3)); \
|
|
Packit Service |
e58aae |
FUNC100 (NUM (x, 4)); \
|
|
Packit Service |
e58aae |
FUNC100 (NUM (x, 5)); \
|
|
Packit Service |
e58aae |
FUNC100 (NUM (x, 6)); \
|
|
Packit Service |
e58aae |
FUNC100 (NUM (x, 7)); \
|
|
Packit Service |
e58aae |
FUNC100 (NUM (x, 8)); \
|
|
Packit Service |
e58aae |
FUNC100 (NUM (x, 9))
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
#define FUNC7000() \
|
|
Packit Service |
e58aae |
FUNC1000 (1); \
|
|
Packit Service |
e58aae |
FUNC1000 (2); \
|
|
Packit Service |
e58aae |
FUNC1000 (3); \
|
|
Packit Service |
e58aae |
FUNC1000 (4); \
|
|
Packit Service |
e58aae |
FUNC1000 (5); \
|
|
Packit Service |
e58aae |
FUNC1000 (6); \
|
|
Packit Service |
e58aae |
FUNC1000 (7);
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
#ifdef FUNC
|
|
Packit Service |
e58aae |
# undef FUNC
|
|
Packit Service |
e58aae |
#endif
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
#ifdef externnum
|
|
Packit Service |
e58aae |
# define FUNC(x) extern int CONCAT (retNum, x) (void)
|
|
Packit Service |
e58aae |
#endif
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
#ifdef definenum
|
|
Packit Service |
e58aae |
# define FUNC(x) int CONCAT (retNum, x) (void) { return x; }
|
|
Packit Service |
e58aae |
#endif
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
#ifdef callnum
|
|
Packit Service |
e58aae |
# define FUNC(x) CONCAT (retNum, x) (); sync_all (x)
|
|
Packit Service |
e58aae |
#endif
|
|
Packit Service |
e58aae |
|
|
Packit Service |
e58aae |
/* A value of 7000 functions is chosen as an arbitrarily large
|
|
Packit Service |
e58aae |
number of functions that will allow us enough attempts to
|
|
Packit Service |
e58aae |
verify lazy resolution operation. */
|
|
Packit Service |
e58aae |
FUNC7000 ();
|