[all-commits] [llvm/llvm-project] b0211d: [ELF] Change Symbol::verdefIndex from uint32_t to ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Dec 15 17:59:42 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b0211de5e30a92aef68ceaf43e5042f610d7333f
      https://github.com/llvm/llvm-project/commit/b0211de5e30a92aef68ceaf43e5042f610d7333f
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M lld/ELF/SymbolTable.cpp
    M lld/ELF/Symbols.h

  Log Message:
  -----------
  [ELF] Change Symbol::verdefIndex from uint32_t to uint16_t

The SHT_GNU_version index is 16-bit, so the 32-bit value is a waste.
Technically non-default version index 0x7fff uses version index 0xffff,
but it is impossible in practice.

This change decreases sizeof(SymbolUnion) from 80 to 72 on ELF64 platforms.
Memory usage decreases by 1% when linking a large executable.




More information about the All-commits mailing list