diff options
author | rmcilroy@chromium.org <rmcilroy@chromium.org> | 2015-06-30 13:30:22 +0000 |
---|---|---|
committer | rmcilroy@chromium.org <rmcilroy@chromium.org> | 2015-06-30 13:30:22 +0000 |
commit | cd744acecc4b1889f7452d67103b3fc5a015631d (patch) | |
tree | 33915e61de2e8ff0476ceeb6f4b79bbc4158262c /src/client/linux/minidump_writer | |
parent | Checking location of the instruction pointer to see if it is (diff) | |
download | breakpad-cd744acecc4b1889f7452d67103b3fc5a015631d.tar.xz |
Adjust breakpad module size to match adjusted start_addr.
When changing a module's start_addr to account for Android packed
relocations, also adjust its size field so that the apparent module
end addr calculated by the breakpad processor does not alter.
Ensures that the mapping entry from a packed library is consistent
with that which an unpacked one would produce.
BUG=499747
R=primiano@chromium.org, rmcilroy@chromium.org
Review URL: https://codereview.chromium.org/1211863002.
Patch from Simon Baldwin <simonb@chromium.org>.
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1465 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/linux/minidump_writer')
-rw-r--r-- | src/client/linux/minidump_writer/linux_dumper.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client/linux/minidump_writer/linux_dumper.cc b/src/client/linux/minidump_writer/linux_dumper.cc index 00d18189..43b74ad9 100644 --- a/src/client/linux/minidump_writer/linux_dumper.cc +++ b/src/client/linux/minidump_writer/linux_dumper.cc @@ -510,10 +510,15 @@ void LinuxDumper::LatePostprocessMappings() { } if (ehdr.e_type == ET_DYN) { // Compute the effective load bias for this mapped library, and update - // the mapping to hold that rather than |start_addr|. Where the library - // does not contain Android packed relocations, GetEffectiveLoadBias() - // returns |start_addr| and the mapping entry is not changed. - mapping->start_addr = GetEffectiveLoadBias(&ehdr, mapping->start_addr); + // the mapping to hold that rather than |start_addr|, at the same time + // adjusting |size| to account for the change in |start_addr|. Where + // the library does not contain Android packed relocations, + // GetEffectiveLoadBias() returns |start_addr| and the mapping entry + // is not changed. + const uintptr_t load_bias = GetEffectiveLoadBias(&ehdr, + mapping->start_addr); + mapping->size += mapping->start_addr - load_bias; + mapping->start_addr = load_bias; } } } |