aboutsummaryrefslogtreecommitdiff
path: root/abs32_utils_unittest.cc
diff options
context:
space:
mode:
authorEtienne Pierre-doray <etiennep@chromium.org>2018-10-05 20:15:13 +0000
committerCopybara-Service <copybara-worker@google.com>2021-07-25 20:38:15 -0700
commite53806a25b988acd67fe57b42eaa611f2ba96a75 (patch)
treee5782ba2d6d7b9962d783b0740f97d4492865a28 /abs32_utils_unittest.cc
parent6b37e0db57c48727d81069bc6c0346f0ad688ec0 (diff)
downloadzucchini-e53806a25b988acd67fe57b42eaa611f2ba96a75.tar.gz
[Zucchini]: Fix discrepancy in reference width for Elf reloc and abs32.
Adds kVAWidth to Elf32Traits and use it in DisassemblerElfIntel::MakeReferenceGroups as the width of kReloc and kAbs32 reference types. Bug: 892359 Change-Id: I28930b8978393c16ee29051c48496e4f696a3fcd Reviewed-on: https://chromium-review.googlesource.com/c/1264816 Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org> Reviewed-by: Samuel Huang <huangs@chromium.org> Cr-Commit-Position: refs/heads/master@{#597264} NOKEYCHECK=True GitOrigin-RevId: af95efbfe9d3f3ca90c105f7d1c9c13e43fcde8c
Diffstat (limited to 'abs32_utils_unittest.cc')
-rw-r--r--abs32_utils_unittest.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/abs32_utils_unittest.cc b/abs32_utils_unittest.cc
index 480fea0..a8f6917 100644
--- a/abs32_utils_unittest.cc
+++ b/abs32_utils_unittest.cc
@@ -433,20 +433,20 @@ TEST(Abs32UtilsTest, Win32Write64) {
}
TEST(Abs32UtilsTest, RemoveOverlappingAbs32Locations) {
- // Make |bitness| a state to reduce repetition.
- Bitness bitness = kBit32;
+ // Make |width| a state to reduce repetition.
+ uint32_t width = WidthOf(kBit32);
- auto run_test = [&bitness](const std::vector<offset_t>& expected_locations,
- std::vector<offset_t>&& locations) {
+ auto run_test = [&width](const std::vector<offset_t>& expected_locations,
+ std::vector<offset_t>&& locations) {
ASSERT_TRUE(std::is_sorted(locations.begin(), locations.end()));
size_t expected_removals = locations.size() - expected_locations.size();
- size_t removals = RemoveOverlappingAbs32Locations(bitness, &locations);
+ size_t removals = RemoveOverlappingAbs32Locations(width, &locations);
EXPECT_EQ(expected_removals, removals);
EXPECT_EQ(expected_locations, locations);
};
// 32-bit tests.
- bitness = kBit32;
+ width = WidthOf(kBit32);
run_test(std::vector<offset_t>(), std::vector<offset_t>());
run_test({4U}, {4U});
run_test({4U, 10U}, {4U, 10U});
@@ -470,7 +470,7 @@ TEST(Abs32UtilsTest, RemoveOverlappingAbs32Locations) {
run_test({1000000U}, {1000000U, 1000002U});
// 64-bit tests.
- bitness = kBit64;
+ width = WidthOf(kBit64);
run_test(std::vector<offset_t>(), std::vector<offset_t>());
run_test({4U}, {4U});
run_test({4U, 20U}, {4U, 20U});