]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/dlmopen.c
1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2021 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 volatile int wait_for_gdb
= 1;
36 handle
[0] = dlmopen (LM_ID_NEWLM
, DSO1_NAME
, RTLD_LAZY
| RTLD_LOCAL
);
37 assert (handle
[0] != NULL
);
39 dlinfo (handle
[0], RTLD_DI_LMID
, &lmid
);
41 handle
[1] = dlopen (DSO1_NAME
, RTLD_LAZY
| RTLD_LOCAL
);
42 assert (handle
[1] != NULL
);
44 handle
[2] = dlmopen (LM_ID_NEWLM
, DSO1_NAME
, RTLD_LAZY
| RTLD_LOCAL
);
45 assert (handle
[2] != NULL
);
47 handle
[3] = dlmopen (lmid
, DSO2_NAME
, RTLD_LAZY
| RTLD_LOCAL
);
48 assert (handle
[3] != NULL
);
51 while (wait_for_gdb
!= 0)
54 for (dl
= 0; dl
< 4; ++dl
)
56 fun
= dlsym (handle
[dl
], "inc");
64 return 0; /* bp.main */