// dynobj.cc -- dynamic object support for gold
+// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Written by Ian Lance Taylor <iant@google.com>.
+
+// This file is part of gold.
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+// MA 02110-1301, USA.
+
#include "gold.h"
#include <vector>
#include <cstring>
#include "elfcpp.h"
+#include "parameters.h"
#include "symtab.h"
#include "dynobj.h"
{
if (!this->soname_.empty())
return this->soname_.c_str();
- return this->name().c_str();
+ return this->input_file()->found_name().c_str();
}
// Class Sized_dynobj.
continue;
if (*pi != -1U)
- {
- fprintf(stderr,
- _("%s: %s: unexpected duplicate type %u section: %u, %u\n"),
- program_name, this->name().c_str(), shdr.get_sh_type(),
- *pi, i);
- gold_exit(false);
- }
+ this->error(_("unexpected duplicate type %u section: %u, %u"),
+ shdr.get_sh_type(), *pi, i);
*pi = i;
}
gold_assert(shdr.get_sh_type() == type);
if (shdr.get_sh_link() != link)
- {
- fprintf(stderr,
- _("%s: %s: unexpected link in section %u header: %u != %u\n"),
- program_name, this->name().c_str(), shndx,
- shdr.get_sh_link(), link);
- gold_exit(false);
- }
+ this->error(_("unexpected link in section %u header: %u != %u"),
+ shndx, shdr.get_sh_link(), link);
- *view = this->get_lasting_view(shdr.get_sh_offset(), shdr.get_sh_size());
+ *view = this->get_lasting_view(shdr.get_sh_offset(), shdr.get_sh_size(),
+ false);
*view_size = shdr.get_sh_size();
*view_info = shdr.get_sh_info();
}
const off_t dynamic_size = dynamicshdr.get_sh_size();
const unsigned char* pdynamic = this->get_view(dynamicshdr.get_sh_offset(),
- dynamic_size);
+ dynamic_size, false);
const unsigned int link = dynamicshdr.get_sh_link();
if (link != strtab_shndx)
{
if (link >= this->shnum())
{
- fprintf(stderr,
- _("%s: %s: DYNAMIC section %u link out of range: %u\n"),
- program_name, this->name().c_str(),
- dynamic_shndx, link);
- gold_exit(false);
+ this->error(_("DYNAMIC section %u link out of range: %u"),
+ dynamic_shndx, link);
+ return;
}
typename This::Shdr strtabshdr(pshdrs + link * This::shdr_size);
if (strtabshdr.get_sh_type() != elfcpp::SHT_STRTAB)
{
- fprintf(stderr,
- _("%s: %s: DYNAMIC section %u link %u is not a strtab\n"),
- program_name, this->name().c_str(),
- dynamic_shndx, link);
- gold_exit(false);
+ this->error(_("DYNAMIC section %u link %u is not a strtab"),
+ dynamic_shndx, link);
+ return;
}
strtab_size = strtabshdr.get_sh_size();
- strtabu = this->get_view(strtabshdr.get_sh_offset(), strtab_size);
+ strtabu = this->get_view(strtabshdr.get_sh_offset(), strtab_size, false);
}
for (const unsigned char* p = pdynamic;
off_t val = dyn.get_d_val();
if (val >= strtab_size)
{
- fprintf(stderr,
- _("%s: %s: DT_SONAME value out of range: "
- "%lld >= %lld\n"),
- program_name, this->name().c_str(),
- static_cast<long long>(val),
- static_cast<long long>(strtab_size));
- gold_exit(false);
+ this->error(_("DT_SONAME value out of range: %lld >= %lld"),
+ static_cast<long long>(val),
+ static_cast<long long>(strtab_size));
+ return;
}
const char* strtab = reinterpret_cast<const char*>(strtabu);
return;
}
- fprintf(stderr, _("%s: %s: missing DT_NULL in dynamic segment\n"),
- program_name, this->name().c_str());
- gold_exit(false);
+ this->error(_("missing DT_NULL in dynamic segment"));
}
// Read the symbols and sections from a dynamic object. We read the
unsigned int strtab_shndx = -1U;
- if (dynsym_shndx == -1U)
- {
- sd->symbols = NULL;
- sd->symbols_size = 0;
- sd->symbol_names = NULL;
- sd->symbol_names_size = 0;
- }
- else
+ sd->symbols = NULL;
+ sd->symbols_size = 0;
+ sd->symbol_names = NULL;
+ sd->symbol_names_size = 0;
+
+ if (dynsym_shndx != -1U)
{
// Get the dynamic symbols.
typename This::Shdr dynsymshdr(pshdrs + dynsym_shndx * This::shdr_size);
gold_assert(dynsymshdr.get_sh_type() == elfcpp::SHT_DYNSYM);
sd->symbols = this->get_lasting_view(dynsymshdr.get_sh_offset(),
- dynsymshdr.get_sh_size());
+ dynsymshdr.get_sh_size(), false);
sd->symbols_size = dynsymshdr.get_sh_size();
// Get the symbol names.
strtab_shndx = dynsymshdr.get_sh_link();
if (strtab_shndx >= this->shnum())
{
- fprintf(stderr,
- _("%s: %s: invalid dynamic symbol table name index: %u\n"),
- program_name, this->name().c_str(), strtab_shndx);
- gold_exit(false);
+ this->error(_("invalid dynamic symbol table name index: %u"),
+ strtab_shndx);
+ return;
}
typename This::Shdr strtabshdr(pshdrs + strtab_shndx * This::shdr_size);
if (strtabshdr.get_sh_type() != elfcpp::SHT_STRTAB)
{
- fprintf(stderr,
- _("%s: %s: dynamic symbol table name section "
- "has wrong type: %u\n"),
- program_name, this->name().c_str(),
- static_cast<unsigned int>(strtabshdr.get_sh_type()));
- gold_exit(false);
+ this->error(_("dynamic symbol table name section "
+ "has wrong type: %u"),
+ static_cast<unsigned int>(strtabshdr.get_sh_type()));
+ return;
}
sd->symbol_names = this->get_lasting_view(strtabshdr.get_sh_offset(),
- strtabshdr.get_sh_size());
+ strtabshdr.get_sh_size(),
+ true);
sd->symbol_names_size = strtabshdr.get_sh_size();
// Get the version information.
template<int size, bool big_endian>
void
-Sized_dynobj<size, big_endian>::do_layout(const General_options&,
- Symbol_table* symtab,
+Sized_dynobj<size, big_endian>::do_layout(Symbol_table* symtab,
Layout*,
Read_symbols_data* sd)
{
if (shdr.get_sh_name() >= sd->section_names_size)
{
- fprintf(stderr,
- _("%s: %s: bad section name offset for section %u: %lu\n"),
- program_name, this->name().c_str(), i,
- static_cast<unsigned long>(shdr.get_sh_name()));
- gold_exit(false);
+ this->error(_("bad section name offset for section %u: %lu"),
+ i, static_cast<unsigned long>(shdr.get_sh_name()));
+ return;
}
const char* name = pnames + shdr.get_sh_name();
if (ndx >= version_map->size())
version_map->resize(ndx + 1);
if ((*version_map)[ndx] != NULL)
- {
- fprintf(stderr, _("%s: %s: duplicate definition for version %u\n"),
- program_name, this->name().c_str(), ndx);
- gold_exit(false);
- }
+ this->error(_("duplicate definition for version %u"), ndx);
(*version_map)[ndx] = name;
}
if (verdef.get_vd_version() != elfcpp::VER_DEF_CURRENT)
{
- fprintf(stderr, _("%s: %s: unexpected verdef version %u\n"),
- program_name, this->name().c_str(), verdef.get_vd_version());
- gold_exit(false);
+ this->error(_("unexpected verdef version %u"),
+ verdef.get_vd_version());
+ return;
}
const unsigned int vd_ndx = verdef.get_vd_ndx();
const unsigned int vd_cnt = verdef.get_vd_cnt();
if (vd_cnt < 1)
{
- fprintf(stderr, _("%s: %s: verdef vd_cnt field too small: %u\n"),
- program_name, this->name().c_str(), vd_cnt);
- gold_exit(false);
+ this->error(_("verdef vd_cnt field too small: %u"), vd_cnt);
+ return;
}
const unsigned int vd_aux = verdef.get_vd_aux();
if ((p - pverdef) + vd_aux >= verdef_size)
{
- fprintf(stderr,
- _("%s: %s: verdef vd_aux field out of range: %u\n"),
- program_name, this->name().c_str(), vd_aux);
- gold_exit(false);
+ this->error(_("verdef vd_aux field out of range: %u"), vd_aux);
+ return;
}
const unsigned char* pvda = p + vd_aux;
const unsigned int vda_name = verdaux.get_vda_name();
if (vda_name >= names_size)
{
- fprintf(stderr,
- _("%s: %s: verdaux vda_name field out of range: %u\n"),
- program_name, this->name().c_str(), vda_name);
- gold_exit(false);
+ this->error(_("verdaux vda_name field out of range: %u"), vda_name);
+ return;
}
this->set_version_map(version_map, vd_ndx, names + vda_name);
const unsigned int vd_next = verdef.get_vd_next();
if ((p - pverdef) + vd_next >= verdef_size)
{
- fprintf(stderr,
- _("%s: %s: verdef vd_next field out of range: %u\n"),
- program_name, this->name().c_str(), vd_next);
- gold_exit(false);
+ this->error(_("verdef vd_next field out of range: %u"), vd_next);
+ return;
}
p += vd_next;
if (verneed.get_vn_version() != elfcpp::VER_NEED_CURRENT)
{
- fprintf(stderr, _("%s: %s: unexpected verneed version %u\n"),
- program_name, this->name().c_str(),
- verneed.get_vn_version());
- gold_exit(false);
+ this->error(_("unexpected verneed version %u"),
+ verneed.get_vn_version());
+ return;
}
const unsigned int vn_aux = verneed.get_vn_aux();
if ((p - pverneed) + vn_aux >= verneed_size)
{
- fprintf(stderr,
- _("%s: %s: verneed vn_aux field out of range: %u\n"),
- program_name, this->name().c_str(), vn_aux);
- gold_exit(false);
+ this->error(_("verneed vn_aux field out of range: %u"), vn_aux);
+ return;
}
const unsigned int vn_cnt = verneed.get_vn_cnt();
const unsigned int vna_name = vernaux.get_vna_name();
if (vna_name >= names_size)
{
- fprintf(stderr,
- _("%s: %s: vernaux vna_name field "
- "out of range: %u\n"),
- program_name, this->name().c_str(), vna_name);
- gold_exit(false);
+ this->error(_("vernaux vna_name field out of range: %u"),
+ vna_name);
+ return;
}
this->set_version_map(version_map, vernaux.get_vna_other(),
const unsigned int vna_next = vernaux.get_vna_next();
if ((pvna - pverneed) + vna_next >= verneed_size)
{
- fprintf(stderr,
- _("%s: %s: verneed vna_next field "
- "out of range: %u\n"),
- program_name, this->name().c_str(), vna_next);
- gold_exit(false);
+ this->error(_("verneed vna_next field out of range: %u"),
+ vna_next);
+ return;
}
pvna += vna_next;
const unsigned int vn_next = verneed.get_vn_next();
if ((p - pverneed) + vn_next >= verneed_size)
{
- fprintf(stderr,
- _("%s: %s: verneed vn_next field out of range: %u\n"),
- program_name, this->name().c_str(), vn_next);
- gold_exit(false);
+ this->error(_("verneed vn_next field out of range: %u"), vn_next);
+ return;
}
p += vn_next;
const int sym_size = This::sym_size;
const size_t symcount = sd->symbols_size / sym_size;
- if (symcount * sym_size != sd->symbols_size)
+ if (static_cast<off_t>(symcount * sym_size) != sd->symbols_size)
{
- fprintf(stderr,
- _("%s: %s: size of dynamic symbols is not "
- "multiple of symbol size\n"),
- program_name, this->name().c_str());
- gold_exit(false);
+ this->error(_("size of dynamic symbols is not multiple of symbol size"));
+ return;
}
Version_map version_map;
// symbol table.
void
-Dynobj::create_elf_hash_table(const Target* target,
- const std::vector<Symbol*>& dynsyms,
+Dynobj::create_elf_hash_table(const std::vector<Symbol*>& dynsyms,
unsigned int local_dynsym_count,
unsigned char** pphash,
unsigned int* phashlen)
* 4);
unsigned char* phash = new unsigned char[hashlen];
- if (target->is_big_endian())
- Dynobj::sized_create_elf_hash_table<true>(bucket, chain, phash, hashlen);
+ if (parameters->is_big_endian())
+ {
+#if defined(HAVE_TARGET_32_BIG) || defined(HAVE_TARGET_64_BIG)
+ Dynobj::sized_create_elf_hash_table<true>(bucket, chain, phash,
+ hashlen);
+#else
+ gold_unreachable();
+#endif
+ }
else
- Dynobj::sized_create_elf_hash_table<false>(bucket, chain, phash, hashlen);
+ {
+#if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_64_LITTLE)
+ Dynobj::sized_create_elf_hash_table<false>(bucket, chain, phash,
+ hashlen);
+#else
+ gold_unreachable();
+#endif
+ }
*pphash = phash;
*phashlen = hashlen;
// symbol table.
void
-Dynobj::create_gnu_hash_table(const Target* target,
- const std::vector<Symbol*>& dynsyms,
+Dynobj::create_gnu_hash_table(const std::vector<Symbol*>& dynsyms,
unsigned int local_dynsym_count,
unsigned char** pphash,
unsigned int* phashlen)
// For the actual data generation we call out to a templatized
// function.
- int size = target->get_size();
- bool big_endian = target->is_big_endian();
+ int size = parameters->get_size();
+ bool big_endian = parameters->is_big_endian();
if (size == 32)
{
if (big_endian)
- Dynobj::sized_create_gnu_hash_table<32, true>(hashed_dynsyms,
- dynsym_hashvals,
- unhashed_dynsym_index,
- pphash,
- phashlen);
+ {
+#ifdef HAVE_TARGET_32_BIG
+ Dynobj::sized_create_gnu_hash_table<32, true>(hashed_dynsyms,
+ dynsym_hashvals,
+ unhashed_dynsym_index,
+ pphash,
+ phashlen);
+#else
+ gold_unreachable();
+#endif
+ }
else
- Dynobj::sized_create_gnu_hash_table<32, false>(hashed_dynsyms,
- dynsym_hashvals,
- unhashed_dynsym_index,
- pphash,
- phashlen);
+ {
+#ifdef HAVE_TARGET_32_LITTLE
+ Dynobj::sized_create_gnu_hash_table<32, false>(hashed_dynsyms,
+ dynsym_hashvals,
+ unhashed_dynsym_index,
+ pphash,
+ phashlen);
+#else
+ gold_unreachable();
+#endif
+ }
}
else if (size == 64)
{
if (big_endian)
- Dynobj::sized_create_gnu_hash_table<64, true>(hashed_dynsyms,
- dynsym_hashvals,
- unhashed_dynsym_index,
- pphash,
- phashlen);
+ {
+#ifdef HAVE_TARGET_64_BIG
+ Dynobj::sized_create_gnu_hash_table<64, true>(hashed_dynsyms,
+ dynsym_hashvals,
+ unhashed_dynsym_index,
+ pphash,
+ phashlen);
+#else
+ gold_unreachable();
+#endif
+ }
else
- Dynobj::sized_create_gnu_hash_table<64, false>(hashed_dynsyms,
- dynsym_hashvals,
- unhashed_dynsym_index,
- pphash,
- phashlen);
+ {
+#ifdef HAVE_TARGET_64_LITTLE
+ Dynobj::sized_create_gnu_hash_table<64, false>(hashed_dynsyms,
+ dynsym_hashvals,
+ unhashed_dynsym_index,
+ pphash,
+ phashlen);
+#else
+ gold_unreachable();
+#endif
+ }
}
else
gold_unreachable();
template<int size, bool big_endian>
unsigned char*
-Verdef::write(const Stringpool* dynpool, bool is_last, unsigned char* pb) const
+Verdef::write(const Stringpool* dynpool, bool is_last, unsigned char* pb
+ ACCEPT_SIZE_ENDIAN) const
{
const int verdef_size = elfcpp::Elf_sizes<size>::verdef_size;
const int verdaux_size = elfcpp::Elf_sizes<size>::verdaux_size;
template<int size, bool big_endian>
unsigned char*
Verneed::write(const Stringpool* dynpool, bool is_last,
- unsigned char* pb) const
+ unsigned char* pb ACCEPT_SIZE_ENDIAN) const
{
const int verneed_size = elfcpp::Elf_sizes<size>::verneed_size;
const int vernaux_size = elfcpp::Elf_sizes<size>::vernaux_size;
delete *p;
}
+// Return the dynamic object which a symbol refers to.
+
+Dynobj*
+Versions::get_dynobj_for_sym(const Symbol_table* symtab,
+ const Symbol* sym) const
+{
+ if (sym->is_copied_from_dynobj())
+ return symtab->get_copy_source(sym);
+ else
+ {
+ Object* object = sym->object();
+ gold_assert(object->is_dynamic());
+ return static_cast<Dynobj*>(object);
+ }
+}
+
// Record version information for a symbol going into the dynamic
// symbol table.
void
-Versions::record_version(const General_options* options,
+Versions::record_version(const Symbol_table* symtab,
Stringpool* dynpool, const Symbol* sym)
{
gold_assert(!this->is_finalized_);
gold_assert(sym->version() != NULL);
Stringpool::Key version_key;
- const char* version = dynpool->add(sym->version(), &version_key);
+ const char* version = dynpool->add(sym->version(), false, &version_key);
- if (!sym->is_from_dynobj())
- this->add_def(options, sym, version, version_key);
+ if (!sym->is_from_dynobj() && !sym->is_copied_from_dynobj())
+ {
+ if (parameters->output_is_shared())
+ this->add_def(sym, version, version_key);
+ }
else
{
// This is a version reference.
-
- Object* object = sym->object();
- gold_assert(object->is_dynamic());
- Dynobj* dynobj = static_cast<Dynobj*>(object);
-
+ Dynobj* dynobj = this->get_dynobj_for_sym(symtab, sym);
this->add_need(dynpool, dynobj->soname(), version, version_key);
}
}
// We've found a symbol SYM defined in version VERSION.
void
-Versions::add_def(const General_options* options, const Symbol* sym,
- const char* version, Stringpool::Key version_key)
+Versions::add_def(const Symbol* sym, const char* version,
+ Stringpool::Key version_key)
{
Key k(version_key, 0);
Version_base* const vbnull = NULL;
// If we are creating a shared object, it is an error to
// find a definition of a symbol with a version which is not
// in the version script.
- if (options->is_shared())
+ if (parameters->output_is_shared())
{
- fprintf(stderr, _("%s: symbol %s has undefined version %s\n"),
- program_name, sym->name(), version);
- gold_exit(false);
+ gold_error(_("symbol %s has undefined version %s"),
+ sym->name(), version);
+ return;
}
// If this is the first version we are defining, first define
// the base version. FIXME: Should use soname here when
// creating a shared object.
- Verdef* vdbase = new Verdef(options->output_file_name(), true, false,
+ Verdef* vdbase = new Verdef(parameters->output_file_name(), true, false,
true);
this->defs_.push_back(vdbase);
Stringpool::Key name_key)
{
Stringpool::Key filename_key;
- filename = dynpool->add(filename, &filename_key);
+ filename = dynpool->add(filename, true, &filename_key);
Key k(name_key, filename_key);
Version_base* const vbnull = NULL;
// Create a version symbol if necessary.
if (!(*p)->is_symbol_created())
{
- Symbol* vsym =symtab->define_as_constant(target, (*p)->name(),
- (*p)->name(), 0, 0,
- elfcpp::STT_OBJECT,
- elfcpp::STB_GLOBAL,
- elfcpp::STV_DEFAULT, 0,
- false);
+ Symbol* vsym = symtab->define_as_constant(target, (*p)->name(),
+ (*p)->name(), 0, 0,
+ elfcpp::STT_OBJECT,
+ elfcpp::STB_GLOBAL,
+ elfcpp::STV_DEFAULT, 0,
+ false);
vsym->set_needs_dynsym_entry();
+ vsym->set_dynsym_index(dynsym_index);
++dynsym_index;
syms->push_back(vsym);
// The name is already in the dynamic pool.
// pointers.
unsigned int
-Versions::version_index(const Stringpool* dynpool, const Symbol* sym) const
+Versions::version_index(const Symbol_table* symtab, const Stringpool* dynpool,
+ const Symbol* sym) const
{
Stringpool::Key version_key;
const char* version = dynpool->find(sym->version(), &version_key);
gold_assert(version != NULL);
- Version_table::const_iterator p;
- if (!sym->is_from_dynobj())
+ Key k;
+ if (!sym->is_from_dynobj() && !sym->is_copied_from_dynobj())
{
- Key k(version_key, 0);
- p = this->version_table_.find(k);
+ if (!parameters->output_is_shared())
+ return elfcpp::VER_NDX_GLOBAL;
+ k = Key(version_key, 0);
}
else
{
- Object* object = sym->object();
- gold_assert(object->is_dynamic());
- Dynobj* dynobj = static_cast<Dynobj*>(object);
+ Dynobj* dynobj = this->get_dynobj_for_sym(symtab, sym);
Stringpool::Key filename_key;
const char* filename = dynpool->find(dynobj->soname(), &filename_key);
gold_assert(filename != NULL);
- Key k(version_key, filename_key);
- p = this->version_table_.find(k);
+ k = Key(version_key, filename_key);
}
+ Version_table::const_iterator p = this->version_table_.find(k);
gold_assert(p != this->version_table_.end());
return p->second->index();
template<int size, bool big_endian>
void
-Versions::symbol_section_contents(const Stringpool* dynpool,
+Versions::symbol_section_contents(const Symbol_table* symtab,
+ const Stringpool* dynpool,
unsigned int local_symcount,
const std::vector<Symbol*>& syms,
unsigned char** pp,
- unsigned int* psize) const
+ unsigned int* psize
+ ACCEPT_SIZE_ENDIAN) const
{
gold_assert(this->is_finalized_);
if (version == NULL)
version_index = elfcpp::VER_NDX_GLOBAL;
else
- version_index = this->version_index(dynpool, *p);
+ version_index = this->version_index(symtab, dynpool, *p);
elfcpp::Swap<16, big_endian>::writeval(pbuf + (*p)->dynsym_index() * 2,
version_index);
}
void
Versions::def_section_contents(const Stringpool* dynpool,
unsigned char** pp, unsigned int* psize,
- unsigned int* pentries) const
+ unsigned int* pentries
+ ACCEPT_SIZE_ENDIAN) const
{
gold_assert(this->is_finalized_);
gold_assert(!this->defs_.empty());
for (p = this->defs_.begin(), i = 0;
p != this->defs_.end();
++p, ++i)
- pb = (*p)->write<size, big_endian>(dynpool,
- i + 1 >= this->defs_.size(),
- pb);
+ pb = (*p)->write SELECT_SIZE_ENDIAN_NAME(size, big_endian)(
+ dynpool, i + 1 >= this->defs_.size(), pb
+ SELECT_SIZE_ENDIAN(size, big_endian));
gold_assert(static_cast<unsigned int>(pb - pbuf) == sz);
void
Versions::need_section_contents(const Stringpool* dynpool,
unsigned char** pp, unsigned int *psize,
- unsigned int *pentries) const
+ unsigned int *pentries
+ ACCEPT_SIZE_ENDIAN) const
{
gold_assert(this->is_finalized_);
gold_assert(!this->needs_.empty());
for (p = this->needs_.begin(), i = 0;
p != this->needs_.end();
++p, ++i)
- pb = (*p)->write<size, big_endian>(dynpool,
- i + 1 >= this->needs_.size(),
- pb);
+ pb = (*p)->write SELECT_SIZE_ENDIAN_NAME(size, big_endian)(
+ dynpool, i + 1 >= this->needs_.size(), pb
+ SELECT_SIZE_ENDIAN(size, big_endian));
gold_assert(static_cast<unsigned int>(pb - pbuf) == sz);
// Instantiate the templates we need. We could use the configure
// script to restrict this to only the ones for implemented targets.
+#ifdef HAVE_TARGET_32_LITTLE
template
class Sized_dynobj<32, false>;
+#endif
+#ifdef HAVE_TARGET_32_BIG
template
class Sized_dynobj<32, true>;
+#endif
+#ifdef HAVE_TARGET_64_LITTLE
template
class Sized_dynobj<64, false>;
+#endif
+#ifdef HAVE_TARGET_64_BIG
template
class Sized_dynobj<64, true>;
+#endif
+#ifdef HAVE_TARGET_32_LITTLE
template
void
-Versions::symbol_section_contents<32, false>(const Stringpool*,
- unsigned int,
- const std::vector<Symbol*>&,
- unsigned char**,
- unsigned int*) const;
-
+Versions::symbol_section_contents<32, false>(
+ const Symbol_table*,
+ const Stringpool*,
+ unsigned int,
+ const std::vector<Symbol*>&,
+ unsigned char**,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(32, false)) const;
+#endif
+
+#ifdef HAVE_TARGET_32_BIG
template
void
-Versions::symbol_section_contents<32, true>(const Stringpool*,
- unsigned int,
- const std::vector<Symbol*>&,
- unsigned char**,
- unsigned int*) const;
-
+Versions::symbol_section_contents<32, true>(
+ const Symbol_table*,
+ const Stringpool*,
+ unsigned int,
+ const std::vector<Symbol*>&,
+ unsigned char**,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(32, true)) const;
+#endif
+
+#ifdef HAVE_TARGET_64_LITTLE
template
void
-Versions::symbol_section_contents<64, false>(const Stringpool*,
- unsigned int,
- const std::vector<Symbol*>&,
- unsigned char**,
- unsigned int*) const;
-
+Versions::symbol_section_contents<64, false>(
+ const Symbol_table*,
+ const Stringpool*,
+ unsigned int,
+ const std::vector<Symbol*>&,
+ unsigned char**,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(64, false)) const;
+#endif
+
+#ifdef HAVE_TARGET_64_BIG
template
void
-Versions::symbol_section_contents<64, true>(const Stringpool*,
- unsigned int,
- const std::vector<Symbol*>&,
- unsigned char**,
- unsigned int*) const;
-
+Versions::symbol_section_contents<64, true>(
+ const Symbol_table*,
+ const Stringpool*,
+ unsigned int,
+ const std::vector<Symbol*>&,
+ unsigned char**,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(64, true)) const;
+#endif
+
+#ifdef HAVE_TARGET_32_LITTLE
template
void
-Versions::def_section_contents<32, false>(const Stringpool*,
- unsigned char**,
- unsigned int*,
- unsigned int*) const;
-
+Versions::def_section_contents<32, false>(
+ const Stringpool*,
+ unsigned char**,
+ unsigned int*,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(32, false)) const;
+#endif
+
+#ifdef HAVE_TARGET_32_BIG
template
void
-Versions::def_section_contents<32, true>(const Stringpool*,
- unsigned char**,
- unsigned int*,
- unsigned int*) const;
-
+Versions::def_section_contents<32, true>(
+ const Stringpool*,
+ unsigned char**,
+ unsigned int*,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(32, true)) const;
+#endif
+
+#ifdef HAVE_TARGET_64_LITTLE
template
void
-Versions::def_section_contents<64, false>(const Stringpool*,
- unsigned char**,
- unsigned int*,
- unsigned int*) const;
-
+Versions::def_section_contents<64, false>(
+ const Stringpool*,
+ unsigned char**,
+ unsigned int*,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(64, false)) const;
+#endif
+
+#ifdef HAVE_TARGET_64_BIG
template
void
-Versions::def_section_contents<64, true>(const Stringpool*,
- unsigned char**,
- unsigned int*,
- unsigned int*) const;
-
+Versions::def_section_contents<64, true>(
+ const Stringpool*,
+ unsigned char**,
+ unsigned int*,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(64, true)) const;
+#endif
+
+#ifdef HAVE_TARGET_32_LITTLE
template
void
-Versions::need_section_contents<32, false>(const Stringpool*,
- unsigned char**,
- unsigned int*,
- unsigned int*) const;
-
+Versions::need_section_contents<32, false>(
+ const Stringpool*,
+ unsigned char**,
+ unsigned int*,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(32, false)) const;
+#endif
+
+#ifdef HAVE_TARGET_32_BIG
template
void
-Versions::need_section_contents<32, true>(const Stringpool*,
- unsigned char**,
- unsigned int*,
- unsigned int*) const;
-
+Versions::need_section_contents<32, true>(
+ const Stringpool*,
+ unsigned char**,
+ unsigned int*,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(32, true)) const;
+#endif
+
+#ifdef HAVE_TARGET_64_LITTLE
template
void
-Versions::need_section_contents<64, false>(const Stringpool*,
- unsigned char**,
- unsigned int*,
- unsigned int*) const;
-
+Versions::need_section_contents<64, false>(
+ const Stringpool*,
+ unsigned char**,
+ unsigned int*,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(64, false)) const;
+#endif
+
+#ifdef HAVE_TARGET_64_BIG
template
void
-Versions::need_section_contents<64, true>(const Stringpool*,
- unsigned char**,
- unsigned int*,
- unsigned int*) const;
+Versions::need_section_contents<64, true>(
+ const Stringpool*,
+ unsigned char**,
+ unsigned int*,
+ unsigned int*
+ ACCEPT_SIZE_ENDIAN_EXPLICIT(64, true)) const;
+#endif
} // End namespace gold.