summaryrefslogtreecommitdiffstats
path: root/include
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 16:04:24 -0700
commit329ed7dae49eba09bdf865dd999d1a7e73bb9687 (patch)
treeac1e24fea451c6ac8f5e5101e32f3f69f76d0d55 /include
parentf1a58f8f33509201cabe71c6a9d01aa6b8f99966 (diff)
downloadsystem_core-329ed7dae49eba09bdf865dd999d1a7e73bb9687.zip
system_core-329ed7dae49eba09bdf865dd999d1a7e73bb9687.tar.gz
system_core-329ed7dae49eba09bdf865dd999d1a7e73bb9687.tar.bz2
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 Change-Id: Iec2d1db2051e7b4a278c1dfa57d745128a7f2974
Diffstat (limited to 'include')
-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 da96307..731c248 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);