aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-10-12 06:06:34 +0000
committerIan Lance Taylor <iant@google.com>2007-10-12 06:06:34 +0000
commitcfd73a4e26b2ff2a1bee75cf425a9ecffe0ce6cd (patch)
tree7f01e893f545165f30c1dbd3f5680a0b4e4a54cf /gold/symtab.cc
parent0ffd9845f2a947b9249296d3bc7a812bad1f7e07 (diff)
downloadfsf-binutils-gdb-cfd73a4e26b2ff2a1bee75cf425a9ecffe0ce6cd.zip
fsf-binutils-gdb-cfd73a4e26b2ff2a1bee75cf425a9ecffe0ce6cd.tar.gz
fsf-binutils-gdb-cfd73a4e26b2ff2a1bee75cf425a9ecffe0ce6cd.tar.bz2
Add an option for Stringpools to not copy strings.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index 5237b8c..00caed7 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -547,14 +547,14 @@ Symbol_table::add_from_relobj(
if (ver == NULL)
{
Stringpool::Key name_key;
- name = this->namepool_.add(name, &name_key);
+ name = this->namepool_.add(name, true, &name_key);
res = this->add_from_object(relobj, name, name_key, NULL, 0,
false, *psym);
}
else
{
Stringpool::Key name_key;
- name = this->namepool_.add(name, ver - name, &name_key);
+ name = this->namepool_.add_prefix(name, ver - name, &name_key);
bool def = false;
++ver;
@@ -565,7 +565,7 @@ Symbol_table::add_from_relobj(
}
Stringpool::Key ver_key;
- ver = this->namepool_.add(ver, &ver_key);
+ ver = this->namepool_.add(ver, true, &ver_key);
res = this->add_from_object(relobj, name, name_key, ver, ver_key,
def, *psym);
@@ -625,7 +625,7 @@ Symbol_table::add_from_dynobj(
if (versym == NULL)
{
Stringpool::Key name_key;
- name = this->namepool_.add(name, &name_key);
+ name = this->namepool_.add(name, true, &name_key);
this->add_from_object(dynobj, name, name_key, NULL, 0,
false, sym);
continue;
@@ -654,7 +654,7 @@ Symbol_table::add_from_dynobj(
// At this point we are definitely going to add this symbol.
Stringpool::Key name_key;
- name = this->namepool_.add(name, &name_key);
+ name = this->namepool_.add(name, true, &name_key);
if (v == static_cast<unsigned int>(elfcpp::VER_NDX_LOCAL)
|| v == static_cast<unsigned int>(elfcpp::VER_NDX_GLOBAL))
@@ -681,7 +681,7 @@ Symbol_table::add_from_dynobj(
}
Stringpool::Key version_key;
- version = this->namepool_.add(version, &version_key);
+ version = this->namepool_.add(version, true, &version_key);
// If this is an absolute symbol, and the version name and
// symbol name are the same, then this is the version definition
@@ -731,11 +731,11 @@ Symbol_table::define_special_symbol(const Target* target, const char** pname,
{
// Canonicalize NAME and VERSION.
Stringpool::Key name_key;
- *pname = this->namepool_.add(*pname, &name_key);
+ *pname = this->namepool_.add(*pname, true, &name_key);
Stringpool::Key version_key = 0;
if (*pversion != NULL)
- *pversion = this->namepool_.add(*pversion, &version_key);
+ *pversion = this->namepool_.add(*pversion, true, &version_key);
Symbol* const snull = NULL;
std::pair<typename Symbol_table_type::iterator, bool> ins =
@@ -1138,7 +1138,7 @@ Symbol_table::set_dynsym_indexes(const General_options* options,
sym->set_dynsym_index(index);
++index;
syms->push_back(sym);
- dynpool->add(sym->name(), NULL);
+ dynpool->add(sym->name(), false, NULL);
// Record any version information.
if (sym->version() != NULL)
@@ -1322,7 +1322,7 @@ Symbol_table::sized_finalize(unsigned index, off_t off, Stringpool* pool)
else
{
sym->set_symtab_index(index);
- pool->add(sym->name(), NULL);
+ pool->add(sym->name(), false, NULL);
++index;
off += sym_size;
}