blob: 8b3a076600fbd7014552556f98ce32f2192a2590 [file] [log] [blame]
Pierre-Clément Tosi6a42fdc2022-12-08 13:51:05 +00001// Copyright 2022, The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Low-level compatibility layer between baremetal Rust and Bionic C functions.
16
17use crate::linker;
18
19/// Reference to __stack_chk_guard.
20pub static STACK_CHK_GUARD: &u64 = unsafe { &linker::__stack_chk_guard };
21
22#[no_mangle]
23extern "C" fn __stack_chk_fail() -> ! {
24 panic!("stack guard check failed");
25}