Home | History | Annotate | Line # | Download | only in libssp
      1   1.1  mrg /* Stack protector support.
      2  1.11  mrg    Copyright (C) 2005-2022 Free Software Foundation, Inc.
      3   1.1  mrg 
      4   1.1  mrg This file is part of GCC.
      5   1.1  mrg 
      6   1.1  mrg GCC is free software; you can redistribute it and/or modify it under
      7   1.1  mrg the terms of the GNU General Public License as published by the Free
      8   1.1  mrg Software Foundation; either version 3, or (at your option) any later
      9   1.1  mrg version.
     10   1.1  mrg 
     11   1.1  mrg In addition to the permissions in the GNU General Public License, the
     12   1.1  mrg Free Software Foundation gives you unlimited permission to link the
     13   1.1  mrg compiled version of this file into combinations with other programs,
     14   1.1  mrg and to distribute those combinations without any restriction coming
     15   1.1  mrg from the use of this file.  (The General Public License restrictions
     16   1.1  mrg do apply in other respects; for example, they cover modification of
     17   1.1  mrg the file, and distribution when not linked into a combine
     18   1.1  mrg executable.)
     19   1.1  mrg 
     20   1.1  mrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
     21   1.1  mrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
     22   1.1  mrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     23   1.1  mrg for more details.
     24   1.1  mrg 
     25   1.1  mrg Under Section 7 of GPL version 3, you are granted additional
     26   1.1  mrg permissions described in the GCC Runtime Library Exception, version
     27   1.1  mrg 3.1, as published by the Free Software Foundation.
     28   1.1  mrg 
     29   1.1  mrg You should have received a copy of the GNU General Public License and
     30   1.1  mrg a copy of the GCC Runtime Library Exception along with this program;
     31   1.1  mrg see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
     32   1.1  mrg <http://www.gnu.org/licenses/>.  */
     33   1.1  mrg 
     34   1.1  mrg 
     35   1.1  mrg #include "config.h"
     36   1.1  mrg 
     37   1.1  mrg extern void __stack_chk_fail (void);
     38   1.1  mrg 
     39   1.1  mrg /* Some targets can avoid loading a GP for calls to hidden functions.
     40   1.1  mrg    Using this entry point may avoid the load of a GP entirely for the
     41   1.1  mrg    function, making the overall code smaller.  */
     42   1.1  mrg 
     43   1.1  mrg #ifdef HAVE_HIDDEN_VISIBILITY
     44   1.1  mrg void
     45   1.1  mrg __attribute__((visibility ("hidden")))
     46   1.1  mrg __stack_chk_fail_local (void)
     47   1.1  mrg {
     48   1.1  mrg   __stack_chk_fail ();
     49   1.1  mrg }
     50   1.1  mrg #endif
     51