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