[PATCH] D115993: [ELF] Optimize RelocationSection<ELFT>::writeTo

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 20 19:29:38 PST 2021


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: lld/ELF/SyntheticSections.h:480
+  Symbol *sym;
+  const OutputSection *outputSec = nullptr;
+  const InputSectionBase *inputSec;
----------------
ikudrin wrote:
> peter.smith wrote:
> > Just thinking about making the enum size uint8_t Not entirely sure it will make a lot of difference in this case, but you may want to reorder some of the fields so that they minimise padding between items. For example addend before r_sym. Kind may also benefit from being last. 
> `RelType` is `uint32_t`, so there is no padding. Moving `Kind` at the end (as well as making it `uint8_t`) changes nothing as the whole class should be 64-bit aligned and thus is 64-bytes long regardless the changes.
Dropped the change to `Kind`.

Moved `type` before `r_sym` because r_offset/r_sym/type/addend layout is more similar to `Elf64_Rela`.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115993



More information about the llvm-commits mailing list