sanitizer.def 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. /* This file contains the definitions and documentation for the
  2. Address Sanitizer and Thread Sanitizer builtins used in the GNU compiler.
  3. Copyright (C) 2012-2015 Free Software Foundation, Inc.
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify it under
  6. the terms of the GNU General Public License as published by the Free
  7. Software Foundation; either version 3, or (at your option) any later
  8. version.
  9. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with GCC; see the file COPYING3. If not see
  15. <http://www.gnu.org/licenses/>. */
  16. /* Before including this file, you should define a macro:
  17. DEF_SANITIZER_BUILTIN (ENUM, NAME, TYPE, ATTRS)
  18. See builtins.def for details.
  19. The builtins are created by the C-family of FEs in c-family/c-common.c,
  20. for other FEs by asan.c. */
  21. /* Address Sanitizer */
  22. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_INIT, "__asan_init_v4",
  23. BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
  24. /* Do not reorder the BUILT_IN_ASAN_{REPORT,CHECK}* builtins, e.g. cfgcleanup.c
  25. relies on this order. */
  26. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD1, "__asan_report_load1",
  27. BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  28. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD2, "__asan_report_load2",
  29. BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  30. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD4, "__asan_report_load4",
  31. BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  32. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD8, "__asan_report_load8",
  33. BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  34. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD16, "__asan_report_load16",
  35. BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  36. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD_N, "__asan_report_load_n",
  37. BT_FN_VOID_PTR_PTRMODE,
  38. ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  39. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE1, "__asan_report_store1",
  40. BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  41. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE2, "__asan_report_store2",
  42. BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  43. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE4, "__asan_report_store4",
  44. BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  45. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE8, "__asan_report_store8",
  46. BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  47. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE16, "__asan_report_store16",
  48. BT_FN_VOID_PTR, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  49. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE_N, "__asan_report_store_n",
  50. BT_FN_VOID_PTR_PTRMODE,
  51. ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
  52. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD1_NOABORT,
  53. "__asan_report_load1_noabort",
  54. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  55. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD2_NOABORT,
  56. "__asan_report_load2_noabort",
  57. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  58. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD4_NOABORT,
  59. "__asan_report_load4_noabort",
  60. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  61. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD8_NOABORT,
  62. "__asan_report_load8_noabort",
  63. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  64. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD16_NOABORT,
  65. "__asan_report_load16_noabort",
  66. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  67. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_LOAD_N_NOABORT,
  68. "__asan_report_load_n_noabort",
  69. BT_FN_VOID_PTR_PTRMODE,
  70. ATTR_TMPURE_NOTHROW_LEAF_LIST)
  71. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE1_NOABORT,
  72. "__asan_report_store1_noabort",
  73. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  74. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE2_NOABORT,
  75. "__asan_report_store2_noabort",
  76. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  77. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE4_NOABORT,
  78. "__asan_report_store4_noabort",
  79. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  80. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE8_NOABORT,
  81. "__asan_report_store8_noabort",
  82. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  83. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE16_NOABORT,
  84. "__asan_report_store16_noabort",
  85. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  86. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REPORT_STORE_N_NOABORT,
  87. "__asan_report_store_n_noabort",
  88. BT_FN_VOID_PTR_PTRMODE,
  89. ATTR_TMPURE_NOTHROW_LEAF_LIST)
  90. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD1, "__asan_load1",
  91. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  92. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD2, "__asan_load2",
  93. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  94. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD4, "__asan_load4",
  95. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  96. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD8, "__asan_load8",
  97. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  98. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD16, "__asan_load16",
  99. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  100. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOADN, "__asan_loadN",
  101. BT_FN_VOID_PTR_PTRMODE, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  102. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE1, "__asan_store1",
  103. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  104. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE2, "__asan_store2",
  105. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  106. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE4, "__asan_store4",
  107. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  108. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE8, "__asan_store8",
  109. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  110. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE16, "__asan_store16",
  111. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  112. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STOREN, "__asan_storeN",
  113. BT_FN_VOID_PTR_PTRMODE, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  114. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD1_NOABORT, "__asan_load1_noabort",
  115. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  116. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD2_NOABORT, "__asan_load2_noabort",
  117. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  118. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD4_NOABORT, "__asan_load4_noabort",
  119. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  120. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD8_NOABORT, "__asan_load8_noabort",
  121. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  122. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOAD16_NOABORT, "__asan_load16_noabort",
  123. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  124. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_LOADN_NOABORT, "__asan_loadN_noabort",
  125. BT_FN_VOID_PTR_PTRMODE, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  126. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE1_NOABORT, "__asan_store1_noabort",
  127. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  128. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE2_NOABORT, "__asan_store2_noabort",
  129. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  130. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE4_NOABORT, "__asan_store4_noabort",
  131. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  132. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE8_NOABORT, "__asan_store8_noabort",
  133. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  134. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STORE16_NOABORT, "__asan_store16_noabort",
  135. BT_FN_VOID_PTR, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  136. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_STOREN_NOABORT, "__asan_storeN_noabort",
  137. BT_FN_VOID_PTR_PTRMODE, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  138. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_REGISTER_GLOBALS,
  139. "__asan_register_globals",
  140. BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
  141. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_UNREGISTER_GLOBALS,
  142. "__asan_unregister_globals",
  143. BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
  144. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_HANDLE_NO_RETURN,
  145. "__asan_handle_no_return",
  146. BT_FN_VOID, ATTR_TMPURE_NOTHROW_LEAF_LIST)
  147. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT,
  148. "__asan_before_dynamic_init",
  149. BT_FN_VOID_CONST_PTR, ATTR_NOTHROW_LEAF_LIST)
  150. DEF_SANITIZER_BUILTIN(BUILT_IN_ASAN_AFTER_DYNAMIC_INIT,
  151. "__asan_after_dynamic_init",
  152. BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
  153. /* Thread Sanitizer */
  154. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_INIT, "__tsan_init",
  155. BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
  156. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_FUNC_ENTRY, "__tsan_func_entry",
  157. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  158. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_FUNC_EXIT, "__tsan_func_exit",
  159. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  160. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_VPTR_UPDATE, "__tsan_vptr_update",
  161. BT_FN_VOID_PTR_PTR, ATTR_NOTHROW_LEAF_LIST)
  162. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ1, "__tsan_read1",
  163. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  164. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ2, "__tsan_read2",
  165. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  166. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ4, "__tsan_read4",
  167. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  168. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ8, "__tsan_read8",
  169. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  170. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ16, "__tsan_read16",
  171. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  172. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE1, "__tsan_write1",
  173. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  174. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE2, "__tsan_write2",
  175. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  176. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE4, "__tsan_write4",
  177. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  178. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE8, "__tsan_write8",
  179. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  180. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE16, "__tsan_write16",
  181. BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
  182. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_READ_RANGE, "__tsan_read_range",
  183. BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
  184. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_WRITE_RANGE, "__tsan_write_range",
  185. BT_FN_VOID_PTR_PTRMODE, ATTR_NOTHROW_LEAF_LIST)
  186. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_LOAD,
  187. "__tsan_atomic8_load",
  188. BT_FN_I1_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
  189. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_LOAD,
  190. "__tsan_atomic16_load",
  191. BT_FN_I2_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
  192. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_LOAD,
  193. "__tsan_atomic32_load",
  194. BT_FN_I4_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
  195. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_LOAD,
  196. "__tsan_atomic64_load",
  197. BT_FN_I8_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
  198. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_LOAD,
  199. "__tsan_atomic128_load",
  200. BT_FN_I16_CONST_VPTR_INT, ATTR_NOTHROW_LEAF_LIST)
  201. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_STORE,
  202. "__tsan_atomic8_store",
  203. BT_FN_VOID_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
  204. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_STORE,
  205. "__tsan_atomic16_store",
  206. BT_FN_VOID_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
  207. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_STORE,
  208. "__tsan_atomic32_store",
  209. BT_FN_VOID_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
  210. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_STORE,
  211. "__tsan_atomic64_store",
  212. BT_FN_VOID_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
  213. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_STORE,
  214. "__tsan_atomic128_store",
  215. BT_FN_VOID_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
  216. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_EXCHANGE,
  217. "__tsan_atomic8_exchange",
  218. BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
  219. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_EXCHANGE,
  220. "__tsan_atomic16_exchange",
  221. BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
  222. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_EXCHANGE,
  223. "__tsan_atomic32_exchange",
  224. BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
  225. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_EXCHANGE,
  226. "__tsan_atomic64_exchange",
  227. BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
  228. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_EXCHANGE,
  229. "__tsan_atomic128_exchange",
  230. BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
  231. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_ADD,
  232. "__tsan_atomic8_fetch_add",
  233. BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
  234. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_ADD,
  235. "__tsan_atomic16_fetch_add",
  236. BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
  237. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_ADD,
  238. "__tsan_atomic32_fetch_add",
  239. BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
  240. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_ADD,
  241. "__tsan_atomic64_fetch_add",
  242. BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
  243. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_ADD,
  244. "__tsan_atomic128_fetch_add",
  245. BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
  246. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_SUB,
  247. "__tsan_atomic8_fetch_sub",
  248. BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
  249. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_SUB,
  250. "__tsan_atomic16_fetch_sub",
  251. BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
  252. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_SUB,
  253. "__tsan_atomic32_fetch_sub",
  254. BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
  255. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_SUB,
  256. "__tsan_atomic64_fetch_sub",
  257. BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
  258. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_SUB,
  259. "__tsan_atomic128_fetch_sub",
  260. BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
  261. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_AND,
  262. "__tsan_atomic8_fetch_and",
  263. BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
  264. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_AND,
  265. "__tsan_atomic16_fetch_and",
  266. BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
  267. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_AND,
  268. "__tsan_atomic32_fetch_and",
  269. BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
  270. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_AND,
  271. "__tsan_atomic64_fetch_and",
  272. BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
  273. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_AND,
  274. "__tsan_atomic128_fetch_and",
  275. BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
  276. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_OR,
  277. "__tsan_atomic8_fetch_or",
  278. BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
  279. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_OR,
  280. "__tsan_atomic16_fetch_or",
  281. BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
  282. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_OR,
  283. "__tsan_atomic32_fetch_or",
  284. BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
  285. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_OR,
  286. "__tsan_atomic64_fetch_or",
  287. BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
  288. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_OR,
  289. "__tsan_atomic128_fetch_or",
  290. BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
  291. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_XOR,
  292. "__tsan_atomic8_fetch_xor",
  293. BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
  294. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_XOR,
  295. "__tsan_atomic16_fetch_xor",
  296. BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
  297. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_XOR,
  298. "__tsan_atomic32_fetch_xor",
  299. BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
  300. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_XOR,
  301. "__tsan_atomic64_fetch_xor",
  302. BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
  303. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_XOR,
  304. "__tsan_atomic128_fetch_xor",
  305. BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
  306. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_FETCH_NAND,
  307. "__tsan_atomic8_fetch_nand",
  308. BT_FN_I1_VPTR_I1_INT, ATTR_NOTHROW_LEAF_LIST)
  309. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_FETCH_NAND,
  310. "__tsan_atomic16_fetch_nand",
  311. BT_FN_I2_VPTR_I2_INT, ATTR_NOTHROW_LEAF_LIST)
  312. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_FETCH_NAND,
  313. "__tsan_atomic32_fetch_nand",
  314. BT_FN_I4_VPTR_I4_INT, ATTR_NOTHROW_LEAF_LIST)
  315. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_FETCH_NAND,
  316. "__tsan_atomic64_fetch_nand",
  317. BT_FN_I8_VPTR_I8_INT, ATTR_NOTHROW_LEAF_LIST)
  318. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_FETCH_NAND,
  319. "__tsan_atomic128_fetch_nand",
  320. BT_FN_I16_VPTR_I16_INT, ATTR_NOTHROW_LEAF_LIST)
  321. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_COMPARE_EXCHANGE_STRONG,
  322. "__tsan_atomic8_compare_exchange_strong",
  323. BT_FN_BOOL_VPTR_PTR_I1_INT_INT,
  324. ATTR_NOTHROW_LEAF_LIST)
  325. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_COMPARE_EXCHANGE_STRONG,
  326. "__tsan_atomic16_compare_exchange_strong",
  327. BT_FN_BOOL_VPTR_PTR_I2_INT_INT,
  328. ATTR_NOTHROW_LEAF_LIST)
  329. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_COMPARE_EXCHANGE_STRONG,
  330. "__tsan_atomic32_compare_exchange_strong",
  331. BT_FN_BOOL_VPTR_PTR_I4_INT_INT,
  332. ATTR_NOTHROW_LEAF_LIST)
  333. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_COMPARE_EXCHANGE_STRONG,
  334. "__tsan_atomic64_compare_exchange_strong",
  335. BT_FN_BOOL_VPTR_PTR_I8_INT_INT,
  336. ATTR_NOTHROW_LEAF_LIST)
  337. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_COMPARE_EXCHANGE_STRONG,
  338. "__tsan_atomic128_compare_exchange_strong",
  339. BT_FN_BOOL_VPTR_PTR_I16_INT_INT,
  340. ATTR_NOTHROW_LEAF_LIST)
  341. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC8_COMPARE_EXCHANGE_WEAK,
  342. "__tsan_atomic8_compare_exchange_weak",
  343. BT_FN_BOOL_VPTR_PTR_I1_INT_INT,
  344. ATTR_NOTHROW_LEAF_LIST)
  345. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC16_COMPARE_EXCHANGE_WEAK,
  346. "__tsan_atomic16_compare_exchange_weak",
  347. BT_FN_BOOL_VPTR_PTR_I2_INT_INT,
  348. ATTR_NOTHROW_LEAF_LIST)
  349. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC32_COMPARE_EXCHANGE_WEAK,
  350. "__tsan_atomic32_compare_exchange_weak",
  351. BT_FN_BOOL_VPTR_PTR_I4_INT_INT,
  352. ATTR_NOTHROW_LEAF_LIST)
  353. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC64_COMPARE_EXCHANGE_WEAK,
  354. "__tsan_atomic64_compare_exchange_weak",
  355. BT_FN_BOOL_VPTR_PTR_I8_INT_INT,
  356. ATTR_NOTHROW_LEAF_LIST)
  357. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC128_COMPARE_EXCHANGE_WEAK,
  358. "__tsan_atomic128_compare_exchange_weak",
  359. BT_FN_BOOL_VPTR_PTR_I16_INT_INT,
  360. ATTR_NOTHROW_LEAF_LIST)
  361. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC_THREAD_FENCE,
  362. "__tsan_atomic_thread_fence",
  363. BT_FN_VOID_INT, ATTR_NOTHROW_LEAF_LIST)
  364. DEF_SANITIZER_BUILTIN(BUILT_IN_TSAN_ATOMIC_SIGNAL_FENCE,
  365. "__tsan_atomic_signal_fence",
  366. BT_FN_VOID_INT, ATTR_NOTHROW_LEAF_LIST)
  367. /* Undefined Behavior Sanitizer */
  368. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_DIVREM_OVERFLOW,
  369. "__ubsan_handle_divrem_overflow",
  370. BT_FN_VOID_PTR_PTR_PTR,
  371. ATTR_COLD_NOTHROW_LEAF_LIST)
  372. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_SHIFT_OUT_OF_BOUNDS,
  373. "__ubsan_handle_shift_out_of_bounds",
  374. BT_FN_VOID_PTR_PTR_PTR,
  375. ATTR_COLD_NOTHROW_LEAF_LIST)
  376. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_BUILTIN_UNREACHABLE,
  377. "__ubsan_handle_builtin_unreachable",
  378. BT_FN_VOID_PTR,
  379. ATTR_COLD_CONST_NORETURN_NOTHROW_LEAF_LIST)
  380. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_MISSING_RETURN,
  381. "__ubsan_handle_missing_return",
  382. BT_FN_VOID_PTR,
  383. ATTR_NORETURN_NOTHROW_LEAF_LIST)
  384. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_VLA_BOUND_NOT_POSITIVE,
  385. "__ubsan_handle_vla_bound_not_positive",
  386. BT_FN_VOID_PTR_PTR,
  387. ATTR_COLD_NOTHROW_LEAF_LIST)
  388. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
  389. "__ubsan_handle_type_mismatch",
  390. BT_FN_VOID_PTR_PTR,
  391. ATTR_COLD_NOTHROW_LEAF_LIST)
  392. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_ADD_OVERFLOW,
  393. "__ubsan_handle_add_overflow",
  394. BT_FN_VOID_PTR_PTR_PTR,
  395. ATTR_COLD_NOTHROW_LEAF_LIST)
  396. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_SUB_OVERFLOW,
  397. "__ubsan_handle_sub_overflow",
  398. BT_FN_VOID_PTR_PTR_PTR,
  399. ATTR_COLD_NOTHROW_LEAF_LIST)
  400. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_MUL_OVERFLOW,
  401. "__ubsan_handle_mul_overflow",
  402. BT_FN_VOID_PTR_PTR_PTR,
  403. ATTR_COLD_NOTHROW_LEAF_LIST)
  404. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NEGATE_OVERFLOW,
  405. "__ubsan_handle_negate_overflow",
  406. BT_FN_VOID_PTR_PTR,
  407. ATTR_COLD_NOTHROW_LEAF_LIST)
  408. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_LOAD_INVALID_VALUE,
  409. "__ubsan_handle_load_invalid_value",
  410. BT_FN_VOID_PTR_PTR,
  411. ATTR_COLD_NOTHROW_LEAF_LIST)
  412. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_DIVREM_OVERFLOW_ABORT,
  413. "__ubsan_handle_divrem_overflow_abort",
  414. BT_FN_VOID_PTR_PTR_PTR,
  415. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  416. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_SHIFT_OUT_OF_BOUNDS_ABORT,
  417. "__ubsan_handle_shift_out_of_bounds_abort",
  418. BT_FN_VOID_PTR_PTR_PTR,
  419. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  420. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_VLA_BOUND_NOT_POSITIVE_ABORT,
  421. "__ubsan_handle_vla_bound_not_positive_abort",
  422. BT_FN_VOID_PTR_PTR,
  423. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  424. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
  425. "__ubsan_handle_type_mismatch_abort",
  426. BT_FN_VOID_PTR_PTR,
  427. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  428. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_ADD_OVERFLOW_ABORT,
  429. "__ubsan_handle_add_overflow_abort",
  430. BT_FN_VOID_PTR_PTR_PTR,
  431. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  432. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_SUB_OVERFLOW_ABORT,
  433. "__ubsan_handle_sub_overflow_abort",
  434. BT_FN_VOID_PTR_PTR_PTR,
  435. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  436. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_MUL_OVERFLOW_ABORT,
  437. "__ubsan_handle_mul_overflow_abort",
  438. BT_FN_VOID_PTR_PTR_PTR,
  439. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  440. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NEGATE_OVERFLOW_ABORT,
  441. "__ubsan_handle_negate_overflow_abort",
  442. BT_FN_VOID_PTR_PTR,
  443. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  444. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_LOAD_INVALID_VALUE_ABORT,
  445. "__ubsan_handle_load_invalid_value_abort",
  446. BT_FN_VOID_PTR_PTR,
  447. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  448. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_FLOAT_CAST_OVERFLOW,
  449. "__ubsan_handle_float_cast_overflow",
  450. BT_FN_VOID_PTR_PTR,
  451. ATTR_COLD_NOTHROW_LEAF_LIST)
  452. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_FLOAT_CAST_OVERFLOW_ABORT,
  453. "__ubsan_handle_float_cast_overflow_abort",
  454. BT_FN_VOID_PTR_PTR,
  455. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  456. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_OUT_OF_BOUNDS,
  457. "__ubsan_handle_out_of_bounds",
  458. BT_FN_VOID_PTR_PTR,
  459. ATTR_COLD_NOTHROW_LEAF_LIST)
  460. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_OUT_OF_BOUNDS_ABORT,
  461. "__ubsan_handle_out_of_bounds_abort",
  462. BT_FN_VOID_PTR_PTR,
  463. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  464. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NONNULL_ARG,
  465. "__ubsan_handle_nonnull_arg",
  466. BT_FN_VOID_PTR_PTRMODE,
  467. ATTR_COLD_NOTHROW_LEAF_LIST)
  468. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NONNULL_ARG_ABORT,
  469. "__ubsan_handle_nonnull_arg_abort",
  470. BT_FN_VOID_PTR_PTRMODE,
  471. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  472. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
  473. "__ubsan_handle_nonnull_return",
  474. BT_FN_VOID_PTR,
  475. ATTR_COLD_NOTHROW_LEAF_LIST)
  476. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT,
  477. "__ubsan_handle_nonnull_return_abort",
  478. BT_FN_VOID_PTR,
  479. ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST)
  480. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_DYNAMIC_TYPE_CACHE_MISS,
  481. "__ubsan_handle_dynamic_type_cache_miss",
  482. BT_FN_VOID_PTR_PTR_PTR,
  483. ATTR_COLD_NOTHROW_LEAF_LIST)
  484. DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_DYNAMIC_TYPE_CACHE_MISS_ABORT,
  485. "__ubsan_handle_dynamic_type_cache_miss_abort",
  486. BT_FN_VOID_PTR_PTR_PTR,
  487. ATTR_COLD_NOTHROW_LEAF_LIST)