[llvm-bugs] [Bug 34872] New: lld emits a misleading diagnostic

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Oct 7 17:22:40 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34872

            Bug ID: 34872
           Summary: lld emits a misleading diagnostic
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: davide at freebsd.org
                CC: llvm-bugs at lists.llvm.org

If you take the example in https://bugs.llvm.org/show_bug.cgi?id=34870 and link
with lld, you get two diagnostics.

[davide at localhost bin]$ ./clang fmod.c -O0 -fuse-ld=lld
/home/davide/work/llvm/build-release/bin/./ld.lld: error: undefined symbol:
fmod
>>> referenced by fmod.c
>>>               /tmp/fmod-208cee.o:(foo)

/home/davide/work/llvm/build-release/bin/./ld.lld: error: symbol 'fmod' defined
in /tmp/fmod-208cee.o has no type
clang-6.0: error: linker command failed with exit code 1 (use -v to see
invocation)

The first one, I guess is fine.
The second one, I'm not sure it's really good and/or informative. It doesn't
really matter that the symbol has no type *if* the link already failed because
it's undefined.
IMHO, once we emit a diag for undefined we're already in an unrecoverable state
and we should not emit other (unrelated) diagnostics for that symbol.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171008/ca6bdbb8/attachment.html>


More information about the llvm-bugs mailing list