[all-commits] [llvm/llvm-project] 2b6713: [lld/coff] Fix assert on /start-lib foo.obj /end-l...

Nico Weber via All-commits all-commits at lists.llvm.org
Thu Dec 19 08:22:52 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b6713d3b87d6e0bf562cf10ef620a12328c4106
      https://github.com/llvm/llvm-project/commit/2b6713d3b87d6e0bf562cf10ef620a12328c4106
  Author: Nico Weber <thakis at chromium.org>
  Date:   2024-12-19 (Thu, 19 Dec 2024)

  Changed paths:
    M lld/COFF/InputFiles.cpp
    M lld/test/COFF/start-lib.ll

  Log Message:
  -----------
  [lld/coff] Fix assert on /start-lib foo.obj /end-lib during eager loads (#120292)

If foo.obj is eagerly loaded (due to a prior undef referencing one if
its symbols) and has more than one symbol, we used to assert:
SymbolTable::addLazyObject() for the first symbol would set `lazy` to
false and load all symbols from the file, but the outer
ObjFile::parseLazy() loop would continue to run and call addLazyObject()
for the second symbol, which would assert.

Instead, just stop adding lazy symbols if the file got loaded for real
while adding a symbol.

(The ELF port has a similar early exit in `ObjFile<ELFT>::parseLazy()`.)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list