summaryrefslogtreecommitdiff
path: root/libunwindstack/tests/ElfInterfaceTest.cpp
diff options
context:
space:
mode:
authorFlorian Mayer <fmayer@google.com>2019-07-05 16:48:04 +0100
committerChristopher Ferris <cferris@google.com>2019-07-09 10:22:36 -0700
commit249c90ff17296fe2a46213d65a05c41928c478f8 (patch)
tree7b44343e64a204c60777b3ae5d3fafda1a82967f /libunwindstack/tests/ElfInterfaceTest.cpp
parent463773b733e6c24c94fe2ffb46b6e00224d89e58 (diff)
Fix missing load bias.
There are binaries that have non-executable LOAD with p_offset=0. E.g., Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000040 0x0000000000400040 0x0000000000400040 0x0002a0 0x0002a0 R 0x8 INTERP 0x0002e0 0x00000000004002e0 0x00000000004002e0 0x00001c 0x00001c R 0x1 [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2] LOAD 0x000000 0x0000000000400000 0x0000000000400000 0x0059e0 0x0059e0 R 0x1000 LOAD 0x006000 0x0000000000406000 0x0000000000406000 0x10f2b05 0x10f2b05 R E 0x1000 LOAD 0x10f9000 0x00000000014f9000 0x00000000014f9000 0x70f634 0x70f634 R 0x1000 LOAD 0x1808f18 0x0000000001c09f18 0x0000000001c09f18 0x089fc8 0x0a7ab8 RW 0x1000 DYNAMIC 0x1864ce0 0x0000000001c65ce0 0x0000000001c65ce0 0x000240 0x000240 RW 0x8 NOTE 0x0002fc 0x00000000004002fc 0x00000000004002fc 0x000020 0x000020 R 0x4 TLS 0x1808f18 0x0000000001c09f18 0x0000000001c09f18 0x000010 0x000010 R 0x8 GNU_EH_FRAME 0x11abde8 0x00000000015abde8 0x00000000015abde8 0x14484c 0x14484c R 0x4 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x10 GNU_RELRO 0x1808f18 0x0000000001c09f18 0x0000000001c09f18 0x05c0e8 0x05c0e8 R 0x1 Test: host libunwindstack_test passes. Test: Modified unit tests and new offline test. Change-Id: I3992f712be238c7d4109556580b5dcc71175fe19
Diffstat (limited to 'libunwindstack/tests/ElfInterfaceTest.cpp')
-rw-r--r--libunwindstack/tests/ElfInterfaceTest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libunwindstack/tests/ElfInterfaceTest.cpp b/libunwindstack/tests/ElfInterfaceTest.cpp
index cdc927aba..f9ee9eb93 100644
--- a/libunwindstack/tests/ElfInterfaceTest.cpp
+++ b/libunwindstack/tests/ElfInterfaceTest.cpp
@@ -360,7 +360,7 @@ void ElfInterfaceTest::NonExecutablePtLoads() {
uint64_t load_bias = 0;
ASSERT_TRUE(elf->Init(&load_bias));
- EXPECT_EQ(0U, load_bias);
+ EXPECT_EQ(0x1001U, load_bias);
const std::unordered_map<uint64_t, LoadInfo>& pt_loads = elf->pt_loads();
ASSERT_EQ(1U, pt_loads.size());