From 9ab330dc7af2af28dac54b6198a7ec309087b819 Mon Sep 17 00:00:00 2001 From: Catalin Patulea Date: Wed, 18 Aug 2021 07:13:45 -0700 Subject: [PATCH] 'Map' symbols: add pgoff to disambiguate multiple mappings on same object. PiperOrigin-RevId: 391520785 Change-Id: Icb05e60f778acfb9fe6f519911ce54bec65fc4ff --- sandboxed_api/sandbox2/unwind/unwind.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sandboxed_api/sandbox2/unwind/unwind.cc b/sandboxed_api/sandbox2/unwind/unwind.cc index 0a12d2b..940e1fa 100644 --- a/sandboxed_api/sandbox2/unwind/unwind.cc +++ b/sandboxed_api/sandbox2/unwind/unwind.cc @@ -100,7 +100,11 @@ absl::StatusOr> LoadSymbolsMap(pid_t pid) { // The maps entries are ordered and thus sorted with increasing adresses. // This means if there is a symbol @ entry.end, it will be overwritten in // the next iteration. - addr_to_symbol[entry.start] = absl::StrCat("map:", entry.path); + std::string map = absl::StrCat("map:", entry.path); + if (entry.pgoff) { + absl::StrAppend(&map, "+0x%x", entry.pgoff); + } + addr_to_symbol[entry.start] = map; addr_to_symbol[entry.end] = ""; absl::StatusOr elf =