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

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