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

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