Blame sysdeps/x86/tst-cet-legacy-mod-6c.c

Packit dd1437
/* Check compatibility of CET-enabled executable with dlopened legacy
Packit dd1437
   shared object.
Packit dd1437
   Copyright (C) 2019 Free Software Foundation, Inc.
Packit dd1437
   This file is part of the GNU C Library.
Packit dd1437
Packit dd1437
   The GNU C Library is free software; you can redistribute it and/or
Packit dd1437
   modify it under the terms of the GNU Lesser General Public
Packit dd1437
   License as published by the Free Software Foundation; either
Packit dd1437
   version 2.1 of the License, or (at your option) any later version.
Packit dd1437
Packit dd1437
   The GNU C Library is distributed in the hope that it will be useful,
Packit dd1437
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit dd1437
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit dd1437
   Lesser General Public License for more details.
Packit dd1437
Packit dd1437
   You should have received a copy of the GNU Lesser General Public
Packit dd1437
   License along with the GNU C Library; if not, see
Packit dd1437
   <http://www.gnu.org/licenses/>.  */
Packit dd1437
Packit dd1437
#include <stdlib.h>
Packit dd1437
Packit dd1437
static int called = 0;
Packit dd1437
Packit dd1437
static void
Packit dd1437
__attribute__ ((constructor))
Packit dd1437
init (void)
Packit dd1437
{
Packit dd1437
  called = 1;
Packit dd1437
}
Packit dd1437
Packit dd1437
void
Packit dd1437
foo (void)
Packit dd1437
{
Packit dd1437
  if (!called)
Packit dd1437
    abort ();
Packit dd1437
}