1 //===-- sanitizer_dl.cpp --------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file has helper functions that depend on libc's dynamic loading
12 //===----------------------------------------------------------------------===//
14 #include "sanitizer_dl.h"
16 #include "sanitizer_common/sanitizer_platform.h"
22 namespace __sanitizer
{
23 extern const char *SanitizerToolName
;
25 const char *DladdrSelfFName(void) {
28 int ret
= dladdr((void *)&SanitizerToolName
, &info
);
30 return info
.dli_fname
;
37 } // namespace __sanitizer