46 lines · c
1//===-- sanitizer_fuchsia.h ------------------------------------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===---------------------------------------------------------------------===//8//9// Fuchsia-specific sanitizer support.10//11//===---------------------------------------------------------------------===//12#ifndef SANITIZER_FUCHSIA_H13#define SANITIZER_FUCHSIA_H14 15#include "sanitizer_platform.h"16#if SANITIZER_FUCHSIA17 18#include "sanitizer_common.h"19 20#include <zircon/sanitizer.h>21#include <zircon/syscalls/object.h>22 23namespace __sanitizer {24 25extern uptr MainThreadStackBase, MainThreadStackSize;26extern sanitizer_shadow_bounds_t ShadowBounds;27 28struct MemoryMappingLayoutData {29 InternalMmapVector<zx_info_maps_t> data;30 size_t current; // Current index into the vector.31};32 33void InitShadowBounds();34 35// Individual sanitizers can define this to explicitly run something at the end36// of `__sanitizer_startup_hook`. This can be useful if a sanitizer needs to do37// extra work after the common startup hook code is called and before module38// ctors are invoked. For example, hwasan can explicitly call its initializing39// function here so it can be set up before libc extensions are initialized.40void EarlySanitizerInit();41 42} // namespace __sanitizer43 44#endif // SANITIZER_FUCHSIA45#endif // SANITIZER_FUCHSIA_H46