aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-10-14 02:52:13 +0000
committerIan Lance Taylor <iant@google.com>2007-10-14 02:52:13 +0000
commit4eff2974c2948d23a81afd4e4d025fc2561d7491 (patch)
tree28c7b643db2b7474c0bdd6cb282bdc2e457694c6
parent8acdf0bf43d6fd7f1763aebdf46037d52f599811 (diff)
downloadgdb-4eff2974c2948d23a81afd4e4d025fc2561d7491.zip
gdb-4eff2974c2948d23a81afd4e4d025fc2561d7491.tar.gz
gdb-4eff2974c2948d23a81afd4e4d025fc2561d7491.tar.bz2
From Craig Silverstein: error if we see a dynamic object when the
-static option was given.
-rw-r--r--gold/gold.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/gold/gold.cc b/gold/gold.cc
index 5c8ce50..97e5d3d 100644
--- a/gold/gold.cc
+++ b/gold/gold.cc
@@ -161,7 +161,15 @@ queue_middle_tasks(const General_options& options,
Workqueue* workqueue)
{
// Now we have seen all the input files.
- set_parameters_doing_static_link(!input_objects->any_dynamic());
+ const bool doing_static_link = !input_objects->any_dynamic();
+ set_parameters_doing_static_link(doing_static_link);
+ if (!doing_static_link && options.is_static())
+ {
+ // We print out just the first .so we see; there may be others.
+ fprintf(stderr, _("%s: cannot mix -static with dynamic object %s\n"),
+ program_name, (*input_objects->dynobj_begin())->name().c_str());
+ gold_exit(false);
+ }
// Define some sections and symbols needed for a dynamic link. This
// handles some cases we want to see before we read the relocs.