diff options
author | Christopher Ferris <cferris@google.com> | 2019-10-21 18:59:42 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2019-10-21 19:11:22 -0700 |
commit | 5838e53b97e722b19a4b06edadd72077d4057e61 (patch) | |
tree | 6d9126a9c1b58c26cab5944f08ebe5ae6f8365bc /libunwindstack/tests/ElfInterfaceTest.cpp | |
parent | d1a6d75d29d093eef4b96948037d0c36710a4a79 (diff) |
Fix handling of PT_GNU_EH_FRAME.
The bias for the PT_GNU_EH_FRAME was using the paddr instead of vaddr.
This doesn't match the way the load bias is calculated, which always
use vaddr - offset, so change to use vaddr.
Found on an old x86 device that has a vdso that sets vaddr differently
from paddr.
Add a new offline test to catch this case and update the elf interface
unit tests.
Also, fix a small bug in the unwind_for_offline tool.
Bug: 142365899
Test: Unit tests pass.
Change-Id: I5f0bf062dd8ee45aa8553189ba493ec962e0b059
Diffstat (limited to 'libunwindstack/tests/ElfInterfaceTest.cpp')
-rw-r--r-- | libunwindstack/tests/ElfInterfaceTest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libunwindstack/tests/ElfInterfaceTest.cpp b/libunwindstack/tests/ElfInterfaceTest.cpp index b048b178f..ea27e3ec6 100644 --- a/libunwindstack/tests/ElfInterfaceTest.cpp +++ b/libunwindstack/tests/ElfInterfaceTest.cpp @@ -1310,7 +1310,7 @@ void ElfInterfaceTest::CheckGnuEhFrame(uint64_t addr, uint64_t offset, int64_t e memset(&phdr, 0, sizeof(phdr)); phdr.p_type = PT_GNU_EH_FRAME; - phdr.p_paddr = addr; + phdr.p_vaddr = addr; phdr.p_offset = offset; memory_.SetMemory(phdr_offset, &phdr, sizeof(phdr)); |