[all-commits] [llvm/llvm-project] c30e64: [ELF] Move section assignment from initializeSymbo...

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Mar 14 14:13:53 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c30e6447c0225f675773d07f2b6d4e3c2b962155
      https://github.com/llvm/llvm-project/commit/c30e6447c0225f675773d07f2b6d4e3c2b962155
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-03-14 (Mon, 14 Mar 2022)

  Changed paths:
    M lld/ELF/Config.h
    M lld/ELF/Driver.cpp
    M lld/ELF/InputFiles.cpp
    M lld/ELF/Relocations.cpp
    M lld/ELF/Symbols.cpp
    M lld/ELF/Symbols.h
    M lld/docs/ReleaseNotes.rst
    M lld/test/ELF/comdat-binding.s
    M lld/test/ELF/comdat-discarded-error.s
    M lld/test/ELF/comdat-discarded-lazy.s
    M lld/test/ELF/duplicated-synthetic-sym.s
    M lld/test/ELF/exclude-discarded-error2.s
    M lld/test/ELF/lto/comdat-mixed-archive.test

  Log Message:
  -----------
  [ELF] Move section assignment from initializeSymbols to postParse

https://discourse.llvm.org/t/parallel-input-file-parsing/60164

initializeSymbols currently sets Defined::section and handles non-prevailing
COMDAT groups. Move the code to the parallel postParse to reduce work from the
single-threading code path and make parallel section initialization infeasible.

Postpone reporting duplicate symbol errors so that the messages have the
section information. (`Defined::section` is assigned in postParse and another
thread may not have the information).

* duplicated-synthetic-sym.s: BinaryFile duplicate definition (very rare) now
  has no section information
* comdat-binding: `%t/w.o %t/g.o` leads to an undesired undefined symbol. This
  is not ideal but we report a diagnostic to inform that this is unsupported.
  (See release note)
* comdat-discarded-lazy.s: %tdef.o is unextracted. The new behavior (discarded
  section error) makes more sense

Depends on D120640

Reviewed By: peter.smith

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




More information about the All-commits mailing list