summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/symbolizer
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sanitizer_common/symbolizer')
-rw-r--r--lib/sanitizer_common/symbolizer/sanitizer_symbolize.cc21
-rw-r--r--lib/sanitizer_common/symbolizer/sanitizer_wrappers.cc7
-rwxr-xr-xlib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh4
-rw-r--r--lib/sanitizer_common/symbolizer/scripts/global_symbols.txt2
4 files changed, 20 insertions, 14 deletions
diff --git a/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cc b/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cc
index b25a53d73..8150b7a09 100644
--- a/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cc
+++ b/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cc
@@ -1,9 +1,8 @@
//===-- sanitizer_symbolize.cc ----------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -38,8 +37,11 @@ bool __sanitizer_symbolize_code(const char *ModuleName, uint64_t ModuleOffset,
{
llvm::raw_string_ostream OS(Result);
llvm::symbolize::DIPrinter Printer(OS);
- auto ResOrErr =
- getDefaultSymbolizer()->symbolizeInlinedCode(ModuleName, ModuleOffset);
+ // TODO: it is neccessary to set proper SectionIndex here.
+ // object::SectionedAddress::UndefSection works for only absolute addresses.
+ auto ResOrErr = getDefaultSymbolizer()->symbolizeInlinedCode(
+ ModuleName,
+ {ModuleOffset, llvm::object::SectionedAddress::UndefSection});
Printer << (ResOrErr ? ResOrErr.get() : llvm::DIInliningInfo());
}
return __sanitizer::internal_snprintf(Buffer, MaxLength, "%s",
@@ -52,8 +54,11 @@ bool __sanitizer_symbolize_data(const char *ModuleName, uint64_t ModuleOffset,
{
llvm::raw_string_ostream OS(Result);
llvm::symbolize::DIPrinter Printer(OS);
- auto ResOrErr =
- getDefaultSymbolizer()->symbolizeData(ModuleName, ModuleOffset);
+ // TODO: it is neccessary to set proper SectionIndex here.
+ // object::SectionedAddress::UndefSection works for only absolute addresses.
+ auto ResOrErr = getDefaultSymbolizer()->symbolizeData(
+ ModuleName,
+ {ModuleOffset, llvm::object::SectionedAddress::UndefSection});
Printer << (ResOrErr ? ResOrErr.get() : llvm::DIGlobal());
}
return __sanitizer::internal_snprintf(Buffer, MaxLength, "%s",
diff --git a/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cc b/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cc
index 66d089a0e..c85ebe5e2 100644
--- a/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cc
+++ b/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cc
@@ -1,9 +1,8 @@
//===-- sanitizer_wrappers.cc -----------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh b/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh
index 788cef85a..5c77bea83 100755
--- a/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh
+++ b/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh
@@ -9,8 +9,8 @@ if [ "$#" -le 1 ]; then
usage
fi
-AR=$(readlink -f $AR)
-LINK=$(readlink -f $LINK)
+[[ $AR == /* ]] || AR=$PWD/$AR
+[[ $LINK == /* ]] || LINK=$PWD/$LINK
INPUTS=
OUTPUT=
diff --git a/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt b/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt
index beee0acf4..e20fdc7c3 100644
--- a/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt
+++ b/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt
@@ -36,6 +36,7 @@ __umoddi3 U
_exit U
abort U
access U
+bcmp U
calloc U
catclose U
catgets U
@@ -132,6 +133,7 @@ strtol U
strtold_l U
strtoll_l U
strtoull_l U
+syscall U
tcgetattr U
uname U
ungetc U