summaryrefslogtreecommitdiff
path: root/tools/llvm-readobj
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-10-27 17:49:40 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-10-27 17:49:40 +0000
commit2b556e9b1771ba888781b257c16372b3e4209701 (patch)
treed9e400424ada197c520cdd7c379cccb1c341e00e /tools/llvm-readobj
parent1110171c8f724aa27a866a60c9b602f4cb6a9327 (diff)
ELF: Add support for emitting dynamic relocations in the Android relocation packing format.
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. Differential Revision: https://reviews.llvm.org/D39152 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316775 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-readobj')
-rw-r--r--tools/llvm-readobj/ELFDumper.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/llvm-readobj/ELFDumper.cpp b/tools/llvm-readobj/ELFDumper.cpp
index 27fa99cb9b8..0224df8493f 100644
--- a/tools/llvm-readobj/ELFDumper.cpp
+++ b/tools/llvm-readobj/ELFDumper.cpp
@@ -1513,6 +1513,10 @@ static const char *getTypeString(unsigned Arch, uint64_t Type) {
}
}
switch (Type) {
+ LLVM_READOBJ_TYPE_CASE(ANDROID_REL);
+ LLVM_READOBJ_TYPE_CASE(ANDROID_RELSZ);
+ LLVM_READOBJ_TYPE_CASE(ANDROID_RELA);
+ LLVM_READOBJ_TYPE_CASE(ANDROID_RELASZ);
LLVM_READOBJ_TYPE_CASE(BIND_NOW);
LLVM_READOBJ_TYPE_CASE(DEBUG);
LLVM_READOBJ_TYPE_CASE(FINI);
@@ -1715,6 +1719,8 @@ void ELFDumper<ELFT>::printValue(uint64_t Type, uint64_t Value) {
case DT_INIT_ARRAYSZ:
case DT_FINI_ARRAYSZ:
case DT_PREINIT_ARRAYSZ:
+ case DT_ANDROID_RELSZ:
+ case DT_ANDROID_RELASZ:
OS << Value << " (bytes)";
break;
case DT_NEEDED: