xref: /netbsd-src/external/gpl3/gcc.old/dist/libssp/ssp-local.c (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
136ac495dSmrg /* Stack protector support.
2*8feb0f0bSmrg    Copyright (C) 2005-2020 Free Software Foundation, Inc.
336ac495dSmrg 
436ac495dSmrg This file is part of GCC.
536ac495dSmrg 
636ac495dSmrg GCC is free software; you can redistribute it and/or modify it under
736ac495dSmrg the terms of the GNU General Public License as published by the Free
836ac495dSmrg Software Foundation; either version 3, or (at your option) any later
936ac495dSmrg version.
1036ac495dSmrg 
1136ac495dSmrg In addition to the permissions in the GNU General Public License, the
1236ac495dSmrg Free Software Foundation gives you unlimited permission to link the
1336ac495dSmrg compiled version of this file into combinations with other programs,
1436ac495dSmrg and to distribute those combinations without any restriction coming
1536ac495dSmrg from the use of this file.  (The General Public License restrictions
1636ac495dSmrg do apply in other respects; for example, they cover modification of
1736ac495dSmrg the file, and distribution when not linked into a combine
1836ac495dSmrg executable.)
1936ac495dSmrg 
2036ac495dSmrg GCC is distributed in the hope that it will be useful, but WITHOUT ANY
2136ac495dSmrg WARRANTY; without even the implied warranty of MERCHANTABILITY or
2236ac495dSmrg FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
2336ac495dSmrg for more details.
2436ac495dSmrg 
2536ac495dSmrg Under Section 7 of GPL version 3, you are granted additional
2636ac495dSmrg permissions described in the GCC Runtime Library Exception, version
2736ac495dSmrg 3.1, as published by the Free Software Foundation.
2836ac495dSmrg 
2936ac495dSmrg You should have received a copy of the GNU General Public License and
3036ac495dSmrg a copy of the GCC Runtime Library Exception along with this program;
3136ac495dSmrg see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
3236ac495dSmrg <http://www.gnu.org/licenses/>.  */
3336ac495dSmrg 
3436ac495dSmrg 
3536ac495dSmrg #include "config.h"
3636ac495dSmrg 
3736ac495dSmrg extern void __stack_chk_fail (void);
3836ac495dSmrg 
3936ac495dSmrg /* Some targets can avoid loading a GP for calls to hidden functions.
4036ac495dSmrg    Using this entry point may avoid the load of a GP entirely for the
4136ac495dSmrg    function, making the overall code smaller.  */
4236ac495dSmrg 
4336ac495dSmrg #ifdef HAVE_HIDDEN_VISIBILITY
4436ac495dSmrg void
4536ac495dSmrg __attribute__((visibility ("hidden")))
__stack_chk_fail_local(void)4636ac495dSmrg __stack_chk_fail_local (void)
4736ac495dSmrg {
4836ac495dSmrg   __stack_chk_fail ();
4936ac495dSmrg }
5036ac495dSmrg #endif
51