summaryrefslogtreecommitdiff
path: root/gold/resolve.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-05-07 06:08:01 +0000
committerIan Lance Taylor <ian@airs.com>2008-05-07 06:08:01 +0000
commitf3e9c5c5170afd576cb1c31464472587aba05f52 (patch)
tree86f9b846be987b04ad87320629f7d316fc6c0779 /gold/resolve.cc
parentb26238c07d9f3f8d617d53b44869d76a7cdaa563 (diff)
PR 6049
* options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end functions. (class General_options): Remove existing --undefined, and add --no-undefined instead. Add new --undefined as synonym for -u. * archive.cc (Archive::add_symbols): Check whether symbol was named with -u. * gold.cc (queue_middle_tasks): Add -u symbols to symbol table. * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change all uses. Add IS_UNDEFINED. Update declarations to split different versions of init_base. Declare init_base_undefined. (Symbol::is_defined): Handle IS_UNDEFINED. (Symbol::is_undefined): Likewise. (Symbol::is_weak_undefined): Call is_undefined. (Symbol::is_absolute): Handle IS_CONSTANT. (class Sized_symbol): Update declarations to split different versions of init. Declare init_undefined. (class Symbol_table): Declare new functions. * symtab.cc (Symbol::init_base_object): Rename from init_base. Change all callers. (Symbol::init_base_output_data): Likewise. (Symbol::init_base_output_segment): Likewise. (Symbol::init_base_constant): Likewise. (Symbol::init_base_undefined): New function. (Sized_symbol::init_object): Rename from init. Change all callers. (Sized_symbol::init_output_data): Likewise. (Sized_symbol::init_output_segment): Likewise. (Sized_symbol::init_constant): Likewise. (Sized_symbol::init_undefined): New function. (Symbol_table::add_undefined_symbols_from_command_line): New function. (Symbol_table::do_add_undefined_symbols_from_command_line): New function. (Symbol::final_value_is_known): Handle IS_UNDEFINED. (Symbol::output_section): Likewise. (Symbol::set_output_section): Likewise. (Symbol_table::sized_finalize_symbol): Likewise. (Symbol_table::sized_write_globals): Likewise. * resolve.cc (Symbol_table::should_override): Likewise. (Symbol::override_base_with_special): Likewise.
Diffstat (limited to 'gold/resolve.cc')
-rw-r--r--gold/resolve.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gold/resolve.cc b/gold/resolve.cc
index 21a7fc634f..291bca6967 100644
--- a/gold/resolve.cc
+++ b/gold/resolve.cc
@@ -281,7 +281,10 @@ Symbol_table::should_override(const Symbol* to, unsigned int frombits,
*adjust_common_sizes = false;
unsigned int tobits;
- if (to->source() != Symbol::FROM_OBJECT)
+ if (to->source() == Symbol::IS_UNDEFINED)
+ tobits = symbol_to_bits(to->binding(), false, elfcpp::SHN_UNDEF, true,
+ to->type());
+ else if (to->source() != Symbol::FROM_OBJECT)
tobits = symbol_to_bits(to->binding(), false, elfcpp::SHN_ABS, false,
to->type());
else
@@ -662,7 +665,8 @@ Symbol::override_base_with_special(const Symbol* from)
case IN_OUTPUT_SEGMENT:
this->u_.in_output_segment = from->u_.in_output_segment;
break;
- case CONSTANT:
+ case IS_CONSTANT:
+ case IS_UNDEFINED:
break;
default:
gold_unreachable();