hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame elf/tst-dlopen-nodelete-reloc.h

Packit 1d0f99
/* Template to produce unique symbols.
Packit 1d0f99
   Copyright (C) 2019 Free Software Foundation, Inc.
Packit 1d0f99
   This file is part of the GNU C Library.
Packit 1d0f99
Packit 1d0f99
   The GNU C Library is free software; you can redistribute it and/or
Packit 1d0f99
   modify it under the terms of the GNU Lesser General Public
Packit 1d0f99
   License as published by the Free Software Foundation; either
Packit 1d0f99
   version 2.1 of the License, or (at your option) any later version.
Packit 1d0f99
Packit 1d0f99
   The GNU C Library is distributed in the hope that it will be useful,
Packit 1d0f99
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 1d0f99
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 1d0f99
   Lesser General Public License for more details.
Packit 1d0f99
Packit 1d0f99
   You should have received a copy of the GNU Lesser General Public
Packit 1d0f99
   License along with the GNU C Library; if not, see
Packit 1d0f99
   <https://www.gnu.org/licenses/>.  */
Packit 1d0f99
Packit 1d0f99
/* This template produces a unique symbol definition for an explicit
Packit 1d0f99
   template instantiation (without also incorporating a reference),
Packit 1d0f99
   and an extern template declaration can be used to reference that
Packit 1d0f99
   symbol from another object.  The modid parameter is just a
Packit 1d0f99
   placeholder to create different symbols (because it affects the
Packit 1d0f99
   name mangling of the static value member).  By convention, it
Packit 1d0f99
   should match the number of the module that contains the
Packit 1d0f99
   definition.  */
Packit 1d0f99
Packit 1d0f99
template <int modid>
Packit 1d0f99
struct unique_symbol
Packit 1d0f99
{
Packit 1d0f99
  static int value;
Packit 1d0f99
};
Packit 1d0f99
Packit 1d0f99
template <int modid>
Packit 1d0f99
int unique_symbol<modid>::value;