RISC-V: Update nofpu ULPs
[glibc.git] / elf / tst-dlopen-aout.c
blobdeedd11ad08e9a11012679f414e41bbd331926dc
1 /* Test case for BZ #16634.
3 Verify that incorrectly dlopen()ing an executable without
4 __RTLD_OPENEXEC does not cause assertion in ld.so.
6 Copyright (C) 2014-2019 Free Software Foundation, Inc.
7 This file is part of the GNU C Library.
9 The GNU C Library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
14 The GNU C Library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with the GNU C Library; if not, see
21 <http://www.gnu.org/licenses/>.
23 Note: this test currently only fails when glibc is configured with
24 --enable-hardcoded-path-in-tests. */
26 #include <assert.h>
27 #include <dlfcn.h>
28 #include <stdio.h>
29 #include <pthread.h>
30 #include <support/xthread.h>
32 __thread int x;
34 void *
35 fn (void *p)
37 return p;
40 static int
41 do_test (int argc, char *argv[])
43 int j;
45 for (j = 0; j < 100; ++j)
47 pthread_t thr;
48 void *p;
50 p = dlopen (argv[0], RTLD_LAZY);
51 if (p != NULL)
53 fprintf (stderr, "dlopen unexpectedly succeeded\n");
54 return 1;
56 /* We create threads to force TLS allocation, which triggers
57 the original bug i.e. running out of surplus slotinfo entries
58 for TLS. */
59 thr = xpthread_create (NULL, fn, NULL);
60 xpthread_join (thr);
63 return 0;
66 #define TEST_FUNCTION_ARGV do_test
67 #include <support/test-driver.c>