[all-commits] [llvm/llvm-project] cd7624: [lld-macho] Show source information for undefined ...

Daniel Bertalan via All-commits all-commits at lists.llvm.org
Mon Jun 20 15:57:13 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cd7624f15369f0d395c1edee1a0b9592083d2fe0
  Author: Daniel Bertalan <dani at danielbertalan.dev>
  Date:   2022-06-20 (Mon, 20 Jun 2022)

  Changed paths:
    M lld/ELF/InputFiles.cpp
    M lld/MachO/Dwarf.cpp
    M lld/MachO/Dwarf.h
    M lld/MachO/InputFiles.cpp
    M lld/MachO/InputFiles.h
    M lld/MachO/InputSection.cpp
    M lld/MachO/InputSection.h
    M lld/MachO/SymbolTable.cpp
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/SyntheticSections.h
    A lld/test/MachO/invalid/undef-debug.s

  Log Message:
  [lld-macho] Show source information for undefined references

The error used to look like this:

  ld64.lld: error: undefined symbol: _foo
  >>> referenced by /path/to/bar.o:(symbol _baz+0x4)

If DWARF line information is available, we now show where in the source
the references are coming from:

  ld64.lld: error: unreferenced symbol: _foo
  >>> referenced by: bar.cpp:42 (/path/to/bar.cpp:42)
  >>>                /path/to/bar.o:(symbol _baz+0x4)

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

More information about the All-commits mailing list