Blame elf/tst-dlopen-nodelete-reloc-mod8.c
|
Packit |
1d0f99 |
/* Helper module to load tst-dlopen-nodelete-reloc-mod9.so.
|
|
Packit |
1d0f99 |
Copyright (C) 2019 Free Software Foundation, Inc.
|
|
Packit |
1d0f99 |
This file is part of the GNU C Library.
|
|
Packit |
1d0f99 |
|
|
Packit |
1d0f99 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
1d0f99 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
1d0f99 |
License as published by the Free Software Foundation; either
|
|
Packit |
1d0f99 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
1d0f99 |
|
|
Packit |
1d0f99 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
1d0f99 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
1d0f99 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
1d0f99 |
Lesser General Public License for more details.
|
|
Packit |
1d0f99 |
|
|
Packit |
1d0f99 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
1d0f99 |
License along with the GNU C Library; if not, see
|
|
Packit |
1d0f99 |
<https://www.gnu.org/licenses/>. */
|
|
Packit |
1d0f99 |
|
|
Packit |
1d0f99 |
#include <dlfcn.h>
|
|
Packit |
1d0f99 |
#include <stddef.h>
|
|
Packit |
1d0f99 |
#include <stdio.h>
|
|
Packit |
1d0f99 |
#include <unistd.h>
|
|
Packit |
1d0f99 |
|
|
Packit |
1d0f99 |
static void *handle;
|
|
Packit |
1d0f99 |
|
|
Packit |
1d0f99 |
static void __attribute__ ((constructor))
|
|
Packit |
1d0f99 |
init (void)
|
|
Packit |
1d0f99 |
{
|
|
Packit |
1d0f99 |
handle = dlopen ("tst-dlopen-nodelete-reloc-mod9.so", RTLD_NOW);
|
|
Packit |
1d0f99 |
if (handle == NULL)
|
|
Packit |
1d0f99 |
{
|
|
Packit |
1d0f99 |
printf ("error: dlopen in module 8: %s\n", dlerror ());
|
|
Packit |
1d0f99 |
_exit (1);
|
|
Packit |
1d0f99 |
}
|
|
Packit |
1d0f99 |
}
|
|
Packit |
1d0f99 |
|
|
Packit |
1d0f99 |
static void __attribute__ ((destructor))
|
|
Packit |
1d0f99 |
fini (void)
|
|
Packit |
1d0f99 |
{
|
|
Packit |
1d0f99 |
dlclose (handle);
|
|
Packit |
1d0f99 |
}
|