Adjust Thumb2 code offsets
Change-Id: I2ec65c653bda3b47efa54d5496c96a3c7f343e5a
diff --git a/src/oatdump.cc b/src/oatdump.cc
index d2ceb5e..7333bc3 100644
--- a/src/oatdump.cc
+++ b/src/oatdump.cc
@@ -199,7 +199,11 @@
}
void AddOffsets(const OatFile::OatMethod& oat_method) {
- offsets_.insert(oat_method.GetCodeOffset());
+ uint32_t code_offset = oat_method.GetCodeOffset();
+ if (oat_file_.GetOatHeader().GetInstructionSet() == kThumb2) {
+ code_offset &= ~0x1;
+ }
+ offsets_.insert(code_offset);
offsets_.insert(oat_method.GetMappingTableOffset());
offsets_.insert(oat_method.GetVmapTableOffset());
offsets_.insert(oat_method.GetGcMapOffset());