|
Packit Service |
f35cab |
/* Second module defining a unique symbol (loaded indirectly).
|
|
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 "tst-dlopen-nodelete-reloc.h"
|
|
Packit Service |
f35cab |
|
|
Packit Service |
f35cab |
#include <stdbool.h>
|
|
Packit Service |
f35cab |
#include <stdio.h>
|
|
Packit Service |
f35cab |
#include <unistd.h>
|
|
Packit Service |
f35cab |
|
|
Packit Service |
f35cab |
/* Just a flag here, not used for NODELETE processing. */
|
|
Packit Service |
f35cab |
bool may_finalize_mod11 = false;
|
|
Packit Service |
f35cab |
|
|
Packit Service |
f35cab |
/* Trigger the creation of a unique symbol reference. This should
|
|
Packit Service |
f35cab |
cause tst-dlopen-nodelete-reloc-mod9.so to be marked as
|
|
Packit Service |
f35cab |
NODELETE. */
|
|
Packit Service |
f35cab |
|
|
Packit Service |
f35cab |
extern template struct unique_symbol<9>;
|
|
Packit Service |
f35cab |
|
|
Packit Service |
f35cab |
int
|
|
Packit Service |
f35cab |
global_function_mod11 (void)
|
|
Packit Service |
f35cab |
{
|
|
Packit Service |
f35cab |
return unique_symbol<9>::value;
|
|
Packit Service |
f35cab |
}
|
|
Packit Service |
f35cab |
|
|
Packit Service |
f35cab |
static void __attribute__ ((destructor))
|
|
Packit Service |
f35cab |
fini (void)
|
|
Packit Service |
f35cab |
{
|
|
Packit Service |
f35cab |
if (!may_finalize_mod11)
|
|
Packit Service |
f35cab |
{
|
|
Packit Service |
f35cab |
puts ("error: tst-dlopen-nodelete-reloc-mod11.so destructor"
|
|
Packit Service |
f35cab |
" called too early");
|
|
Packit Service |
f35cab |
_exit (1);
|
|
Packit Service |
f35cab |
}
|
|
Packit Service |
f35cab |
}
|