[all-commits] [llvm/llvm-project] 5d3bd7: [ELF] Move gotIndex/pltIndex/globalDynIndex to Sym...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Jan 9 13:43:39 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d3bd7f36092c88265dc698a970078184425f67c
      https://github.com/llvm/llvm-project/commit/5d3bd7f36092c88265dc698a970078184425f67c
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-01-09 (Sun, 09 Jan 2022)

  Changed paths:
    M lld/ELF/Arch/PPC.cpp
    M lld/ELF/Arch/PPC64.cpp
    M lld/ELF/Arch/X86.cpp
    M lld/ELF/Arch/X86_64.cpp
    M lld/ELF/Driver.cpp
    M lld/ELF/Relocations.cpp
    M lld/ELF/Symbols.cpp
    M lld/ELF/Symbols.h
    M lld/ELF/SyntheticSections.cpp

  Log Message:
  -----------
  [ELF] Move gotIndex/pltIndex/globalDynIndex to SymbolAux

to decrease sizeof(SymbolUnion) by 8 on ELF64 platforms.

Symbols needing such information are typically 1% or fewer (5134 out of 560520
when linking clang, 19898 out of 5550705 when linking chrome). Storing them
elsewhere can decrease memory usage and symbol initialization time.
There is a ~0.8% saving on max RSS when linking a large program.

Future direction:

* Move some of dynsymIndex/verdefIndex/versionId to SymbolAux
* Support mixed TLSDESC and TLS GD without increasing sizeof(SymbolUnion)

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D116281




More information about the All-commits mailing list