Skip to content

diagnostics: lld-format undefined-symbol errors — referencing object, demangled name (reld#6 P2-T5) #193

Closed

Description

@zackees

Sub-issue of #6 (P2-T5, the error-message baseline).

Why

reld reports Undefined symbol foo, referenced by <source info> (see check_for_undefined in crates/reld-core/src/layout.rs). lld reports:

ld.lld: error: undefined symbol: foo(int)
>>> referenced by a.c:3
>>>               a.o:(main)

Users, IDEs, cargo's own error parsing, and mold's test suite all key on that shape. Several entries in crates/reld/tests/external_tests/mold_skip_tests.toml sit in the ignore group purely as "Different message formats", and these grep for the lld wording.

Scope

  • Undefined-symbol errors follow lld's format: undefined symbol: <demangled name>, then >>> referenced by <source>, then >>> <object>:(<function>). Name the referencing object. Show C++ and Rust symbols demangled; keep the mangled name available with --no-demangle, matching lld.
  • Apply the same format wherever reld emits the diagnostic: errors, and warnings under --warn-unresolved-symbols / --unresolved-symbols.
  • Re-run the mold skip entries listed as "Different message formats" that involve undefined symbols. Remove each that now passes, and correct any reason that turns out wrong.
  • Colour stays behind the diagnostic helper from feat(diagnostics): add colorized diagnostics to the native engine #144.
  • No new dependency without owner approval (AGENTS.md). Check what the workspace already has for demangling before reaching for a crate.

Acceptance

  • An undefined C++ symbol reports its demangled name, the referencing object, and the referencing function, in lld's layout.
  • Every mold entry that passes is removed from the skip list. The rest keep an accurate reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions