2022-09-11 18:02:07 +00:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_INTRIN_LEAKY_INTERNAL_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_INTRIN_LEAKY_INTERNAL_H_
|
2023-09-12 04:34:53 +00:00
|
|
|
#include "libc/dce.h"
|
2022-09-11 18:02:07 +00:00
|
|
|
COSMOPOLITAN_C_START_
|
|
|
|
|
2023-09-12 04:34:53 +00:00
|
|
|
#if IsAsan()
|
2022-09-11 18:02:07 +00:00
|
|
|
#define IGNORE_LEAKS(FUNC) \
|
2023-09-12 04:34:53 +00:00
|
|
|
__static_yoink("_leaky_start"); \
|
2022-09-11 18:02:07 +00:00
|
|
|
void *_leaky_##FUNC[] _Section(".piro.relo.sort.leaky.2." #FUNC \
|
2023-09-12 04:34:53 +00:00
|
|
|
",\"aw\",@init_array #") = {FUNC};
|
|
|
|
#else
|
|
|
|
#define IGNORE_LEAKS(FUNC)
|
|
|
|
#endif
|
2022-09-11 18:02:07 +00:00
|
|
|
|
|
|
|
extern intptr_t _leaky_end[] __attribute__((__weak__));
|
|
|
|
extern intptr_t _leaky_start[] __attribute__((__weak__));
|
|
|
|
|
|
|
|
COSMOPOLITAN_C_END_
|
|
|
|
#endif /* COSMOPOLITAN_LIBC_INTRIN_LEAKY_INTERNAL_H_ */
|