llvm.org GIT mirror llvm / 2b556e9
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 Peter Collingbourne 2 years ago
2 changed file(s) with 8 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
200200 STRINGIFY_ENUM_CASE(ELF, SHT_PREINIT_ARRAY);
201201 STRINGIFY_ENUM_CASE(ELF, SHT_GROUP);
202202 STRINGIFY_ENUM_CASE(ELF, SHT_SYMTAB_SHNDX);
203 STRINGIFY_ENUM_CASE(ELF, SHT_ANDROID_REL);
204 STRINGIFY_ENUM_CASE(ELF, SHT_ANDROID_RELA);
203205 STRINGIFY_ENUM_CASE(ELF, SHT_LLVM_ODRTAB);
204206 STRINGIFY_ENUM_CASE(ELF, SHT_GNU_ATTRIBUTES);
205207 STRINGIFY_ENUM_CASE(ELF, SHT_GNU_HASH);
15121512 }
15131513 }
15141514 switch (Type) {
1515 LLVM_READOBJ_TYPE_CASE(ANDROID_REL);
1516 LLVM_READOBJ_TYPE_CASE(ANDROID_RELSZ);
1517 LLVM_READOBJ_TYPE_CASE(ANDROID_RELA);
1518 LLVM_READOBJ_TYPE_CASE(ANDROID_RELASZ);
15151519 LLVM_READOBJ_TYPE_CASE(BIND_NOW);
15161520 LLVM_READOBJ_TYPE_CASE(DEBUG);
15171521 LLVM_READOBJ_TYPE_CASE(FINI);
17141718 case DT_INIT_ARRAYSZ:
17151719 case DT_FINI_ARRAYSZ:
17161720 case DT_PREINIT_ARRAYSZ:
1721 case DT_ANDROID_RELSZ:
1722 case DT_ANDROID_RELASZ:
17171723 OS << Value << " (bytes)";
17181724 break;
17191725 case DT_NEEDED: