aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-12-29 00:31:48 +0000
committerIan Lance Taylor <ian@airs.com>2009-12-29 00:31:48 +0000
commit99fff23b2e6c675a1f35bf3ba853f70e2b7b4ce8 (patch)
tree92848f4ad9c4ecda89665d7abdfe31915888a7a2 /gold/symtab.cc
parentfa618ee47d7276a7de1f0d783ea3b4c33ac10993 (diff)
downloadgdb-99fff23b2e6c675a1f35bf3ba853f70e2b7b4ce8.zip
gdb-99fff23b2e6c675a1f35bf3ba853f70e2b7b4ce8.tar.gz
gdb-99fff23b2e6c675a1f35bf3ba853f70e2b7b4ce8.tar.bz2
* symtab.h (class Symbol_table): Add enum Defined.
* resolve.cc (Symbol_table::should_override): Add defined parameter. Change all callers. Test whether object is NULL before calling a method on it. (Symbol_table::report_resolve_problem): Add defined parameter. Change all callers. (Symbol_table::should_override_with_special): Likewise. * symtab.cc (Symbol_table::define_in_output_data): Add defined parameter. Change all callers. (Symbol_table::do_define_in_output_data): Likewise. (Symbol_table::define_in_output_segment): Likewise. (Symbol_table::do_define_in_output_segment): Likewise. (Symbol_table::define_as_constant): Likewise. (Symbol_table::do_define_as_constant): Likewise. * script.h (class Symbol_assignment): Add is_defsym parameter to constructor; change all callers. * script.cc (Script_options::add_symbol_assignment): Add is_defsym parameter. Change all callers. Add is_defsym_ field. (class Parser_closure): Add parsing_defsym parameter to constructor; change all callers. Add parsing_defsym accessor function. Add parsing_defsym_ field.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc42
1 files changed, 25 insertions, 17 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index 8cd4a40..d8461a7 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -1686,6 +1686,7 @@ Symbol_table::define_special_symbol(const char** pname, const char** pversion,
Symbol*
Symbol_table::define_in_output_data(const char* name,
const char* version,
+ Defined defined,
Output_data* od,
uint64_t value,
uint64_t symsize,
@@ -1699,7 +1700,7 @@ Symbol_table::define_in_output_data(const char* name,
if (parameters->target().get_size() == 32)
{
#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG)
- return this->do_define_in_output_data<32>(name, version, od,
+ return this->do_define_in_output_data<32>(name, version, defined, od,
value, symsize, type, binding,
visibility, nonvis,
offset_is_from_end,
@@ -1711,7 +1712,7 @@ Symbol_table::define_in_output_data(const char* name,
else if (parameters->target().get_size() == 64)
{
#if defined(HAVE_TARGET_64_LITTLE) || defined(HAVE_TARGET_64_BIG)
- return this->do_define_in_output_data<64>(name, version, od,
+ return this->do_define_in_output_data<64>(name, version, defined, od,
value, symsize, type, binding,
visibility, nonvis,
offset_is_from_end,
@@ -1731,6 +1732,7 @@ Sized_symbol<size>*
Symbol_table::do_define_in_output_data(
const char* name,
const char* version,
+ Defined defined,
Output_data* od,
typename elfcpp::Elf_types<size>::Elf_Addr value,
typename elfcpp::Elf_types<size>::Elf_WXword symsize,
@@ -1782,7 +1784,7 @@ Symbol_table::do_define_in_output_data(
return sym;
}
- if (Symbol_table::should_override_with_special(oldsym))
+ if (Symbol_table::should_override_with_special(oldsym, defined))
this->override_with_special(oldsym, sym);
if (resolve_oldsym)
@@ -1798,7 +1800,9 @@ Symbol_table::do_define_in_output_data(
Symbol*
Symbol_table::define_in_output_segment(const char* name,
- const char* version, Output_segment* os,
+ const char* version,
+ Defined defined,
+ Output_segment* os,
uint64_t value,
uint64_t symsize,
elfcpp::STT type,
@@ -1811,7 +1815,7 @@ Symbol_table::define_in_output_segment(const char* name,
if (parameters->target().get_size() == 32)
{
#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG)
- return this->do_define_in_output_segment<32>(name, version, os,
+ return this->do_define_in_output_segment<32>(name, version, defined, os,
value, symsize, type,
binding, visibility, nonvis,
offset_base, only_if_ref);
@@ -1822,7 +1826,7 @@ Symbol_table::define_in_output_segment(const char* name,
else if (parameters->target().get_size() == 64)
{
#if defined(HAVE_TARGET_64_LITTLE) || defined(HAVE_TARGET_64_BIG)
- return this->do_define_in_output_segment<64>(name, version, os,
+ return this->do_define_in_output_segment<64>(name, version, defined, os,
value, symsize, type,
binding, visibility, nonvis,
offset_base, only_if_ref);
@@ -1841,6 +1845,7 @@ Sized_symbol<size>*
Symbol_table::do_define_in_output_segment(
const char* name,
const char* version,
+ Defined defined,
Output_segment* os,
typename elfcpp::Elf_types<size>::Elf_Addr value,
typename elfcpp::Elf_types<size>::Elf_WXword symsize,
@@ -1892,7 +1897,7 @@ Symbol_table::do_define_in_output_segment(
return sym;
}
- if (Symbol_table::should_override_with_special(oldsym))
+ if (Symbol_table::should_override_with_special(oldsym, defined))
this->override_with_special(oldsym, sym);
if (resolve_oldsym)
@@ -1910,6 +1915,7 @@ Symbol_table::do_define_in_output_segment(
Symbol*
Symbol_table::define_as_constant(const char* name,
const char* version,
+ Defined defined,
uint64_t value,
uint64_t symsize,
elfcpp::STT type,
@@ -1922,7 +1928,7 @@ Symbol_table::define_as_constant(const char* name,
if (parameters->target().get_size() == 32)
{
#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_32_BIG)
- return this->do_define_as_constant<32>(name, version, value,
+ return this->do_define_as_constant<32>(name, version, defined, value,
symsize, type, binding,
visibility, nonvis, only_if_ref,
force_override);
@@ -1933,7 +1939,7 @@ Symbol_table::define_as_constant(const char* name,
else if (parameters->target().get_size() == 64)
{
#if defined(HAVE_TARGET_64_LITTLE) || defined(HAVE_TARGET_64_BIG)
- return this->do_define_as_constant<64>(name, version, value,
+ return this->do_define_as_constant<64>(name, version, defined, value,
symsize, type, binding,
visibility, nonvis, only_if_ref,
force_override);
@@ -1952,6 +1958,7 @@ Sized_symbol<size>*
Symbol_table::do_define_as_constant(
const char* name,
const char* version,
+ Defined defined,
typename elfcpp::Elf_types<size>::Elf_Addr value,
typename elfcpp::Elf_types<size>::Elf_WXword symsize,
elfcpp::STT type,
@@ -2008,7 +2015,8 @@ Symbol_table::do_define_as_constant(
return sym;
}
- if (force_override || Symbol_table::should_override_with_special(oldsym))
+ if (force_override
+ || Symbol_table::should_override_with_special(oldsym, defined))
this->override_with_special(oldsym, sym);
if (resolve_oldsym)
@@ -2031,14 +2039,14 @@ Symbol_table::define_symbols(const Layout* layout, int count,
{
Output_section* os = layout->find_output_section(p->output_section);
if (os != NULL)
- this->define_in_output_data(p->name, NULL, os, p->value,
+ this->define_in_output_data(p->name, NULL, PREDEFINED, os, p->value,
p->size, p->type, p->binding,
p->visibility, p->nonvis,
p->offset_is_from_end,
only_if_ref || p->only_if_ref);
else
- this->define_as_constant(p->name, NULL, 0, p->size, p->type,
- p->binding, p->visibility, p->nonvis,
+ this->define_as_constant(p->name, NULL, PREDEFINED, 0, p->size,
+ p->type, p->binding, p->visibility, p->nonvis,
only_if_ref || p->only_if_ref,
false);
}
@@ -2057,14 +2065,14 @@ Symbol_table::define_symbols(const Layout* layout, int count,
p->segment_flags_set,
p->segment_flags_clear);
if (os != NULL)
- this->define_in_output_segment(p->name, NULL, os, p->value,
+ this->define_in_output_segment(p->name, NULL, PREDEFINED, os, p->value,
p->size, p->type, p->binding,
p->visibility, p->nonvis,
p->offset_base,
only_if_ref || p->only_if_ref);
else
- this->define_as_constant(p->name, NULL, 0, p->size, p->type,
- p->binding, p->visibility, p->nonvis,
+ this->define_as_constant(p->name, NULL, PREDEFINED, 0, p->size,
+ p->type, p->binding, p->visibility, p->nonvis,
only_if_ref || p->only_if_ref,
false);
}
@@ -2093,7 +2101,7 @@ Symbol_table::define_with_copy_reloc(
if (binding == elfcpp::STB_WEAK)
binding = elfcpp::STB_GLOBAL;
- this->define_in_output_data(csym->name(), csym->version(),
+ this->define_in_output_data(csym->name(), csym->version(), COPY,
posd, value, csym->symsize(),
csym->type(), binding,
csym->visibility(), csym->nonvis(),