1*810390e3Srobert //===-- sanitizer_solaris.h -------------------------------------*- C++ -*-===// 2*810390e3Srobert // 3*810390e3Srobert // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*810390e3Srobert // See https://llvm.org/LICENSE.txt for license information. 5*810390e3Srobert // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*810390e3Srobert // 7*810390e3Srobert //===----------------------------------------------------------------------===// 8*810390e3Srobert // 9*810390e3Srobert // This file is a part of Sanitizer runtime. It contains Solaris-specific 10*810390e3Srobert // definitions. 11*810390e3Srobert // 12*810390e3Srobert //===----------------------------------------------------------------------===// 13*810390e3Srobert 14*810390e3Srobert #ifndef SANITIZER_SOLARIS_H 15*810390e3Srobert #define SANITIZER_SOLARIS_H 16*810390e3Srobert 17*810390e3Srobert #include "sanitizer_internal_defs.h" 18*810390e3Srobert 19*810390e3Srobert #if SANITIZER_SOLARIS 20*810390e3Srobert 21*810390e3Srobert #include <link.h> 22*810390e3Srobert 23*810390e3Srobert namespace __sanitizer { 24*810390e3Srobert 25*810390e3Srobert // Beginning of declaration from OpenSolaris/Illumos 26*810390e3Srobert // $SRC/cmd/sgs/include/rtld.h. 27*810390e3Srobert struct Rt_map { 28*810390e3Srobert Link_map rt_public; 29*810390e3Srobert const char *rt_pathname; 30*810390e3Srobert ulong_t rt_padstart; 31*810390e3Srobert ulong_t rt_padimlen; 32*810390e3Srobert ulong_t rt_msize; 33*810390e3Srobert uint_t rt_flags; 34*810390e3Srobert uint_t rt_flags1; 35*810390e3Srobert ulong_t rt_tlsmodid; 36*810390e3Srobert }; 37*810390e3Srobert 38*810390e3Srobert // Structure matching the Solaris 11.4 struct dl_phdr_info used to determine 39*810390e3Srobert // presence of dlpi_tls_modid field at runtime. Cf. Solaris 11.4 40*810390e3Srobert // dl_iterate_phdr(3C), Example 2. 41*810390e3Srobert struct dl_phdr_info_test { 42*810390e3Srobert ElfW(Addr) dlpi_addr; 43*810390e3Srobert const char *dlpi_name; 44*810390e3Srobert const ElfW(Phdr) * dlpi_phdr; 45*810390e3Srobert ElfW(Half) dlpi_phnum; 46*810390e3Srobert u_longlong_t dlpi_adds; 47*810390e3Srobert u_longlong_t dlpi_subs; 48*810390e3Srobert size_t dlpi_tls_modid; 49*810390e3Srobert void *dlpi_tls_data; 50*810390e3Srobert }; 51*810390e3Srobert 52*810390e3Srobert } // namespace __sanitizer 53*810390e3Srobert 54*810390e3Srobert #endif // SANITIZER_SOLARIS 55*810390e3Srobert 56*810390e3Srobert #endif // SANITIZER_SOLARIS_H 57