#include "sanitizer_common/sanitizer_platform.h"
#include "lsan_common.h"
#if CAN_SANITIZE_LEAKS && (SANITIZER_LINUX || SANITIZER_NETBSD)
#include <link.h>
#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_flags.h"
#include "sanitizer_common/sanitizer_getauxval.h"
#include "sanitizer_common/sanitizer_linux.h"
#include "sanitizer_common/sanitizer_stackdepot.h"
namespace __lsan {
static const char kLinkerName[] = …;
alignas(64) static char linker_placeholder[sizeof(LoadedModule)];
static LoadedModule *linker = …;
static bool IsLinker(const LoadedModule& module) { … }
__attribute__((tls_model("initial-exec")))
THREADLOCAL int disable_counter;
bool DisabledInThisThread() { … }
void DisableInThisThread() { … }
void EnableInThisThread() { … }
void InitializePlatformSpecificModules() { … }
static int ProcessGlobalRegionsCallback(struct dl_phdr_info *info, size_t size,
void *data) { … }
#if SANITIZER_ANDROID && __ANDROID_API__ < 21
extern "C" __attribute__((weak)) int dl_iterate_phdr(
int (*)(struct dl_phdr_info *, size_t, void *), void *);
#endif
void ProcessGlobalRegions(Frontier *frontier) { … }
LoadedModule *GetLinker() { … }
void ProcessPlatformSpecificAllocations(Frontier *frontier) { … }
struct DoStopTheWorldParam { … };
void HandleLeaks() { … }
static int LockStuffAndStopTheWorldCallback(struct dl_phdr_info *info,
size_t size, void *data) { … }
void LockStuffAndStopTheWorld(StopTheWorldCallback callback,
CheckForLeaksParam *argument) { … }
}
#endif