| Issue |
159669
|
| Summary |
[lld] Alternate name referring another alternate name is not resolved
|
| Labels |
lld
|
| Assignees |
|
| Reporter |
vahur
|
Steps to reproduce on Windows:
test.c
```
#pragma comment(linker, "/alternatename:x=y")
#pragma comment(linker, "/alternatename:y=puts")
extern int x(const char *str);
int main(void) {
x("Hello");
return 0;
}
```
Compile and link:
```
clang-cl /c test.c
lld-link /OUT:test.exe /SUBSYSTEM:console test.obj
```
It works with lld-link <=20 and MS link.exe, but fails with lld-link 21.1.1:
```
lld-link: error: undefined symbol: x
>>> referenced by test.obj:(main)
```
I think it's caused by this commit: https://github.com/llvm/llvm-project/commit/ac31d64a64e8a648f6834f4cf9de10c56c8d1083. If I roll back that commit for SymbolTable.cpp, linking succeeds again.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs