aboutsummaryrefslogtreecommitdiff
path: root/gold/fileread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/fileread.cc')
-rw-r--r--gold/fileread.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gold/fileread.cc b/gold/fileread.cc
index 00971a7..43c69b3 100644
--- a/gold/fileread.cc
+++ b/gold/fileread.cc
@@ -314,9 +314,13 @@ 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())
- n2 = n1 + ".so";
- n1 += ".a";
+ if (options.is_static())
+ n1 += ".a";
+ else
+ {
+ n2 = n1 + ".a";
+ n1 += ".so";
+ }
name = dirpath.find(n1, n2);
if (name.empty())
{