aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-10-22 18:04:43 +0000
committerIan Lance Taylor <iant@google.com>2007-10-22 18:04:43 +0000
commit61611222588d1cd9c66c035a6b6dd61857d34653 (patch)
tree5197870414b18d9f14f77deccbec785caba07d6c
parentee6d2efee9fc57ed0be635dc0072bb8ba3891190 (diff)
downloadgdb-61611222588d1cd9c66c035a6b6dd61857d34653.zip
gdb-61611222588d1cd9c66c035a6b6dd61857d34653.tar.gz
gdb-61611222588d1cd9c66c035a6b6dd61857d34653.tar.bz2
Implement -Bstatic/-Bdynamic.
-rw-r--r--gold/fileread.cc3
-rw-r--r--gold/options.cc8
-rw-r--r--gold/options.h4
3 files changed, 12 insertions, 3 deletions
diff --git a/gold/fileread.cc b/gold/fileread.cc
index c4145de..1e3b463 100644
--- a/gold/fileread.cc
+++ b/gold/fileread.cc
@@ -428,7 +428,8 @@ Input_file::open(const General_options& options, const Dirsearch& dirpath)
std::string n1("lib");
n1 += this->input_argument_->name();
std::string n2;
- if (options.is_static())
+ if (options.is_static()
+ || this->input_argument_->options().do_static_search())
n1 += ".a";
else
{
diff --git a/gold/options.cc b/gold/options.cc
index 9513f15..4e74dce 100644
--- a/gold/options.cc
+++ b/gold/options.cc
@@ -312,6 +312,14 @@ options::Command_line_options::options[] =
POSDEP_NOARG('\0', "no-as-needed",
N_("Always DT_NEEDED for dynamic libs (default)"),
NULL, TWO_DASHES, &Position_dependent_options::clear_as_needed),
+ POSDEP_NOARG('\0', "Bdynamic",
+ N_("-l searches for shared libraries"),
+ NULL, ONE_DASH,
+ &Position_dependent_options::set_dynamic_search),
+ POSDEP_NOARG('\0', "Bstatic",
+ N_("-l does not search for shared libraries"),
+ NULL, ONE_DASH,
+ &Position_dependent_options::set_static_search),
GENERAL_NOARG('\0', "Bsymbolic", N_("Bind defined symbols locally"),
NULL, ONE_DASH, &General_options::set_symbolic),
GENERAL_NOARG('E', "export-dynamic", N_("Export all dynamic symbols"),
diff --git a/gold/options.h b/gold/options.h
index 701aa9c..f9782cc 100644
--- a/gold/options.h
+++ b/gold/options.h
@@ -397,8 +397,8 @@ class Position_dependent_options
public:
Position_dependent_options();
- // -Bstatic: Whether we are searching for a static archive rather
- // than a shared object.
+ // -Bdynamic/-Bstatic: Whether we are searching for a static archive
+ // -rather than a shared object.
bool
do_static_search() const
{ return this->do_static_search_; }