Skip to content

feat(core): lld-format undefined-symbol errors with referencing object and demangled name (#193) - #199

Merged
zackees merged 1 commit into
mainfrom
feat/meta-work-193
Sep 18, 2026
Merged

zackees merged 1 commit into
mainfrom
feat/meta-work-193

Conversation

@zackees

@zackees zackees commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Closes #193

Undefined-symbol diagnostics now use lld's layout:

reld: error: undefined symbol: foo(int, int)
>>> referenced by r193.cc:2 (/abs/path/r193.cc:2)
>>>               /abs/path/r193.o:(main)
  • diagnostic.rs: lld-style formatters. These cover the undefined [hidden |protected ]symbol: header, the >>> referenced by lines and the file:line line (lld's createFileLineMsg), plus in archive X and >>> referenced N more times. The shared-library check now prints undefined reference: ... (disallowed by --no-allow-shlib-undefined).
  • layout.rs: references are collected while relocations are scanned, then grouped per symbol in a fixed order. Names are demangled by default, and --no-demangle keeps the mangled name.
  • New acceptance fixture undefined-symbol-lld-format, run as three configs: demangled, --no-demangle, and -g with a source location.
  • mold skip list: removed demangle, unresolved-symbols, warn-unresolved-symbols, z-defs, missing-error and weak-undef2, which now pass. The skip reasons for the remaining related entries now describe the actual failures.

Local validation (x86_64 Linux host)

  • cargo fmt --all -- --check, cargo clippy -p reld-core/-p reld --all-targets -D warnings: clean
  • cargo test -p reld-core --lib: 260 passed
  • Acceptance: all passed for undefined-symbol-lld-format, source-info-from-debug, undef-transitive, shlib-undefined, undefined-with-gc-refs and undefined-weak-and-strong. Across the full suite, 11 fixtures fail, and they are the known static-glibc baseline on this host.
  • mold external suite (pinned at 9b101aa9): 401 passed. The 4 failures are the known host baseline (rpath, sframe, trace, weak-export-dso2). The 6 tests removed from the skip list pass as regular tests. The kept entries still fail as expected.
  • The act phase1-native lane was not run, because this change touches no CI or phase1 behaviour.

Follow-up (already there before this change, not introduced here): the parenthetical path in >>> referenced by comes from the existing get_source_info. For an absolute DWARF5 file name that has dir_index != 0, it joins the name with comp_dir instead of the file's own directory entry.

🤖 Generated with Claude Code

…t and demangled name (#193)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@zackees
zackees merged commit 3575b85 into main Sep 18, 2026
27 checks passed
@zackees
zackees deleted the feat/meta-work-193 branch September 18, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant