summaryrefslogtreecommitdiffstats
path: root/include/backtrace
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2015-05-01 15:02:03 -0700
committerChristopher Ferris <cferris@google.com>2015-05-01 17:09:49 -0700
commit2106f4ba95004fdfc76ad3fa308a07fdbf475984 (patch)
treeba5f3a525e4288db1f8af44c5b26284fb0d630d9 /include/backtrace
parentb74d889211f30d99c222fa7d3cfaf4a7390d6a95 (diff)
downloadcore-2106f4ba95004fdfc76ad3fa308a07fdbf475984.tar.gz
core-2106f4ba95004fdfc76ad3fa308a07fdbf475984.tar.bz2
core-2106f4ba95004fdfc76ad3fa308a07fdbf475984.zip
Add load base to map for relocation packing.
The new linker relocation packing support uses non-zero load bases, so we better handle them properly. Also print out the load base for a map if it's non-zero. Bug: 20687795 (cherry picked from commit 329ed7dae49eba09bdf865dd999d1a7e73bb9687) Change-Id: Ibc37d8c8bb032820dca4e7531184349ba6d402d2
Diffstat (limited to 'include/backtrace')
-rw-r--r--include/backtrace/BacktraceMap.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/backtrace/BacktraceMap.h b/include/backtrace/BacktraceMap.h
index da963071b..731c24887 100644
--- a/include/backtrace/BacktraceMap.h
+++ b/include/backtrace/BacktraceMap.h
@@ -37,6 +37,7 @@ struct backtrace_map_t {
uintptr_t start;
uintptr_t end;
+ uintptr_t load_base;
int flags;
std::string name;
};
@@ -82,6 +83,14 @@ public:
return map.end > 0;
}
+ static uintptr_t GetRelativePc(const backtrace_map_t& map, uintptr_t pc) {
+ if (IsValid(map)) {
+ return pc - map.start + map.load_base;
+ } else {
+ return pc;
+ }
+ }
+
protected:
BacktraceMap(pid_t pid);