Re-enable dex verifier after dexlayout

Disabled class def ordering since it violates the spec regarding
superclasses occurring before subclasses. This fixes a dex verifier
failure.

Adjust the data section size based on string data and code item
diff. This fixes dex2oat_image_test failing dex file verification.

Fixed handling of unreference annotations. Previously, these would
not get written back out. This resulted the dex file verifier
prematurely ending for annotations during CheckIntraSectionIterate
and then complaining about non zero padding (that was actually an
annotation).

Test: test-art-host
Bug: 63756964
Bug: 68208404

Change-Id: Id2b9b360640c360ac562826e9193971f7bb30eea
diff --git a/dex2oat/dex2oat_test.cc b/dex2oat/dex2oat_test.cc
index 21768d3..cb91978 100644
--- a/dex2oat/dex2oat_test.cc
+++ b/dex2oat/dex2oat_test.cc
@@ -825,13 +825,13 @@
       ASSERT_LT(class_def_count, std::numeric_limits<uint16_t>::max());
       ASSERT_GE(class_def_count, 2U);
 
-      // The new layout swaps the classes at indexes 0 and 1.
+      // Make sure the indexes stay the same.
       std::string old_class0 = old_dex_file->PrettyType(old_dex_file->GetClassDef(0).class_idx_);
       std::string old_class1 = old_dex_file->PrettyType(old_dex_file->GetClassDef(1).class_idx_);
       std::string new_class0 = new_dex_file->PrettyType(new_dex_file->GetClassDef(0).class_idx_);
       std::string new_class1 = new_dex_file->PrettyType(new_dex_file->GetClassDef(1).class_idx_);
-      EXPECT_EQ(old_class0, new_class1);
-      EXPECT_EQ(old_class1, new_class0);
+      EXPECT_EQ(old_class0, new_class0);
+      EXPECT_EQ(old_class1, new_class1);
     }
 
     EXPECT_EQ(odex_file->GetCompilerFilter(), CompilerFilter::kSpeedProfile);