[PATCH] D39152: [wip] ELF: Add support for emitting dynamic relocations in the Android relocation packing format.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 18:45:34 PDT 2017


pcc created this revision.
Herald added subscribers: kristof.beyls, emaste, srhines, aemerson.

The Android relocation packing format is a more compact
format for dynamic relocations in executables and DSOs
that is based on delta encoding and SLEBs. An overview
of the format can be found in the Android source code:
https://android.googlesource.com/platform/bionic/+/refs/heads/master/tools/relocation_packer/src/delta_encoder.h

This patch implements relocation packing using that format.

This implementation uses a more intelligent algorithm for compressing
relative relocations than Android's own relocation packer. As a
result it can generally create smaller relocation sections than
that packer. If I link Chromium for Android targeting ARM32 I get a
.rel.dyn of size 174693 bytes, as compared to 371832 bytes with gold
and the Android packer.

TODO:

- Write tests.
- Implement support for RELA.

Depends on https://reviews.llvm.org/D34692


https://reviews.llvm.org/D39152

Files:
  lld/ELF/Config.h
  lld/ELF/Driver.cpp
  lld/ELF/Options.td
  lld/ELF/SyntheticSections.cpp
  lld/ELF/SyntheticSections.h
  lld/ELF/Writer.cpp
  llvm/include/llvm/BinaryFormat/ELF.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39152.119733.patch
Type: text/x-patch
Size: 19061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171021/a184a0f8/attachment.bin>


More information about the llvm-commits mailing list