Dexlayout fix for duplicate class data and preserving last code item.

This change fixes a dexlayout issue when multiple class defs reference
the same class data. A set is used to tell what class data has already
been visited.

This change also makes dexlayout preserve the offset of the last code
item in the dex file if the following section is not 4-byte aligned.
Due to limitations in dexlayout, it is difficult to adjust the offsets
of sections if more space is needed. An overhaul of dexlayout should
be done to properly fix this.

Bug: 35451910
Test: mm test-art-host-gtest-dexlayout_test
Change-Id: I8d066c2151a1a57c382ce35f12bf53a519da89f6
4 files changed