sanitizer_solaris.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //===-- sanitizer_solaris.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-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file is a part of Sanitizer runtime. It contains Solaris-specific
  10. // definitions.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef SANITIZER_SOLARIS_H
  14. #define SANITIZER_SOLARIS_H
  15. #include "sanitizer_internal_defs.h"
  16. #if SANITIZER_SOLARIS
  17. #include <link.h>
  18. namespace __sanitizer {
  19. // Beginning of declaration from OpenSolaris/Illumos
  20. // $SRC/cmd/sgs/include/rtld.h.
  21. struct Rt_map {
  22. Link_map rt_public;
  23. const char *rt_pathname;
  24. ulong_t rt_padstart;
  25. ulong_t rt_padimlen;
  26. ulong_t rt_msize;
  27. uint_t rt_flags;
  28. uint_t rt_flags1;
  29. ulong_t rt_tlsmodid;
  30. };
  31. // Structure matching the Solaris 11.4 struct dl_phdr_info used to determine
  32. // presence of dlpi_tls_modid field at runtime. Cf. Solaris 11.4
  33. // dl_iterate_phdr(3C), Example 2.
  34. struct dl_phdr_info_test {
  35. ElfW(Addr) dlpi_addr;
  36. const char *dlpi_name;
  37. const ElfW(Phdr) * dlpi_phdr;
  38. ElfW(Half) dlpi_phnum;
  39. u_longlong_t dlpi_adds;
  40. u_longlong_t dlpi_subs;
  41. size_t dlpi_tls_modid;
  42. void *dlpi_tls_data;
  43. };
  44. } // namespace __sanitizer
  45. #endif // SANITIZER_SOLARIS
  46. #endif // SANITIZER_SOLARIS_H