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

            Bug ID: 40770
           Summary: lld error message for undefined symbol lacks
                    information about visibility
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: mh+l...@glandium.org
                CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org

```
$ cat foo.c
__attribute__((visibility("hidden"))) void* getdate(char*);

void* foo(char* s) {
    return getdate(s);
}
$ clang -fuse-ld=lld -shared -fPIC foo.c -o foo.so 
ld.lld: error: undefined symbol: getdate
>>> referenced by foo.c
>>>               /tmp/foo-717a38.o:(foo)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

GNU ld.bfd and gold both report the fact the symbol is hidden in their error
message:
```
$ clang-7 -fuse-ld=ld -shared -fPIC foo.c -o foo.so 
/usr/bin/ld: /tmp/foo-8f3391.o: in function `foo':
foo.c:(.text+0x11): undefined reference to `getdate'
/usr/bin/ld: foo.so: hidden symbol `getdate' isn't defined
/usr/bin/ld: final link failed: bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ LANG=C clang-7 -fuse-ld=gold -shared -fPIC foo.c -o foo.so 
/usr/bin/ld.gold: error: hidden symbol 'getdate' is not defined locally
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to