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

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