summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Config.h1
-rw-r--r--lld/ELF/Driver.cpp12
-rw-r--r--lld/ELF/LinkerScript.cpp4
-rw-r--r--lld/ELF/Options.td3
-rw-r--r--lld/test/ELF/Inputs/nostdlib.s3
-rw-r--r--lld/test/ELF/nostdlib.s16
6 files changed, 4 insertions, 35 deletions
diff --git a/lld/ELF/Config.h b/lld/ELF/Config.h
index 7b58008ae43..47f21fa68ba 100644
--- a/lld/ELF/Config.h
+++ b/lld/ELF/Config.h
@@ -67,7 +67,6 @@ struct Configuration {
bool Mips64EL = false;
bool NoUndefined;
bool NoinhibitExec;
- bool Nostdlib;
bool PrintGcSections;
bool Relocatable;
bool Shared;
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index d49d2016242..c4773d8b02d 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -207,6 +207,9 @@ void LinkerDriver::main(ArrayRef<const char *> ArgsArr) {
// Initializes Config members by the command line options.
void LinkerDriver::readConfigs(opt::InputArgList &Args) {
+ for (auto *Arg : Args.filtered(OPT_L))
+ Config->SearchPaths.push_back(Arg->getValue());
+
std::vector<StringRef> RPaths;
for (auto *Arg : Args.filtered(OPT_rpath))
RPaths.push_back(Arg->getValue());
@@ -234,7 +237,6 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) {
Config->ICF = Args.hasArg(OPT_icf);
Config->NoUndefined = Args.hasArg(OPT_no_undefined);
Config->NoinhibitExec = Args.hasArg(OPT_noinhibit_exec);
- Config->Nostdlib = Args.hasArg(OPT_nostdlib);
Config->PrintGcSections = Args.hasArg(OPT_print_gc_sections);
Config->Relocatable = Args.hasArg(OPT_relocatable);
Config->Shared = Args.hasArg(OPT_shared);
@@ -277,14 +279,6 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) {
for (auto *Arg : Args.filtered(OPT_undefined))
Config->Undefined.push_back(Arg->getValue());
-
- if (!Config->Nostdlib) {
- Config->SearchPaths.push_back("=/lib");
- Config->SearchPaths.push_back("=/usr/lib");
- }
-
- for (auto *Arg : Args.filtered(OPT_L))
- Config->SearchPaths.push_back(Arg->getValue());
}
void LinkerDriver::createFiles(opt::InputArgList &Args) {
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index f9ab4dbf1ca..b4580b5fe7c 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -396,9 +396,7 @@ void ScriptParser::readOutputFormat() {
void ScriptParser::readSearchDir() {
expect("(");
- StringRef Path = next();
- if (!Config->Nostdlib)
- Config->SearchPaths.push_back(Path);
+ Config->SearchPaths.push_back(next());
expect(")");
}
diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td
index 46a81f0f034..99a208080a1 100644
--- a/lld/ELF/Options.td
+++ b/lld/ELF/Options.td
@@ -91,9 +91,6 @@ def noinhibit_exec : Flag<["--"], "noinhibit-exec">,
def no_undefined : Flag<["--"], "no-undefined">,
HelpText<"Report unresolved symbols even if the linker is creating a shared library">;
-def nostdlib: Flag<["-", "--"], "nostdlib">,
- HelpText<"Only search directories specified on the command line">;
-
def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
HelpText<"Path to file to write output">;
diff --git a/lld/test/ELF/Inputs/nostdlib.s b/lld/test/ELF/Inputs/nostdlib.s
deleted file mode 100644
index db41c9ccd41..00000000000
--- a/lld/test/ELF/Inputs/nostdlib.s
+++ /dev/null
@@ -1,3 +0,0 @@
-.globl foo
-foo:
- ret
diff --git a/lld/test/ELF/nostdlib.s b/lld/test/ELF/nostdlib.s
deleted file mode 100644
index f2c45dad0b9..00000000000
--- a/lld/test/ELF/nostdlib.s
+++ /dev/null
@@ -1,16 +0,0 @@
-# REQUIRES: x86
-
-# RUN: mkdir -p %t.dir/lib
-# RUN: mkdir -p %t.dir/usr/lib
-# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
-# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/nostdlib.s -o %t2.o
-# RUN: ld.lld -shared -o %t.dir/lib/libfoo.so %t2.o
-# RUN: ld.lld -shared -o %t.dir/usr/lib/libbar.so %t2.o
-# RUN: ld.lld --sysroot=%t.dir -o %t %t1.o -lfoo
-# RUN: ld.lld --sysroot=%t.dir -o %t %t1.o -lbar
-# RUN: not ld.lld --sysroot=%t.dir -nostdlib -o %t %t1.o -lfoo
-# RUN: not ld.lld --sysroot=%t.dir -nostdlib -o %t %t1.o -lbar
-
-.globl _start
-_start:
- ret
OpenPOWER on IntegriCloud