Preserve section and data alignment in libchrome.<ver>.so.
commitdd1d104c3a90aa99708d7d51e4997949d79f8dd0
authorsimonb@chromium.org <simonb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 18 Jun 2014 17:01:07 +0000 (18 17:01 +0000)
committersimonb@chromium.org <simonb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 18 Jun 2014 17:01:07 +0000 (18 17:01 +0000)
tree47429839fd96a061be1f5bb9bb39691b9ad0a00e
parent9e733282fad028f93fc4a1827f74bea822f1ffb8
Preserve section and data alignment in libchrome.<ver>.so.

Current packing preserves 4-byte alignment (in practice, 8-byte alignment,
because a whole number of R_ARM_RELATIVE relocations is removed).  However
this is insufficient for some NEON vector instructions.  For example:

  18b0c:       f42c026f        vld1.16 {d0-d3}, [ip :128]

requires a 16-byte alignment, and fails with SIGBUS if not aligned.

The NDK toolchain aligns .text and .data to 256 bytes.  Retain this by
padding the non-packed (non-R_ARM_RELATIVE) relocations with sufficient
R_ARM_NONE entries so that 256 byte alignment is preserved.  Update
test data so that enough R_ARM_RELATIVE entries are present for packing
to reduce file size.

BUG=385553

Review URL: https://codereview.chromium.org/341483002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278105 0039d316-1c4b-4281-b951-d872f2087c98
tools/relocation_packer/src/elf_file.cc
tools/relocation_packer/test_data/elf_file_unittest_relocs.cc
tools/relocation_packer/test_data/elf_file_unittest_relocs.so
tools/relocation_packer/test_data/elf_file_unittest_relocs_packed.so