mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
unwind: Skip Mapping Symbols on ARM
ARM documentation for Mapping Symbols: https://developer.arm.com/documentation/dui0803/a/Accessing-and-managing-symbols-with-armlink/About-mapping-symbols PiperOrigin-RevId: 491836684 Change-Id: I2e259e66f2253d80902aa763f2637f3f6fdea414
This commit is contained in:
parent
755f29b35e
commit
77c80b7213
|
@ -57,6 +57,7 @@ cc_library(
|
|||
deps = [
|
||||
":ptrace_hook",
|
||||
":unwind_cc_proto",
|
||||
"//sandboxed_api:config",
|
||||
"//sandboxed_api/sandbox2:comms",
|
||||
"//sandboxed_api/sandbox2/util:maps_parser",
|
||||
"//sandboxed_api/sandbox2/util:minielf",
|
||||
|
|
|
@ -40,6 +40,7 @@ target_link_libraries(sandbox2_unwind PRIVATE
|
|||
sapi::strerror
|
||||
sandbox2::unwind_proto
|
||||
sapi::base
|
||||
sapi::config
|
||||
sapi::file_helpers
|
||||
sapi::raw_logging
|
||||
sapi::status
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "absl/strings/match.h"
|
||||
#include "absl/strings/str_cat.h"
|
||||
#include "libunwind-ptrace.h"
|
||||
#include "sandboxed_api/config.h"
|
||||
#include "sandboxed_api/sandbox2/comms.h"
|
||||
#include "sandboxed_api/sandbox2/unwind/ptrace_hook.h"
|
||||
#include "sandboxed_api/sandbox2/unwind/unwind.pb.h"
|
||||
|
@ -171,6 +172,19 @@ absl::StatusOr<SymbolMap> LoadSymbolsMap(pid_t pid) {
|
|||
}
|
||||
|
||||
for (const ElfFile::Symbol& symbol : elf->symbols()) {
|
||||
// Skip Mapping Symbols on ARM
|
||||
// ARM documentation for Mapping Symbols:
|
||||
// https://developer.arm.com/documentation/dui0803/a/Accessing-and-managing-symbols-with-armlink/About-mapping-symbols
|
||||
if constexpr (sapi::host_cpu::IsArm64() || sapi::host_cpu::IsArm()) {
|
||||
if (absl::StartsWith(symbol.name, "$x") ||
|
||||
absl::StartsWith(symbol.name, "$d") ||
|
||||
absl::StartsWith(symbol.name, "$t") ||
|
||||
absl::StartsWith(symbol.name, "$a") ||
|
||||
absl::StartsWith(symbol.name, "$v")) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (elf->position_independent()) {
|
||||
if (symbol.address >= entry.pgoff &&
|
||||
symbol.address - entry.pgoff < entry.end - entry.start) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user