[PATCH] D112513: [ELF] Replace InputBaseSection::{areRelocsRela,firstRelocation,numRelocation} with relSecIdx

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 22:22:39 PDT 2021


MaskRay created this revision.
MaskRay added reviewers: arichardson, jhenderson, peter.smith.
Herald added subscribers: kbarton, nemanjai, emaste.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

For section `.foo`, `InputBaseSection::{areRelocsRela,firstRelocation,numRelocation}` basically
encodes the information of `.rel[a].foo`. However, one uint32_t (the relocation section index)
suffices. See the implementation of `relsOrRelas`.

This change decreases sizeof(InputSection) from 184 to 176 on 64-bit Linux.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112513

Files:
  lld/ELF/Arch/PPC64.cpp
  lld/ELF/DWARF.cpp
  lld/ELF/Driver.cpp
  lld/ELF/ICF.cpp
  lld/ELF/InputFiles.cpp
  lld/ELF/InputFiles.h
  lld/ELF/InputSection.cpp
  lld/ELF/InputSection.h
  lld/ELF/MarkLive.cpp
  lld/ELF/Relocations.cpp
  lld/ELF/SyntheticSections.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112513.382188.patch
Type: text/x-patch
Size: 17338 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211026/b150f015/attachment-0001.bin>


More information about the llvm-commits mailing list