Blame elf/tst-dlopen-nodelete-reloc-mod9.cc

Packit Service ce3af4
/* First module defining a unique symbol (loaded indirectly).
Packit Service ce3af4
   Copyright (C) 2019 Free Software Foundation, Inc.
Packit Service ce3af4
   This file is part of the GNU C Library.
Packit Service ce3af4
Packit Service ce3af4
   The GNU C Library is free software; you can redistribute it and/or
Packit Service ce3af4
   modify it under the terms of the GNU Lesser General Public
Packit Service ce3af4
   License as published by the Free Software Foundation; either
Packit Service ce3af4
   version 2.1 of the License, or (at your option) any later version.
Packit Service ce3af4
Packit Service ce3af4
   The GNU C Library is distributed in the hope that it will be useful,
Packit Service ce3af4
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service ce3af4
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service ce3af4
   Lesser General Public License for more details.
Packit Service ce3af4
Packit Service ce3af4
   You should have received a copy of the GNU Lesser General Public
Packit Service ce3af4
   License along with the GNU C Library; if not, see
Packit Service ce3af4
   <https://www.gnu.org/licenses/>.  */
Packit Service ce3af4
Packit Service ce3af4
#include "tst-dlopen-nodelete-reloc.h"
Packit Service ce3af4
Packit Service ce3af4
#include <stdbool.h>
Packit Service ce3af4
#include <stdio.h>
Packit Service ce3af4
#include <unistd.h>
Packit Service ce3af4
Packit Service ce3af4
/* Just a flag here, not used for NODELETE processing.  */
Packit Service ce3af4
bool may_finalize_mod9 = false;
Packit Service ce3af4
Packit Service ce3af4
/* Explicit instantiation.  This produces a unique symbol definition
Packit Service ce3af4
   which is not referenced by the library itself, so the library is
Packit Service ce3af4
   not marked NODELETE.  */
Packit Service ce3af4
template struct unique_symbol<9>;
Packit Service ce3af4
Packit Service ce3af4
static void __attribute__ ((destructor))
Packit Service ce3af4
fini (void)
Packit Service ce3af4
{
Packit Service ce3af4
  if (!may_finalize_mod9)
Packit Service ce3af4
    {
Packit Service ce3af4
      puts ("error: tst-dlopen-nodelete-reloc-mod9.so destructor"
Packit Service ce3af4
            " called too early");
Packit Service ce3af4
      _exit (1);
Packit Service ce3af4
    }
Packit Service ce3af4
}