Skip to content

[LLD][COFF] Use parentName for import files in toString. #106104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lld/COFF/InputFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static StringRef getBasename(StringRef path) {
std::string lld::toString(const coff::InputFile *file) {
if (!file)
return "<internal>";
if (file->parentName.empty() || file->kind() == coff::InputFile::ImportKind)
if (file->parentName.empty())
return std::string(file->getName());

return (getBasename(file->parentName) + "(" + getBasename(file->getName()) +
Expand Down
2 changes: 1 addition & 1 deletion lld/test/COFF/delayimports-error.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# RUN: /alternatename:__delayLoadHelper2=main /opt:noref >& %t.log
# RUN: FileCheck %s < %t.log

# CHECK: cannot delay-load foo.dll due to import of data: __declspec(dllimport) datasym
# CHECK: cannot delay-load foo.lib(foo.dll) due to import of data: __declspec(dllimport) datasym

--- !COFF
header:
Expand Down
2 changes: 1 addition & 1 deletion lld/test/COFF/duplicate.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ RUN: not lld-link /out:gamma.exe /subsystem:console /entry:mainCRTStartup gamma.

CHECK-GAMMA: error: duplicate symbol: __declspec(dllimport) f
CHECK-GAMMA: defined at {{.*}}gamma.obj
CHECK-GAMMA: defined at alpha.dll
CHECK-GAMMA: defined at alpha.lib(alpha.dll)

4 changes: 2 additions & 2 deletions lld/test/COFF/implib-machine.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
# RUN: llvm-mc -triple x86_64-windows-msvc %t.dir/test.s -filetype=obj -o %t.dir/test64.obj

# RUN: not lld-link -dll -noentry -out:%t32.dll %t.dir/test32.obj %t.dir/test64.lib 2>&1 | FileCheck --check-prefix=ERR32 %s
# ERR32: error: test.dll: machine type x64 conflicts with x86
# ERR32: error: test64.lib(test.dll): machine type x64 conflicts with x86

# RUN: not lld-link -dll -noentry -out:%t64.dll %t.dir/test64.obj %t.dir/test32.lib 2>&1 | FileCheck --check-prefix=ERR64 %s
# ERR64: error: test.dll: machine type x86 conflicts with x64
# ERR64: error: test32.lib(test.dll): machine type x86 conflicts with x64

#--- test.s
.def @feat.00;
Expand Down
Loading