Blame elf/tst-dlopen-nodelete-reloc-mod8.c

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