GetDLLSuffix: Remove the leading dot from LTDL_SHLIB_EXT.
This allows using GetDLLSuffix() with appendSuffix().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118051 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Linker/Linker.cpp b/lib/Linker/Linker.cpp
index eb3fb6b..19ecaa3 100644
--- a/lib/Linker/Linker.cpp
+++ b/lib/Linker/Linker.cpp
@@ -133,7 +133,7 @@
// Try the libX.so (or .dylib) form
FullPath.eraseSuffix();
- FullPath.appendSuffix(&(LTDL_SHLIB_EXT[1]));
+ FullPath.appendSuffix(sys::Path::GetDLLSuffix());
if (FullPath.isDynamicLibrary()) // Native shared library?
return FullPath;
if (FullPath.isBitcodeFile()) // .so file containing bitcode?
diff --git a/lib/System/Path.cpp b/lib/System/Path.cpp
index ae166a5..8fc4153 100644
--- a/lib/System/Path.cpp
+++ b/lib/System/Path.cpp
@@ -192,7 +192,7 @@
}
StringRef Path::GetDLLSuffix() {
- return LTDL_SHLIB_EXT;
+ return &(LTDL_SHLIB_EXT[1]);
}
bool
diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp
index 9277554..a28592b 100644
--- a/tools/llvm-ld/llvm-ld.cpp
+++ b/tools/llvm-ld/llvm-ld.cpp
@@ -455,7 +455,7 @@
E = LibPaths.end(); P != E; ++P) {
FullLibraryPath = *P;
FullLibraryPath.appendComponent("lib" + *i);
- FullLibraryPath.appendSuffix(&(LTDL_SHLIB_EXT[1]));
+ FullLibraryPath.appendSuffix(sys::Path::GetDLLSuffix());
if (!FullLibraryPath.isEmpty()) {
if (!FullLibraryPath.isDynamicLibrary()) {
// Not a native shared library; mark as invalid