There is a bug in lld which on some occasions causes InputFile::ArchiveName to store incorrect value. This happens because library name allocated on stack then converted to StringRef and assigned to member variable.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I think a better approach would be to change the type of ArchiveName from StringRef to std::string. This patch may fix the issue, but I'm not 100% sure because it fixes only one path that can reach addFile function. There might be some other places at which we pass on-stack objects to the function.
Comment Actions
LGTM
test/ELF/whole-archive-name.s | ||
---|---|---|
9 | I think you can remove test/ELF/Inputs/whole-archive-name.s because you only need single .s file. Since --whole-archive links everything, you don't need to pass any .o file. I.e. you can just pass an .a file. |
I think you can remove test/ELF/Inputs/whole-archive-name.s because you only need single .s file. Since --whole-archive links everything, you don't need to pass any .o file. I.e. you can just pass an .a file.