[all-commits] [llvm/llvm-project] 7a58dd: [ELF] Refactor Symbol initialization and overwriting

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Sep 28 13:11:48 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7a58dd1046a8052619d173b769f32f2df3aafbe8
      https://github.com/llvm/llvm-project/commit/7a58dd1046a8052619d173b769f32f2df3aafbe8
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M lld/ELF/Driver.cpp
    M lld/ELF/InputFiles.cpp
    M lld/ELF/LTO.cpp
    M lld/ELF/LinkerScript.cpp
    M lld/ELF/Relocations.cpp
    M lld/ELF/SymbolTable.cpp
    M lld/ELF/Symbols.cpp
    M lld/ELF/Symbols.h

  Log Message:
  -----------
  [ELF] Refactor Symbol initialization and overwriting

Symbol::replace intends to overwrite a few fields (mostly Elf{32,64}_Sym
fields), but the implementation copies all fields then restores some old fields.
This is error-prone and wasteful. Add Symbol::overwrite to copy just the
needed fields and add other overwrite member functions to copy the extra
fields.




More information about the All-commits mailing list