reloc_packer: Allow aarch64 DSO linked with gold
commit27b15618496eb3d04a1fe7daf1554239b0d624f6
authorpasko <pasko@chromium.org>
Tue, 10 Feb 2015 15:21:34 +0000 (10 07:21 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 10 Feb 2015 15:22:15 +0000 (10 15:22 +0000)
treefa40c0d2c51dad79e63f9e934600642065af8184
parent219ad0dfedd72afac601871dfc1ea1626982e2d7
reloc_packer: Allow aarch64 DSO linked with gold

Using the Gold linker is needed for -section-ordering-file.

The new aarch64 Gold linker in android_tools produces PT_GNU_STACK header with
alignment of 0. This breaks the relocation packer that expects alignment of 16
for aarch64 (i.e. what the GNU LD produces).

Relaxing the relocation packer requirement for the alignment produces a
successfully packed DSO:
* only 32KiB bigger than packed DSO produced by GNU LD
* this means, as usual, about ~5 MiB benefits of relocation packing (yay!)
* loads OK on Nexus 9

BUG=448054

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

Cr-Commit-Position: refs/heads/master@{#315565}
tools/relocation_packer/src/elf_file.cc