Commit graph

6 commits

Author SHA1 Message Date
Simon Baldwin
1011e1a402 Fix unit tests, and extend for other architectures
On unpacking, reinstate any p_align values that packing reduced to
page size.  Ensures a round-trip pack and unpack is bit-equivalent
to the original input.
https://android-review.googlesource.com/#/c/148492/

Extend unit tests to include ia32, x64, and mips32.

Recreate test data for arm32 and arm64.  Generate new test data for
ia32, x64, and mips32.

Bug: http://b/20687795
Bug: http://b/18051137
Change-Id: Ifbca8e206ef447297ba4f19272b813702be27a35
2015-05-27 13:20:00 +01:00
Dmitriy Ivanov
b293969c6d Reduce p_align for program header to page size.
Having p_align > page_size leads to the situation when striping
 packed executables results in unnecessary p_vaddr adjustments.
 And it also may result (with probability 1 - 1/sizeof(uintptr_t)) in
 misaligned segments following .dynstr

Bug: http://b/20629834
Bug: http://b/18051137
Change-Id: I1c5da4911e4409d63cb09f6b6b0a16ef54f6501b
2015-04-27 20:37:17 -07:00
Dmitriy Ivanov
f15ceeb784 Always use signed leb128 encoding
According to runs on /system/lib there using
 unsigned leb128 does not save us any additional
 space. In order to keep packing as simple as
 possible switch to using signed leb128 for
 everything.

Bug: http://b/18051137
Change-Id: I1a47cb9eb2175895b3c3f7c13b4c6b1060de86c0
2015-04-22 12:58:38 -07:00
Simon Baldwin
d2bd5739ed Remove unused/unusable relocation packer files.
Removes:
- src/run_length_encoder.h
    artifact of the original packing tool, not used here
- test_data/generate_elf_file_unittest_relocs.sh
- test_data/generate_elf_file_unittest_relocs.py
    test data generation for chromium/gyp, not usable here
- README.TXT
    because it is now almost entirely outdated

Change-Id: Ic4cd372647d9a365dc52833a6cc1cf66f0c95ec9
2015-03-25 16:23:01 +00:00
Dmitriy Ivanov
f8ff6b103b Generalize compression tool
1. One binary for all architectures
 2. Generalize (and slightly improve) compression
 2.1 works on all relocation types (rela?.dyn section only so far)
 2.2 Uses same format to encode ElfW(Rel) as well as ElfW(Rela) tables

Bug: 18051137
Change-Id: I66c95d9076954ca115816fc577d0f5ef274e5e72
2015-03-06 13:01:08 -08:00
Dmitriy Ivanov
87a0617ebe Import relocation packer from chromium repo
Bug: 18051137
Change-Id: Ia67fa11da8247e3f86f70a8ce99e6695f2c05423
2015-03-06 13:01:08 -08:00