diff options
author | Christopher Ferris <cferris@google.com> | 2018-10-08 17:39:39 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2018-10-08 19:47:33 -0700 |
commit | eb069a28d6b1d6a6a74e7bebeecd91140128821a (patch) | |
tree | b0df60cbae4a809c968d0a8072117aa36ae9e27c /libunwindstack/tests/DexFilesTest.cpp | |
parent | 85be654773c87810d474d2dbb898c04a84766c3b (diff) | |
download | unwinding-eb069a28d6b1d6a6a74e7bebeecd91140128821a.tar.gz |
Fix handling of globals for new linker.oreo-mr1-1.2-iot-release
The new linker base map is read-only, but the global handling code
for jit and dex information assumed the base map was a read-execute
one. Relax that requirement to search read-only maps.
Adjust the unit tests for this case.
Bug: 117293117
Test: Passes unit tests.
Test: Passes art cfi tests with and without llvm linker.
Change-Id: I31a765d51847d0b8d778ace9cbaa29f42073f4d9
Diffstat (limited to 'libunwindstack/tests/DexFilesTest.cpp')
-rw-r--r-- | libunwindstack/tests/DexFilesTest.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libunwindstack/tests/DexFilesTest.cpp b/libunwindstack/tests/DexFilesTest.cpp index d029bb0..c6d7f33 100644 --- a/libunwindstack/tests/DexFilesTest.cpp +++ b/libunwindstack/tests/DexFilesTest.cpp @@ -46,17 +46,17 @@ class DexFilesTest : public ::testing::Test { maps_.reset( new BufferMaps("1000-4000 ---s 00000000 00:00 0\n" "4000-6000 r--s 00000000 00:00 0\n" - "6000-8000 -w-s 00000000 00:00 0\n" - "a000-c000 r-xp 00000000 00:00 0\n" - "c000-f000 rwxp 00000000 00:00 0\n" - "f000-11000 r-xp 00000000 00:00 0\n" + "6000-8000 -wxs 00000000 00:00 0\n" + "a000-c000 r--p 00000000 00:00 0\n" + "c000-f000 rw-p 00000000 00:00 0\n" + "f000-11000 r--p 00000000 00:00 0\n" "100000-110000 rw-p 0000000 00:00 0\n" "200000-210000 rw-p 0000000 00:00 0\n" "300000-400000 rw-p 0000000 00:00 0\n")); ASSERT_TRUE(maps_->Parse()); - // Global variable in a section that is not readable/executable. - MapInfo* map_info = maps_->Get(kMapGlobalNonReadableExectable); + // Global variable in a section that is not readable. + MapInfo* map_info = maps_->Get(kMapGlobalNonReadable); ASSERT_TRUE(map_info != nullptr); MemoryFake* memory = new MemoryFake; ElfFake* elf = new ElfFake(memory); @@ -95,7 +95,7 @@ class DexFilesTest : public ::testing::Test { void WriteEntry64(uint64_t entry_addr, uint64_t next, uint64_t prev, uint64_t dex_file); void WriteDex(uint64_t dex_file); - static constexpr size_t kMapGlobalNonReadableExectable = 3; + static constexpr size_t kMapGlobalNonReadable = 2; static constexpr size_t kMapGlobalSetToZero = 4; static constexpr size_t kMapGlobal = 5; static constexpr size_t kMapDexFileEntries = 7; |