]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/sys/linker_set.h
xnu-4570.31.3.tar.gz
[apple/xnu.git] / bsd / sys / linker_set.h
index 1aea008487a9be3cc5963709dc1a9e97434053cf..8fd29dbb9fc9874c8ccc952a2ea50919fea10cfc 100644 (file)
  *
  *  void const * __set_SET_sym_SYM __attribute__((section("__DATA,SET"))) = & SYM
  */
+
+/* Wrap entries in a type that can be blacklisted from KASAN */
+struct linker_set_entry {
+       void *ptr;
+} __attribute__((packed));
+
 #ifdef __LS_VA_STRINGIFY__
 #  undef __LS_VA_STRINGIFY__
 #endif
 #define __LS_VA_STRINGIFY(_x...)       #_x
 #define __LS_VA_STRCONCAT(_x,_y)       __LS_VA_STRINGIFY(_x,_y)
 #define __LINKER_MAKE_SET(_set, _sym)                                  \
-       /*__unused*/ /*static*/ void const * /*const*/ __set_##_set##_sym_##_sym                \
-       __attribute__ ((section(__LS_VA_STRCONCAT(__DATA,_set)),used)) = (void *)&_sym
+       /*__unused*/ /*static*/ const struct linker_set_entry /*const*/ __set_##_set##_sym_##_sym               \
+       __attribute__ ((section(__LS_VA_STRCONCAT(__DATA,_set)),used)) = { (void *)&_sym }
 /* the line above is very fragile - if your compiler breaks linker sets,
    just play around with "static", "const", "used" etc. :-) */