From 4e1e25e084aa25b58cc1d6bd24d820af94d5af78 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Tue, 7 Oct 2008 23:40:21 +0000 Subject: [PATCH] * options.c (General_options::finalize): Add check for -static and -shared. * gold.cc (queue_middle_tasks): Assert that list of dynamic objects is not empty. --- gold/ChangeLog | 7 +++++++ gold/gold.cc | 1 + gold/options.cc | 3 +++ 3 files changed, 11 insertions(+) diff --git a/gold/ChangeLog b/gold/ChangeLog index 02a007caa31..e13fa981b5a 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,10 @@ +2008-10-07 Cary Coutant + + * options.c (General_options::finalize): Add check for -static and + -shared. + * gold.cc (queue_middle_tasks): Assert that list of dynamic objects + is not empty. + 2008-10-02 Cary Coutant * plugin.cc (make_sized_plugin_object): Fix conditional diff --git a/gold/gold.cc b/gold/gold.cc index 6a536b8c769..ac321be33fa 100644 --- a/gold/gold.cc +++ b/gold/gold.cc @@ -203,6 +203,7 @@ queue_middle_tasks(const General_options& options, if (!doing_static_link && options.is_static()) { // We print out just the first .so we see; there may be others. + gold_assert(input_objects->dynobj_begin() != input_objects->dynobj_end()); gold_error(_("cannot mix -static with dynamic object %s"), (*input_objects->dynobj_begin())->name().c_str()); } diff --git a/gold/options.cc b/gold/options.cc index 08b67fdf46b..069c138fcd2 100644 --- a/gold/options.cc +++ b/gold/options.cc @@ -792,6 +792,9 @@ General_options::finalize() this->add_sysroot(); // Now that we've normalized the options, check for contradictory ones. + if (this->shared() && this->is_static()) + gold_fatal(_("-shared and -static are incompatible")); + if (this->shared() && this->relocatable()) gold_fatal(_("-shared and -r are incompatible")); -- 2.30.2