aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <respindola@mozilla.com>2010-05-18 18:08:03 +0000
committerRafael Ávila de Espíndola <respindola@mozilla.com>2010-05-18 18:08:03 +0000
commit91e75c8a9c3b92c1699a156890fc97587bc17098 (patch)
treea2f77d1f1165c7a5f6a78c260bd9be3bc42eb840 /gold
parentbd7b51b4c67b4b655e4783945b2828bec39c6721 (diff)
downloadfsf-binutils-gdb-91e75c8a9c3b92c1699a156890fc97587bc17098.zip
fsf-binutils-gdb-91e75c8a9c3b92c1699a156890fc97587bc17098.tar.gz
fsf-binutils-gdb-91e75c8a9c3b92c1699a156890fc97587bc17098.tar.bz2
2010-05-18 Rafael Espindola <espindola@google.com>
* options.cc (General_options::finalize): Handle -nostdlib. * options.h (nostdlib): New option. * script.cc (script_add_search_dir): Handle -nostdlib.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/options.cc2
-rw-r--r--gold/options.h4
-rw-r--r--gold/script.cc2
4 files changed, 12 insertions, 2 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 71bbf2a..1085875 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-18 Rafael Espindola <espindola@google.com>
+
+ * options.cc (General_options::finalize): Handle -nostdlib.
+ * options.h (nostdlib): New option.
+ * script.cc (script_add_search_dir): Handle -nostdlib.
+
2010-05-12 Doug Kwan <dougkwan@google.com>
* arm.cc (Target_arm::do_finalize_sections): Create an empty
diff --git a/gold/options.cc b/gold/options.cc
index c566b99..b209f85 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -1074,7 +1074,7 @@ General_options::finalize()
}
while (next_pos != std::string::npos);
}
- else
+ else if (!this->nostdlib())
{
// Even if they don't specify it, we add -L /lib and -L /usr/lib.
// FIXME: We should only do this when configured in native mode.
diff --git a/gold/options.h b/gold/options.h
index ca5f74d..1e328a8 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -800,6 +800,10 @@ class General_options
DEFINE_dirlist(library_path, options::TWO_DASHES, 'L',
N_("Add directory to search path"), N_("DIR"));
+ DEFINE_bool(nostdlib, options::ONE_DASH, '\0', false,
+ N_(" Only search directories specified on the command line."),
+ NULL);
+
DEFINE_string(m, options::EXACTLY_ONE_DASH, 'm', "",
N_("Ignored for compatibility"), N_("EMULATION"));
diff --git a/gold/script.cc b/gold/script.cc
index a68fb38..fc036bb 100644
--- a/gold/script.cc
+++ b/gold/script.cc
@@ -2767,7 +2767,7 @@ script_add_search_dir(void* closurev, const char* option, size_t length)
gold_warning(_("%s:%d:%d: ignoring SEARCH_DIR; SEARCH_DIR is only valid"
" for scripts specified via -T/--script"),
closure->filename(), closure->lineno(), closure->charpos());
- else
+ else if (!closure->command_line()->options().nostdlib())
{
std::string s = "-L" + std::string(option, length);
script_parse_option(closurev, s.c_str(), s.size());