aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.h
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2011-06-08 04:05:25 +0000
committerCary Coutant <ccoutant@google.com>2011-06-08 04:05:25 +0000
commit5146f4485680b0029143c2e17bf5393dd4b89792 (patch)
tree8f95099e332a5f4d6183d8673536c96e1b8d0897 /gold/symtab.h
parent26d3c67de1d0e6434dabb908e5a6fa002f5b1db8 (diff)
downloadgdb-5146f4485680b0029143c2e17bf5393dd4b89792.zip
gdb-5146f4485680b0029143c2e17bf5393dd4b89792.tar.gz
gdb-5146f4485680b0029143c2e17bf5393dd4b89792.tar.bz2
* common.cc (Symbol_table::do_allocate_commons_list): For incremental
update, allocate common from bss section's free list. * incremental-dump.cc (dump_incremental_inputs): Print flag for linker-defined symbols. * incremental.cc (Sized_incremental_binary::do_process_got_plt): Skip GOT and PLT entries that are no longer referenced. (Output_section_incremental_inputs::write_info_blocks): Mark linker-defined symbols. (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols. * output.cc (Output_section::allocate): New function. * output.h (Output_section::allocate): New function. * resolve.cc (Symbol_table::report_resolve_problem): Add case for linker-defined symbols. (Symbol::override_base_with_special): Copy is_predefined_ flag. * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag. (Symbol::init_base_output_data): Likewise. (Symbol::init_base_output_segment): Likewise. (Symbol::init_base_constant): Likewise. (Sized_symbol::init_output_data): Likewise. (Sized_symbol::init_output_segment): Likewise. (Sized_symbol::init_constant): Likewise. (Symbol_table::do_define_in_output_data): Likewise. (Symbol_table::do_define_in_output_segment): Likewise. (Symbol_table::do_define_as_constant): Likewise. * symtab.h (Symbol::is_predefined): New function. (Symbol::init_base_output_data): Add is_predefined parameter. (Symbol::init_base_output_segment): Likewise. (Symbol::init_base_constant): Likewise. (Symbol::is_predefined_): New data member. (Sized_symbol::init_output_data): Add is_predefined parameter. (Sized_symbol::init_output_segment): Likewise. (Sized_symbol::init_constant): Likewise. (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
Diffstat (limited to 'gold/symtab.h')
-rw-r--r--gold/symtab.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/gold/symtab.h b/gold/symtab.h
index 43e3efa..51c31d5 100644
--- a/gold/symtab.h
+++ b/gold/symtab.h
@@ -803,6 +803,11 @@ class Symbol
&& !this->is_func());
}
+ // Return true if this symbol was predefined by the linker.
+ bool
+ is_predefined() const
+ { return this->is_predefined_; }
+
protected:
// Instances of this class should always be created at a specific
// size.
@@ -828,7 +833,8 @@ class Symbol
void
init_base_output_data(const char* name, const char* version, Output_data*,
elfcpp::STT, elfcpp::STB, elfcpp::STV,
- unsigned char nonvis, bool offset_is_from_end);
+ unsigned char nonvis, bool offset_is_from_end,
+ bool is_predefined);
// Initialize fields for an Output_segment.
void
@@ -836,13 +842,14 @@ class Symbol
Output_segment* os, elfcpp::STT type,
elfcpp::STB binding, elfcpp::STV visibility,
unsigned char nonvis,
- Segment_offset_base offset_base);
+ Segment_offset_base offset_base,
+ bool is_predefined);
// Initialize fields for a constant.
void
init_base_constant(const char* name, const char* version, elfcpp::STT type,
elfcpp::STB binding, elfcpp::STV visibility,
- unsigned char nonvis);
+ unsigned char nonvis, bool is_predefined);
// Initialize fields for an undefined symbol.
void
@@ -991,6 +998,8 @@ class Symbol
// True if this symbol was a weak undef resolved by a dynamic def
// (bit 33).
bool undef_binding_weak_ : 1;
+ // True if this symbol is a predefined linker symbol (bit 34).
+ bool is_predefined_ : 1;
};
// The parts of a symbol which are size specific. Using a template
@@ -1020,20 +1029,20 @@ class Sized_symbol : public Symbol
init_output_data(const char* name, const char* version, Output_data*,
Value_type value, Size_type symsize, elfcpp::STT,
elfcpp::STB, elfcpp::STV, unsigned char nonvis,
- bool offset_is_from_end);
+ bool offset_is_from_end, bool is_predefined);
// Initialize fields for an Output_segment.
void
init_output_segment(const char* name, const char* version, Output_segment*,
Value_type value, Size_type symsize, elfcpp::STT,
elfcpp::STB, elfcpp::STV, unsigned char nonvis,
- Segment_offset_base offset_base);
+ Segment_offset_base offset_base, bool is_predefined);
// Initialize fields for a constant.
void
init_constant(const char* name, const char* version, Value_type value,
Size_type symsize, elfcpp::STT, elfcpp::STB, elfcpp::STV,
- unsigned char nonvis);
+ unsigned char nonvis, bool is_predefined);
// Initialize fields for an undefined symbol.
void
@@ -1250,6 +1259,9 @@ class Symbol_table
SCRIPT,
// Predefined by the linker.
PREDEFINED,
+ // Defined by the linker during an incremental base link, but not
+ // a predefined symbol (e.g., common, defined in script).
+ INCREMENTAL_BASE,
};
// The order in which we sort common symbols.