Blame elf/tst-dlopen-nodelete-reloc-mod1.c
|
Packit Service |
f6fae4 |
/* Test propagation of NODELETE to an already-loaded object via relocation.
|
|
Packit Service |
f6fae4 |
Non-NODELETE helper module.
|
|
Packit Service |
f6fae4 |
Copyright (C) 2019 Free Software Foundation, Inc.
|
|
Packit Service |
f6fae4 |
This file is part of the GNU C Library.
|
|
Packit Service |
f6fae4 |
|
|
Packit Service |
f6fae4 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
f6fae4 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
f6fae4 |
License as published by the Free Software Foundation; either
|
|
Packit Service |
f6fae4 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
f6fae4 |
|
|
Packit Service |
f6fae4 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
f6fae4 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
f6fae4 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
f6fae4 |
Lesser General Public License for more details.
|
|
Packit Service |
f6fae4 |
|
|
Packit Service |
f6fae4 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
f6fae4 |
License along with the GNU C Library; if not, see
|
|
Packit Service |
f6fae4 |
<https://www.gnu.org/licenses/>. */
|
|
Packit Service |
f6fae4 |
|
|
Packit Service |
f6fae4 |
#include <stdbool.h>
|
|
Packit Service |
f6fae4 |
#include <stdio.h>
|
|
Packit Service |
f6fae4 |
#include <unistd.h>
|
|
Packit Service |
f6fae4 |
|
|
Packit Service |
f6fae4 |
/* Globally exported. Set by the main program to true before
|
|
Packit Service |
f6fae4 |
termination, and used by tst-dlopen-nodelete-reloc-mod2.so to
|
|
Packit Service |
f6fae4 |
trigger marking this module as NODELETE (and also for its destructor
|
|
Packit Service |
f6fae4 |
check). */
|
|
Packit Service |
f6fae4 |
bool may_finalize_mod1 = false;
|
|
Packit Service |
f6fae4 |
|
|
Packit Service |
f6fae4 |
static void __attribute__ ((destructor))
|
|
Packit Service |
f6fae4 |
fini (void)
|
|
Packit Service |
f6fae4 |
{
|
|
Packit Service |
f6fae4 |
if (!may_finalize_mod1)
|
|
Packit Service |
f6fae4 |
{
|
|
Packit Service |
f6fae4 |
puts ("error: tst-dlopen-nodelete-reloc-mod1.so destructor"
|
|
Packit Service |
f6fae4 |
" called too early");
|
|
Packit Service |
f6fae4 |
_exit (1);
|
|
Packit Service |
f6fae4 |
}
|
|
Packit Service |
f6fae4 |
}
|