diff options
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 14 | ||||
-rw-r--r-- | lld/test/ELF/linkerscript.s | 7 |
2 files changed, 3 insertions, 18 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index e04785b5bac..d222bb9ef0c 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -28,8 +28,8 @@ using namespace lld::elf2; namespace { class LinkerScript { public: - LinkerScript(BumpPtrAllocator *A, StringRef S, bool B) - : Saver(*A), Tokens(tokenize(S)), IsUnderSysroot(B) {} + LinkerScript(BumpPtrAllocator *A, StringRef S) + : Saver(*A), Tokens(tokenize(S)) {} void run(); private: @@ -58,7 +58,6 @@ private: StringSaver Saver; std::vector<StringRef> Tokens; size_t Pos = 0; - bool IsUnderSysroot; }; } @@ -162,12 +161,6 @@ void LinkerScript::expect(StringRef Expect) { void LinkerScript::addFile(StringRef S) { if (sys::path::is_absolute(S)) { - if (IsUnderSysroot) { - SmallString<128> Path; - (Config->Sysroot + S).toStringRef(Path); - if (sys::fs::exists(Path)) - S = Saver.save(Path.str()); - } Driver->addFile(S); } else if (S.startswith("=")) { if (Config->Sysroot.empty()) @@ -308,6 +301,5 @@ static bool isUnderSysroot(StringRef Path) { // Entry point. The other functions or classes are private to this file. void lld::elf2::readLinkerScript(BumpPtrAllocator *A, MemoryBufferRef MB) { - StringRef Path = MB.getBufferIdentifier(); - LinkerScript(A, MB.getBuffer(), isUnderSysroot(Path)).run(); + LinkerScript(A, MB.getBuffer()).run(); } diff --git a/lld/test/ELF/linkerscript.s b/lld/test/ELF/linkerscript.s index bff285b9761..0e845b2bd79 100644 --- a/lld/test/ELF/linkerscript.s +++ b/lld/test/ELF/linkerscript.s @@ -38,13 +38,6 @@ # RUN: ld.lld -o %t2 %t.script -L%t.dir # RUN: llvm-readobj %t2 > /dev/null -# RUN: echo "GROUP(" %t /libxyz.a ")" > %t.script -# RUN: echo "GROUP(" %t /libxyz.a ")" > %t.dir/xyz.script -# RUN: not ld.lld -o %t2 %t.script -# RUN: not ld.lld -o %t2 %t.script --sysroot=%t.dir -# RUN: ld.lld -o %t2 %t.dir/xyz.script --sysroot=%t.dir -# RUN: llvm-readobj %t2 > /dev/null - # RUN: echo "GROUP(" %t.script2 ")" > %t.script1 # RUN: echo "GROUP(" %t ")" > %t.script2 # RUN: ld.lld -o %t2 %t.script1 |