[PATCH] D65242: [ELF] More dynamic relocation packing

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 13:48:01 PDT 2019


pcc added inline comments.


================
Comment at: lld/ELF/SyntheticSections.cpp:1745
+    add(g.size());
+    add(RELOCATION_GROUPED_BY_INFO_FLAG | hasAddendIfRela |
+        groupedByAddendIfRela);
----------------
I don't think you need to set `hasAddendIfRela | groupedByAddendIfRela`. If these flags are not set, the unpacker will use 0 as the addend value. See:
https://android.googlesource.com/platform/bionic/+/master/linker/linker_reloc_iterators.h#142

I think this also means that you don't need to reorder non-relatives before relatives.


================
Comment at: lld/ELF/SyntheticSections.cpp:1748-1750
+    if (config->isRela) {
+      add(0);
+    }
----------------
Can be removed with suggestion above.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65242/new/

https://reviews.llvm.org/D65242





More information about the llvm-commits mailing list