Add global parameters.
This commit is contained in:
parent
be9d5a933e
commit
7e1edb9089
21 changed files with 396 additions and 256 deletions
|
@ -34,6 +34,7 @@ CCFILES = \
|
||||||
object.cc \
|
object.cc \
|
||||||
options.cc \
|
options.cc \
|
||||||
output.cc \
|
output.cc \
|
||||||
|
parameters.cc \
|
||||||
readsyms.cc \
|
readsyms.cc \
|
||||||
reloc.cc \
|
reloc.cc \
|
||||||
resolve.cc \
|
resolve.cc \
|
||||||
|
@ -57,6 +58,7 @@ HFILES = \
|
||||||
object.h \
|
object.h \
|
||||||
options.h \
|
options.h \
|
||||||
output.h \
|
output.h \
|
||||||
|
parameters.h \
|
||||||
readsyms.h \
|
readsyms.h \
|
||||||
reloc.h \
|
reloc.h \
|
||||||
reloc-types.h \
|
reloc-types.h \
|
||||||
|
|
|
@ -72,9 +72,9 @@ am__objects_1 = archive.$(OBJEXT) common.$(OBJEXT) defstd.$(OBJEXT) \
|
||||||
dirsearch.$(OBJEXT) dynobj.$(OBJEXT) fileread.$(OBJEXT) \
|
dirsearch.$(OBJEXT) dynobj.$(OBJEXT) fileread.$(OBJEXT) \
|
||||||
gold.$(OBJEXT) gold-threads.$(OBJEXT) layout.$(OBJEXT) \
|
gold.$(OBJEXT) gold-threads.$(OBJEXT) layout.$(OBJEXT) \
|
||||||
merge.$(OBJEXT) object.$(OBJEXT) options.$(OBJEXT) \
|
merge.$(OBJEXT) object.$(OBJEXT) options.$(OBJEXT) \
|
||||||
output.$(OBJEXT) readsyms.$(OBJEXT) reloc.$(OBJEXT) \
|
output.$(OBJEXT) parameters.$(OBJEXT) readsyms.$(OBJEXT) \
|
||||||
resolve.$(OBJEXT) script.$(OBJEXT) symtab.$(OBJEXT) \
|
reloc.$(OBJEXT) resolve.$(OBJEXT) script.$(OBJEXT) \
|
||||||
stringpool.$(OBJEXT) target-select.$(OBJEXT) \
|
symtab.$(OBJEXT) stringpool.$(OBJEXT) target-select.$(OBJEXT) \
|
||||||
workqueue.$(OBJEXT)
|
workqueue.$(OBJEXT)
|
||||||
am__objects_2 =
|
am__objects_2 =
|
||||||
am__objects_3 = yyscript.$(OBJEXT)
|
am__objects_3 = yyscript.$(OBJEXT)
|
||||||
|
@ -261,6 +261,7 @@ CCFILES = \
|
||||||
object.cc \
|
object.cc \
|
||||||
options.cc \
|
options.cc \
|
||||||
output.cc \
|
output.cc \
|
||||||
|
parameters.cc \
|
||||||
readsyms.cc \
|
readsyms.cc \
|
||||||
reloc.cc \
|
reloc.cc \
|
||||||
resolve.cc \
|
resolve.cc \
|
||||||
|
@ -284,6 +285,7 @@ HFILES = \
|
||||||
object.h \
|
object.h \
|
||||||
options.h \
|
options.h \
|
||||||
output.h \
|
output.h \
|
||||||
|
parameters.h \
|
||||||
readsyms.h \
|
readsyms.h \
|
||||||
reloc.h \
|
reloc.h \
|
||||||
reloc-types.h \
|
reloc-types.h \
|
||||||
|
@ -405,6 +407,7 @@ distclean-compile:
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parameters.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readsyms.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readsyms.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reloc.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reloc.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolve.Po@am__quote@
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "elfcpp.h"
|
#include "elfcpp.h"
|
||||||
|
#include "options.h"
|
||||||
#include "fileread.h"
|
#include "fileread.h"
|
||||||
#include "readsyms.h"
|
#include "readsyms.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
|
@ -238,11 +239,11 @@ Archive::interpret_header(const Archive_header* hdr, off_t off,
|
||||||
// may be satisfied by other objects in the archive.
|
// may be satisfied by other objects in the archive.
|
||||||
|
|
||||||
void
|
void
|
||||||
Archive::add_symbols(const General_options& options, Symbol_table* symtab,
|
Archive::add_symbols(Symbol_table* symtab, Layout* layout,
|
||||||
Layout* layout, Input_objects* input_objects)
|
Input_objects* input_objects)
|
||||||
{
|
{
|
||||||
if (this->input_file_->options().include_whole_archive())
|
if (this->input_file_->options().include_whole_archive())
|
||||||
return this->include_all_members(options, symtab, layout, input_objects);
|
return this->include_all_members(symtab, layout, input_objects);
|
||||||
|
|
||||||
const size_t armap_size = this->armap_.size();
|
const size_t armap_size = this->armap_.size();
|
||||||
|
|
||||||
|
@ -290,7 +291,7 @@ Archive::add_symbols(const General_options& options, Symbol_table* symtab,
|
||||||
last_seen_offset = this->armap_[i].offset;
|
last_seen_offset = this->armap_[i].offset;
|
||||||
this->seen_offsets_.insert(last_seen_offset);
|
this->seen_offsets_.insert(last_seen_offset);
|
||||||
this->armap_checked_[i] = true;
|
this->armap_checked_[i] = true;
|
||||||
this->include_member(options, symtab, layout, input_objects,
|
this->include_member(symtab, layout, input_objects,
|
||||||
last_seen_offset);
|
last_seen_offset);
|
||||||
added_new_object = true;
|
added_new_object = true;
|
||||||
}
|
}
|
||||||
|
@ -301,8 +302,7 @@ Archive::add_symbols(const General_options& options, Symbol_table* symtab,
|
||||||
// Include all the archive members in the link. This is for --whole-archive.
|
// Include all the archive members in the link. This is for --whole-archive.
|
||||||
|
|
||||||
void
|
void
|
||||||
Archive::include_all_members(const General_options& options,
|
Archive::include_all_members(Symbol_table* symtab, Layout* layout,
|
||||||
Symbol_table* symtab, Layout* layout,
|
|
||||||
Input_objects* input_objects)
|
Input_objects* input_objects)
|
||||||
{
|
{
|
||||||
off_t off = sarmag;
|
off_t off = sarmag;
|
||||||
|
@ -336,7 +336,7 @@ Archive::include_all_members(const General_options& options,
|
||||||
// Extended name table.
|
// Extended name table.
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this->include_member(options, symtab, layout, input_objects, off);
|
this->include_member(symtab, layout, input_objects, off);
|
||||||
|
|
||||||
off += sizeof(Archive_header) + size;
|
off += sizeof(Archive_header) + size;
|
||||||
if ((off & 1) != 0)
|
if ((off & 1) != 0)
|
||||||
|
@ -348,9 +348,8 @@ Archive::include_all_members(const General_options& options,
|
||||||
// the member header.
|
// the member header.
|
||||||
|
|
||||||
void
|
void
|
||||||
Archive::include_member(const General_options& options, Symbol_table* symtab,
|
Archive::include_member(Symbol_table* symtab, Layout* layout,
|
||||||
Layout* layout, Input_objects* input_objects,
|
Input_objects* input_objects, off_t off)
|
||||||
off_t off)
|
|
||||||
{
|
{
|
||||||
std::string n;
|
std::string n;
|
||||||
this->read_header(off, &n);
|
this->read_header(off, &n);
|
||||||
|
@ -392,7 +391,7 @@ Archive::include_member(const General_options& options, Symbol_table* symtab,
|
||||||
|
|
||||||
Read_symbols_data sd;
|
Read_symbols_data sd;
|
||||||
obj->read_symbols(&sd);
|
obj->read_symbols(&sd);
|
||||||
obj->layout(options, symtab, layout, &sd);
|
obj->layout(symtab, layout, &sd);
|
||||||
obj->add_symbols(symtab, &sd);
|
obj->add_symbols(symtab, &sd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,7 +440,7 @@ Add_archive_symbols::locks(Workqueue* workqueue)
|
||||||
void
|
void
|
||||||
Add_archive_symbols::run(Workqueue*)
|
Add_archive_symbols::run(Workqueue*)
|
||||||
{
|
{
|
||||||
this->archive_->add_symbols(this->options_, this->symtab_, this->layout_,
|
this->archive_->add_symbols(this->symtab_, this->layout_,
|
||||||
this->input_objects_);
|
this->input_objects_);
|
||||||
|
|
||||||
if (this->input_group_ != NULL)
|
if (this->input_group_ != NULL)
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
namespace gold
|
namespace gold
|
||||||
{
|
{
|
||||||
|
|
||||||
class General_options;
|
|
||||||
class Input_file;
|
class Input_file;
|
||||||
class Input_objects;
|
class Input_objects;
|
||||||
class Input_group;
|
class Input_group;
|
||||||
|
@ -69,7 +68,7 @@ class Archive
|
||||||
// Select members from the archive as needed and add them to the
|
// Select members from the archive as needed and add them to the
|
||||||
// link.
|
// link.
|
||||||
void
|
void
|
||||||
add_symbols(const General_options&, Symbol_table*, Layout*, Input_objects*);
|
add_symbols(Symbol_table*, Layout*, Input_objects*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Archive(const Archive&);
|
Archive(const Archive&);
|
||||||
|
@ -98,13 +97,11 @@ class Archive
|
||||||
|
|
||||||
// Include all the archive members in the link.
|
// Include all the archive members in the link.
|
||||||
void
|
void
|
||||||
include_all_members(const General_options&, Symbol_table*, Layout*,
|
include_all_members(Symbol_table*, Layout*, Input_objects*);
|
||||||
Input_objects*);
|
|
||||||
|
|
||||||
// Include an archive member in the link.
|
// Include an archive member in the link.
|
||||||
void
|
void
|
||||||
include_member(const General_options&, Symbol_table*, Layout*,
|
include_member(Symbol_table*, Layout*, Input_objects*, off_t off);
|
||||||
Input_objects*, off_t off);
|
|
||||||
|
|
||||||
// An entry in the archive map of symbols to object files.
|
// An entry in the archive map of symbols to object files.
|
||||||
struct Armap_entry
|
struct Armap_entry
|
||||||
|
@ -144,15 +141,14 @@ class Archive
|
||||||
class Add_archive_symbols : public Task
|
class Add_archive_symbols : public Task
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Add_archive_symbols(const General_options& options, Symbol_table* symtab,
|
Add_archive_symbols(Symbol_table* symtab, Layout* layout,
|
||||||
Layout* layout, Input_objects* input_objects,
|
Input_objects* input_objects,
|
||||||
Archive* archive, Input_group* input_group,
|
Archive* archive, Input_group* input_group,
|
||||||
Task_token* this_blocker,
|
Task_token* this_blocker,
|
||||||
Task_token* next_blocker)
|
Task_token* next_blocker)
|
||||||
: options_(options), symtab_(symtab), layout_(layout),
|
: symtab_(symtab), layout_(layout), input_objects_(input_objects),
|
||||||
input_objects_(input_objects), archive_(archive),
|
archive_(archive), input_group_(input_group),
|
||||||
input_group_(input_group), this_blocker_(this_blocker),
|
this_blocker_(this_blocker), next_blocker_(next_blocker)
|
||||||
next_blocker_(next_blocker)
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
~Add_archive_symbols();
|
~Add_archive_symbols();
|
||||||
|
@ -171,7 +167,6 @@ class Add_archive_symbols : public Task
|
||||||
private:
|
private:
|
||||||
class Add_archive_symbols_locker;
|
class Add_archive_symbols_locker;
|
||||||
|
|
||||||
const General_options& options_;
|
|
||||||
Symbol_table* symtab_;
|
Symbol_table* symtab_;
|
||||||
Layout* layout_;
|
Layout* layout_;
|
||||||
Input_objects* input_objects_;
|
Input_objects* input_objects_;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "elfcpp.h"
|
#include "elfcpp.h"
|
||||||
|
#include "parameters.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
#include "dynobj.h"
|
#include "dynobj.h"
|
||||||
|
|
||||||
|
@ -340,8 +341,7 @@ Sized_dynobj<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
|
||||||
|
|
||||||
template<int size, bool big_endian>
|
template<int size, bool big_endian>
|
||||||
void
|
void
|
||||||
Sized_dynobj<size, big_endian>::do_layout(const General_options&,
|
Sized_dynobj<size, big_endian>::do_layout(Symbol_table* symtab,
|
||||||
Symbol_table* symtab,
|
|
||||||
Layout*,
|
Layout*,
|
||||||
Read_symbols_data* sd)
|
Read_symbols_data* sd)
|
||||||
{
|
{
|
||||||
|
@ -1196,7 +1196,7 @@ Versions::record_version(const General_options* options,
|
||||||
|
|
||||||
if (!sym->is_from_dynobj())
|
if (!sym->is_from_dynobj())
|
||||||
{
|
{
|
||||||
if (options->is_shared())
|
if (parameters->output_is_shared())
|
||||||
this->add_def(options, sym, version, version_key);
|
this->add_def(options, sym, version, version_key);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1239,7 +1239,7 @@ Versions::add_def(const General_options* options, const Symbol* sym,
|
||||||
// If we are creating a shared object, it is an error to
|
// If we are creating a shared object, it is an error to
|
||||||
// find a definition of a symbol with a version which is not
|
// find a definition of a symbol with a version which is not
|
||||||
// in the version script.
|
// in the version script.
|
||||||
if (options->is_shared())
|
if (parameters->output_is_shared())
|
||||||
{
|
{
|
||||||
fprintf(stderr, _("%s: symbol %s has undefined version %s\n"),
|
fprintf(stderr, _("%s: symbol %s has undefined version %s\n"),
|
||||||
program_name, sym->name(), version);
|
program_name, sym->name(), version);
|
||||||
|
@ -1366,8 +1366,7 @@ Versions::finalize(const Target* target, Symbol_table* symtab,
|
||||||
// pointers.
|
// pointers.
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
Versions::version_index(const General_options* options,
|
Versions::version_index(const Stringpool* dynpool, const Symbol* sym) const
|
||||||
const Stringpool* dynpool, const Symbol* sym) const
|
|
||||||
{
|
{
|
||||||
Stringpool::Key version_key;
|
Stringpool::Key version_key;
|
||||||
const char* version = dynpool->find(sym->version(), &version_key);
|
const char* version = dynpool->find(sym->version(), &version_key);
|
||||||
|
@ -1376,7 +1375,7 @@ Versions::version_index(const General_options* options,
|
||||||
Key k;
|
Key k;
|
||||||
if (!sym->is_from_dynobj())
|
if (!sym->is_from_dynobj())
|
||||||
{
|
{
|
||||||
if (!options->is_shared())
|
if (!parameters->output_is_shared())
|
||||||
return elfcpp::VER_NDX_GLOBAL;
|
return elfcpp::VER_NDX_GLOBAL;
|
||||||
k = Key(version_key, 0);
|
k = Key(version_key, 0);
|
||||||
}
|
}
|
||||||
|
@ -1404,8 +1403,7 @@ Versions::version_index(const General_options* options,
|
||||||
|
|
||||||
template<int size, bool big_endian>
|
template<int size, bool big_endian>
|
||||||
void
|
void
|
||||||
Versions::symbol_section_contents(const General_options* options,
|
Versions::symbol_section_contents(const Stringpool* dynpool,
|
||||||
const Stringpool* dynpool,
|
|
||||||
unsigned int local_symcount,
|
unsigned int local_symcount,
|
||||||
const std::vector<Symbol*>& syms,
|
const std::vector<Symbol*>& syms,
|
||||||
unsigned char** pp,
|
unsigned char** pp,
|
||||||
|
@ -1430,7 +1428,7 @@ Versions::symbol_section_contents(const General_options* options,
|
||||||
if (version == NULL)
|
if (version == NULL)
|
||||||
version_index = elfcpp::VER_NDX_GLOBAL;
|
version_index = elfcpp::VER_NDX_GLOBAL;
|
||||||
else
|
else
|
||||||
version_index = this->version_index(options, dynpool, *p);
|
version_index = this->version_index(dynpool, *p);
|
||||||
elfcpp::Swap<16, big_endian>::writeval(pbuf + (*p)->dynsym_index() * 2,
|
elfcpp::Swap<16, big_endian>::writeval(pbuf + (*p)->dynsym_index() * 2,
|
||||||
version_index);
|
version_index);
|
||||||
}
|
}
|
||||||
|
@ -1554,7 +1552,6 @@ class Sized_dynobj<64, true>;
|
||||||
template
|
template
|
||||||
void
|
void
|
||||||
Versions::symbol_section_contents<32, false>(
|
Versions::symbol_section_contents<32, false>(
|
||||||
const General_options*,
|
|
||||||
const Stringpool*,
|
const Stringpool*,
|
||||||
unsigned int,
|
unsigned int,
|
||||||
const std::vector<Symbol*>&,
|
const std::vector<Symbol*>&,
|
||||||
|
@ -1567,7 +1564,6 @@ Versions::symbol_section_contents<32, false>(
|
||||||
template
|
template
|
||||||
void
|
void
|
||||||
Versions::symbol_section_contents<32, true>(
|
Versions::symbol_section_contents<32, true>(
|
||||||
const General_options*,
|
|
||||||
const Stringpool*,
|
const Stringpool*,
|
||||||
unsigned int,
|
unsigned int,
|
||||||
const std::vector<Symbol*>&,
|
const std::vector<Symbol*>&,
|
||||||
|
@ -1580,7 +1576,6 @@ Versions::symbol_section_contents<32, true>(
|
||||||
template
|
template
|
||||||
void
|
void
|
||||||
Versions::symbol_section_contents<64, false>(
|
Versions::symbol_section_contents<64, false>(
|
||||||
const General_options*,
|
|
||||||
const Stringpool*,
|
const Stringpool*,
|
||||||
unsigned int,
|
unsigned int,
|
||||||
const std::vector<Symbol*>&,
|
const std::vector<Symbol*>&,
|
||||||
|
@ -1593,7 +1588,6 @@ Versions::symbol_section_contents<64, false>(
|
||||||
template
|
template
|
||||||
void
|
void
|
||||||
Versions::symbol_section_contents<64, true>(
|
Versions::symbol_section_contents<64, true>(
|
||||||
const General_options*,
|
|
||||||
const Stringpool*,
|
const Stringpool*,
|
||||||
unsigned int,
|
unsigned int,
|
||||||
const std::vector<Symbol*>&,
|
const std::vector<Symbol*>&,
|
||||||
|
|
|
@ -106,8 +106,7 @@ class Sized_dynobj : public Dynobj
|
||||||
|
|
||||||
// Lay out the input sections.
|
// Lay out the input sections.
|
||||||
void
|
void
|
||||||
do_layout(const General_options&, Symbol_table*, Layout*,
|
do_layout(Symbol_table*, Layout*, Read_symbols_data*);
|
||||||
Read_symbols_data*);
|
|
||||||
|
|
||||||
// Add the symbols to the symbol table.
|
// Add the symbols to the symbol table.
|
||||||
void
|
void
|
||||||
|
@ -415,8 +414,7 @@ class Versions
|
||||||
// version section (.gnu.version).
|
// version section (.gnu.version).
|
||||||
template<int size, bool big_endian>
|
template<int size, bool big_endian>
|
||||||
void
|
void
|
||||||
symbol_section_contents(const General_options*, const Stringpool*,
|
symbol_section_contents(const Stringpool*, unsigned int local_symcount,
|
||||||
unsigned int local_symcount,
|
|
||||||
const std::vector<Symbol*>& syms,
|
const std::vector<Symbol*>& syms,
|
||||||
unsigned char**, unsigned int*
|
unsigned char**, unsigned int*
|
||||||
ACCEPT_SIZE_ENDIAN) const;
|
ACCEPT_SIZE_ENDIAN) const;
|
||||||
|
@ -456,8 +454,7 @@ class Versions
|
||||||
|
|
||||||
// Return the version index to use for SYM.
|
// Return the version index to use for SYM.
|
||||||
unsigned int
|
unsigned int
|
||||||
version_index(const General_options*, const Stringpool*,
|
version_index(const Stringpool*, const Symbol* sym) const;
|
||||||
const Symbol* sym) const;
|
|
||||||
|
|
||||||
// We keep a hash table mapping canonicalized name/version pairs to
|
// We keep a hash table mapping canonicalized name/version pairs to
|
||||||
// a version base.
|
// a version base.
|
||||||
|
|
96
gold/i386.cc
96
gold/i386.cc
|
@ -5,6 +5,7 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "elfcpp.h"
|
#include "elfcpp.h"
|
||||||
|
#include "parameters.h"
|
||||||
#include "reloc.h"
|
#include "reloc.h"
|
||||||
#include "i386.h"
|
#include "i386.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
@ -51,7 +52,7 @@ class Target_i386 : public Sized_target<32, false>
|
||||||
|
|
||||||
// Finalize the sections.
|
// Finalize the sections.
|
||||||
void
|
void
|
||||||
do_finalize_sections(const General_options*, Layout*);
|
do_finalize_sections(Layout*);
|
||||||
|
|
||||||
// Relocate a section.
|
// Relocate a section.
|
||||||
void
|
void
|
||||||
|
@ -162,16 +163,15 @@ class Target_i386 : public Sized_target<32, false>
|
||||||
// Adjust TLS relocation type based on the options and whether this
|
// Adjust TLS relocation type based on the options and whether this
|
||||||
// is a local symbol.
|
// is a local symbol.
|
||||||
static unsigned int
|
static unsigned int
|
||||||
optimize_tls_reloc(const General_options*, bool is_final, int r_type);
|
optimize_tls_reloc(bool is_final, int r_type);
|
||||||
|
|
||||||
// Get the GOT section, creating it if necessary.
|
// Get the GOT section, creating it if necessary.
|
||||||
Output_data_got<32, false>*
|
Output_data_got<32, false>*
|
||||||
got_section(const General_options*, Symbol_table*, Layout*);
|
got_section(Symbol_table*, Layout*);
|
||||||
|
|
||||||
// Create a PLT entry for a global symbol.
|
// Create a PLT entry for a global symbol.
|
||||||
void
|
void
|
||||||
make_plt_entry(const General_options* options, Symbol_table*,
|
make_plt_entry(Symbol_table*, Layout*, Symbol*);
|
||||||
Layout*, Symbol*);
|
|
||||||
|
|
||||||
// Get the PLT section.
|
// Get the PLT section.
|
||||||
Output_data_plt_i386*
|
Output_data_plt_i386*
|
||||||
|
@ -226,14 +226,13 @@ const Target::Target_info Target_i386::i386_info =
|
||||||
// Get the GOT section, creating it if necessary.
|
// Get the GOT section, creating it if necessary.
|
||||||
|
|
||||||
Output_data_got<32, false>*
|
Output_data_got<32, false>*
|
||||||
Target_i386::got_section(const General_options* options, Symbol_table* symtab,
|
Target_i386::got_section(Symbol_table* symtab, Layout* layout)
|
||||||
Layout* layout)
|
|
||||||
{
|
{
|
||||||
if (this->got_ == NULL)
|
if (this->got_ == NULL)
|
||||||
{
|
{
|
||||||
gold_assert(options != NULL && symtab != NULL && layout != NULL);
|
gold_assert(symtab != NULL && layout != NULL);
|
||||||
|
|
||||||
this->got_ = new Output_data_got<32, false>(options);
|
this->got_ = new Output_data_got<32, false>();
|
||||||
|
|
||||||
layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
|
layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
|
||||||
elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE,
|
elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE,
|
||||||
|
@ -285,7 +284,7 @@ class Output_data_plt_i386 : public Output_section_data
|
||||||
public:
|
public:
|
||||||
typedef Output_data_reloc<elfcpp::SHT_REL, true, 32, false> Reloc_section;
|
typedef Output_data_reloc<elfcpp::SHT_REL, true, 32, false> Reloc_section;
|
||||||
|
|
||||||
Output_data_plt_i386(Layout*, Output_data_space*, bool is_shared);
|
Output_data_plt_i386(Layout*, Output_data_space*);
|
||||||
|
|
||||||
// Add an entry to the PLT.
|
// Add an entry to the PLT.
|
||||||
void
|
void
|
||||||
|
@ -331,8 +330,6 @@ class Output_data_plt_i386 : public Output_section_data
|
||||||
Output_data_space* got_plt_;
|
Output_data_space* got_plt_;
|
||||||
// The number of PLT entries.
|
// The number of PLT entries.
|
||||||
unsigned int count_;
|
unsigned int count_;
|
||||||
// Whether we are generated a shared object.
|
|
||||||
bool is_shared_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create the PLT section. The ordinary .got section is an argument,
|
// Create the PLT section. The ordinary .got section is an argument,
|
||||||
|
@ -340,9 +337,8 @@ class Output_data_plt_i386 : public Output_section_data
|
||||||
// section just for PLT entries.
|
// section just for PLT entries.
|
||||||
|
|
||||||
Output_data_plt_i386::Output_data_plt_i386(Layout* layout,
|
Output_data_plt_i386::Output_data_plt_i386(Layout* layout,
|
||||||
Output_data_space* got_plt,
|
Output_data_space* got_plt)
|
||||||
bool is_shared)
|
: Output_section_data(4), got_plt_(got_plt)
|
||||||
: Output_section_data(4), got_plt_(got_plt), is_shared_(is_shared)
|
|
||||||
{
|
{
|
||||||
this->rel_ = new Reloc_section();
|
this->rel_ = new Reloc_section();
|
||||||
layout->add_output_section_data(".rel.plt", elfcpp::SHT_REL,
|
layout->add_output_section_data(".rel.plt", elfcpp::SHT_REL,
|
||||||
|
@ -454,7 +450,7 @@ Output_data_plt_i386::do_write(Output_file* of)
|
||||||
elfcpp::Elf_types<32>::Elf_Addr plt_address = this->address();
|
elfcpp::Elf_types<32>::Elf_Addr plt_address = this->address();
|
||||||
elfcpp::Elf_types<32>::Elf_Addr got_address = this->got_plt_->address();
|
elfcpp::Elf_types<32>::Elf_Addr got_address = this->got_plt_->address();
|
||||||
|
|
||||||
if (this->is_shared_)
|
if (parameters->output_is_shared())
|
||||||
memcpy(pov, dyn_first_plt_entry, plt_entry_size);
|
memcpy(pov, dyn_first_plt_entry, plt_entry_size);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -486,7 +482,7 @@ Output_data_plt_i386::do_write(Output_file* of)
|
||||||
{
|
{
|
||||||
// Set and adjust the PLT entry itself.
|
// Set and adjust the PLT entry itself.
|
||||||
|
|
||||||
if (this->is_shared_)
|
if (parameters->output_is_shared())
|
||||||
{
|
{
|
||||||
memcpy(pov, dyn_plt_entry, plt_entry_size);
|
memcpy(pov, dyn_plt_entry, plt_entry_size);
|
||||||
elfcpp::Swap_unaligned<32, false>::writeval(pov + 2, got_offset);
|
elfcpp::Swap_unaligned<32, false>::writeval(pov + 2, got_offset);
|
||||||
|
@ -517,8 +513,7 @@ Output_data_plt_i386::do_write(Output_file* of)
|
||||||
// Create a PLT entry for a global symbol.
|
// Create a PLT entry for a global symbol.
|
||||||
|
|
||||||
void
|
void
|
||||||
Target_i386::make_plt_entry(const General_options* options,
|
Target_i386::make_plt_entry(Symbol_table* symtab, Layout* layout, Symbol* gsym)
|
||||||
Symbol_table* symtab, Layout* layout, Symbol* gsym)
|
|
||||||
{
|
{
|
||||||
if (gsym->has_plt_offset())
|
if (gsym->has_plt_offset())
|
||||||
return;
|
return;
|
||||||
|
@ -526,10 +521,9 @@ Target_i386::make_plt_entry(const General_options* options,
|
||||||
if (this->plt_ == NULL)
|
if (this->plt_ == NULL)
|
||||||
{
|
{
|
||||||
// Create the GOT sections first.
|
// Create the GOT sections first.
|
||||||
this->got_section(options, symtab, layout);
|
this->got_section(symtab, layout);
|
||||||
|
|
||||||
this->plt_ = new Output_data_plt_i386(layout, this->got_plt_,
|
this->plt_ = new Output_data_plt_i386(layout, this->got_plt_);
|
||||||
options->is_shared());
|
|
||||||
layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
|
layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
|
||||||
(elfcpp::SHF_ALLOC
|
(elfcpp::SHF_ALLOC
|
||||||
| elfcpp::SHF_EXECINSTR),
|
| elfcpp::SHF_EXECINSTR),
|
||||||
|
@ -629,13 +623,11 @@ Target_i386::copy_reloc(const General_options* options,
|
||||||
// known at link time.
|
// known at link time.
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
Target_i386::optimize_tls_reloc(const General_options* options,
|
Target_i386::optimize_tls_reloc(bool is_final, int r_type)
|
||||||
bool is_final,
|
|
||||||
int r_type)
|
|
||||||
{
|
{
|
||||||
// If we are generating a shared library, then we can't do anything
|
// If we are generating a shared library, then we can't do anything
|
||||||
// in the linker.
|
// in the linker.
|
||||||
if (options->is_shared())
|
if (parameters->output_is_shared())
|
||||||
return r_type;
|
return r_type;
|
||||||
|
|
||||||
switch (r_type)
|
switch (r_type)
|
||||||
|
@ -686,7 +678,7 @@ Target_i386::optimize_tls_reloc(const General_options* options,
|
||||||
// Scan a relocation for a local symbol.
|
// Scan a relocation for a local symbol.
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
Target_i386::Scan::local(const General_options& options,
|
Target_i386::Scan::local(const General_options&,
|
||||||
Symbol_table* symtab,
|
Symbol_table* symtab,
|
||||||
Layout* layout,
|
Layout* layout,
|
||||||
Target_i386* target,
|
Target_i386* target,
|
||||||
|
@ -708,7 +700,7 @@ Target_i386::Scan::local(const General_options& options,
|
||||||
case elfcpp::R_386_8:
|
case elfcpp::R_386_8:
|
||||||
// FIXME: If we are generating a shared object we need to copy
|
// FIXME: If we are generating a shared object we need to copy
|
||||||
// this relocation into the object.
|
// this relocation into the object.
|
||||||
gold_assert(!options.is_shared());
|
gold_assert(!parameters->output_is_shared());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case elfcpp::R_386_PC32:
|
case elfcpp::R_386_PC32:
|
||||||
|
@ -719,7 +711,7 @@ Target_i386::Scan::local(const General_options& options,
|
||||||
case elfcpp::R_386_GOTOFF:
|
case elfcpp::R_386_GOTOFF:
|
||||||
case elfcpp::R_386_GOTPC:
|
case elfcpp::R_386_GOTPC:
|
||||||
// We need a GOT section.
|
// We need a GOT section.
|
||||||
target->got_section(&options, symtab, layout);
|
target->got_section(symtab, layout);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case elfcpp::R_386_COPY:
|
case elfcpp::R_386_COPY:
|
||||||
|
@ -746,8 +738,9 @@ Target_i386::Scan::local(const General_options& options,
|
||||||
case elfcpp::R_386_TLS_LE_32:
|
case elfcpp::R_386_TLS_LE_32:
|
||||||
case elfcpp::R_386_TLS_GOTDESC:
|
case elfcpp::R_386_TLS_GOTDESC:
|
||||||
case elfcpp::R_386_TLS_DESC_CALL:
|
case elfcpp::R_386_TLS_DESC_CALL:
|
||||||
r_type = Target_i386::optimize_tls_reloc(&options,
|
{
|
||||||
!options.is_shared(),
|
bool output_is_executable = parameters->output_is_executable();
|
||||||
|
r_type = Target_i386::optimize_tls_reloc(output_is_executable,
|
||||||
r_type);
|
r_type);
|
||||||
switch (r_type)
|
switch (r_type)
|
||||||
{
|
{
|
||||||
|
@ -755,7 +748,7 @@ Target_i386::Scan::local(const General_options& options,
|
||||||
case elfcpp::R_386_TLS_LE_32:
|
case elfcpp::R_386_TLS_LE_32:
|
||||||
// FIXME: If generating a shared object, we need to copy
|
// FIXME: If generating a shared object, we need to copy
|
||||||
// this relocation into the object.
|
// this relocation into the object.
|
||||||
gold_assert(!options.is_shared());
|
gold_assert(output_is_executable);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case elfcpp::R_386_TLS_IE:
|
case elfcpp::R_386_TLS_IE:
|
||||||
|
@ -771,6 +764,7 @@ Target_i386::Scan::local(const General_options& options,
|
||||||
program_name, object->name().c_str(), r_type);
|
program_name, object->name().c_str(), r_type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case elfcpp::R_386_GOT32:
|
case elfcpp::R_386_GOT32:
|
||||||
|
@ -822,7 +816,7 @@ Target_i386::Scan::global(const General_options& options,
|
||||||
// copy this relocation into the object. If this symbol is
|
// copy this relocation into the object. If this symbol is
|
||||||
// defined in a shared object, we may need to copy this
|
// defined in a shared object, we may need to copy this
|
||||||
// relocation in order to avoid a COPY relocation.
|
// relocation in order to avoid a COPY relocation.
|
||||||
gold_assert(!options.is_shared());
|
gold_assert(!parameters->output_is_shared());
|
||||||
|
|
||||||
if (gsym->is_from_dynobj())
|
if (gsym->is_from_dynobj())
|
||||||
{
|
{
|
||||||
|
@ -830,7 +824,7 @@ Target_i386::Scan::global(const General_options& options,
|
||||||
// function, we make a PLT entry. Otherwise we need to
|
// function, we make a PLT entry. Otherwise we need to
|
||||||
// either generate a COPY reloc or copy this reloc.
|
// either generate a COPY reloc or copy this reloc.
|
||||||
if (gsym->type() == elfcpp::STT_FUNC)
|
if (gsym->type() == elfcpp::STT_FUNC)
|
||||||
target->make_plt_entry(&options, symtab, layout, gsym);
|
target->make_plt_entry(symtab, layout, gsym);
|
||||||
else
|
else
|
||||||
target->copy_reloc(&options, symtab, layout, object, data_shndx,
|
target->copy_reloc(&options, symtab, layout, object, data_shndx,
|
||||||
gsym, reloc);
|
gsym, reloc);
|
||||||
|
@ -841,13 +835,12 @@ Target_i386::Scan::global(const General_options& options,
|
||||||
case elfcpp::R_386_GOT32:
|
case elfcpp::R_386_GOT32:
|
||||||
{
|
{
|
||||||
// The symbol requires a GOT entry.
|
// The symbol requires a GOT entry.
|
||||||
Output_data_got<32, false>* got = target->got_section(&options, symtab,
|
Output_data_got<32, false>* got = target->got_section(symtab, layout);
|
||||||
layout);
|
|
||||||
if (got->add_global(gsym))
|
if (got->add_global(gsym))
|
||||||
{
|
{
|
||||||
// If this symbol is not fully resolved, we need to add a
|
// If this symbol is not fully resolved, we need to add a
|
||||||
// dynamic relocation for it.
|
// dynamic relocation for it.
|
||||||
if (!gsym->final_value_is_known(&options))
|
if (!gsym->final_value_is_known())
|
||||||
{
|
{
|
||||||
Reloc_section* rel_dyn = target->rel_dyn_section(layout);
|
Reloc_section* rel_dyn = target->rel_dyn_section(layout);
|
||||||
rel_dyn->add_global(gsym, elfcpp::R_386_GLOB_DAT, got,
|
rel_dyn->add_global(gsym, elfcpp::R_386_GLOB_DAT, got,
|
||||||
|
@ -860,15 +853,15 @@ Target_i386::Scan::global(const General_options& options,
|
||||||
case elfcpp::R_386_PLT32:
|
case elfcpp::R_386_PLT32:
|
||||||
// If the symbol is fully resolved, this is just a PC32 reloc.
|
// If the symbol is fully resolved, this is just a PC32 reloc.
|
||||||
// Otherwise we need a PLT entry.
|
// Otherwise we need a PLT entry.
|
||||||
if (gsym->final_value_is_known(&options))
|
if (gsym->final_value_is_known())
|
||||||
break;
|
break;
|
||||||
target->make_plt_entry(&options, symtab, layout, gsym);
|
target->make_plt_entry(symtab, layout, gsym);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case elfcpp::R_386_GOTOFF:
|
case elfcpp::R_386_GOTOFF:
|
||||||
case elfcpp::R_386_GOTPC:
|
case elfcpp::R_386_GOTPC:
|
||||||
// We need a GOT section.
|
// We need a GOT section.
|
||||||
target->got_section(&options, symtab, layout);
|
target->got_section(symtab, layout);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case elfcpp::R_386_COPY:
|
case elfcpp::R_386_COPY:
|
||||||
|
@ -896,15 +889,15 @@ Target_i386::Scan::global(const General_options& options,
|
||||||
case elfcpp::R_386_TLS_GOTDESC:
|
case elfcpp::R_386_TLS_GOTDESC:
|
||||||
case elfcpp::R_386_TLS_DESC_CALL:
|
case elfcpp::R_386_TLS_DESC_CALL:
|
||||||
{
|
{
|
||||||
const bool is_final = gsym->final_value_is_known(&options);
|
const bool is_final = gsym->final_value_is_known();
|
||||||
r_type = Target_i386::optimize_tls_reloc(&options, is_final, r_type);
|
r_type = Target_i386::optimize_tls_reloc(is_final, r_type);
|
||||||
switch (r_type)
|
switch (r_type)
|
||||||
{
|
{
|
||||||
case elfcpp::R_386_TLS_LE:
|
case elfcpp::R_386_TLS_LE:
|
||||||
case elfcpp::R_386_TLS_LE_32:
|
case elfcpp::R_386_TLS_LE_32:
|
||||||
// FIXME: If generating a shared object, we need to copy
|
// FIXME: If generating a shared object, we need to copy
|
||||||
// this relocation into the object.
|
// this relocation into the object.
|
||||||
gold_assert(!options.is_shared());
|
gold_assert(!parameters->output_is_shared());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case elfcpp::R_386_TLS_IE:
|
case elfcpp::R_386_TLS_IE:
|
||||||
|
@ -983,8 +976,7 @@ Target_i386::scan_relocs(const General_options& options,
|
||||||
// Finalize the sections.
|
// Finalize the sections.
|
||||||
|
|
||||||
void
|
void
|
||||||
Target_i386::do_finalize_sections(const General_options* options,
|
Target_i386::do_finalize_sections(Layout* layout)
|
||||||
Layout* layout)
|
|
||||||
{
|
{
|
||||||
// Fill in some more dynamic tags.
|
// Fill in some more dynamic tags.
|
||||||
Output_data_dynamic* const odyn = layout->dynamic_data();
|
Output_data_dynamic* const odyn = layout->dynamic_data();
|
||||||
|
@ -1010,7 +1002,7 @@ Target_i386::do_finalize_sections(const General_options* options,
|
||||||
elfcpp::Elf_sizes<32>::rel_size);
|
elfcpp::Elf_sizes<32>::rel_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!options->is_shared())
|
if (!parameters->output_is_shared())
|
||||||
{
|
{
|
||||||
// The value of the DT_DEBUG tag is filled in by the dynamic
|
// The value of the DT_DEBUG tag is filled in by the dynamic
|
||||||
// linker at run time, and used by the debugger.
|
// linker at run time, and used by the debugger.
|
||||||
|
@ -1106,7 +1098,7 @@ Target_i386::Relocate::relocate(const Relocate_info<32, false>* relinfo,
|
||||||
|
|
||||||
case elfcpp::R_386_PLT32:
|
case elfcpp::R_386_PLT32:
|
||||||
gold_assert(gsym->has_plt_offset()
|
gold_assert(gsym->has_plt_offset()
|
||||||
|| gsym->final_value_is_known(relinfo->options));
|
|| gsym->final_value_is_known());
|
||||||
Relocate_functions<32, false>::pcrel32(view, object, psymval, address);
|
Relocate_functions<32, false>::pcrel32(view, object, psymval, address);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1121,7 +1113,7 @@ Target_i386::Relocate::relocate(const Relocate_info<32, false>* relinfo,
|
||||||
{
|
{
|
||||||
elfcpp::Elf_types<32>::Elf_Addr value;
|
elfcpp::Elf_types<32>::Elf_Addr value;
|
||||||
value = (psymval->value(object, 0)
|
value = (psymval->value(object, 0)
|
||||||
- target->got_section(NULL, NULL, NULL)->address());
|
- target->got_section(NULL, NULL)->address());
|
||||||
Relocate_functions<32, false>::rel32(view, value);
|
Relocate_functions<32, false>::rel32(view, value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1129,7 +1121,7 @@ Target_i386::Relocate::relocate(const Relocate_info<32, false>* relinfo,
|
||||||
case elfcpp::R_386_GOTPC:
|
case elfcpp::R_386_GOTPC:
|
||||||
{
|
{
|
||||||
elfcpp::Elf_types<32>::Elf_Addr value;
|
elfcpp::Elf_types<32>::Elf_Addr value;
|
||||||
value = target->got_section(NULL, NULL, NULL)->address();
|
value = target->got_section(NULL, NULL)->address();
|
||||||
Relocate_functions<32, false>::pcrel32(view, value, address);
|
Relocate_functions<32, false>::pcrel32(view, value, address);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1211,10 +1203,10 @@ Target_i386::Relocate::relocate_tls(const Relocate_info<32, false>* relinfo,
|
||||||
elfcpp::Elf_types<32>::Elf_Addr value = psymval->value(relinfo->object, 0);
|
elfcpp::Elf_types<32>::Elf_Addr value = psymval->value(relinfo->object, 0);
|
||||||
|
|
||||||
const bool is_final = (gsym == NULL
|
const bool is_final = (gsym == NULL
|
||||||
? !relinfo->options->is_shared()
|
? !parameters->output_is_shared()
|
||||||
: gsym->final_value_is_known(relinfo->options));
|
: gsym->final_value_is_known());
|
||||||
const unsigned int opt_r_type =
|
const unsigned int opt_r_type =
|
||||||
Target_i386::optimize_tls_reloc(relinfo->options, is_final, r_type);
|
Target_i386::optimize_tls_reloc(is_final, r_type);
|
||||||
switch (r_type)
|
switch (r_type)
|
||||||
{
|
{
|
||||||
case elfcpp::R_386_TLS_LE_32:
|
case elfcpp::R_386_TLS_LE_32:
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include "parameters.h"
|
||||||
#include "output.h"
|
#include "output.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
#include "dynobj.h"
|
#include "dynobj.h"
|
||||||
|
@ -86,7 +87,7 @@ Layout::include_section(Object*, const char*,
|
||||||
case elfcpp::SHT_RELA:
|
case elfcpp::SHT_RELA:
|
||||||
case elfcpp::SHT_REL:
|
case elfcpp::SHT_REL:
|
||||||
case elfcpp::SHT_GROUP:
|
case elfcpp::SHT_GROUP:
|
||||||
return this->options_.is_relocatable();
|
return parameters->output_is_object();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// FIXME: Handle stripping debug sections here.
|
// FIXME: Handle stripping debug sections here.
|
||||||
|
@ -170,7 +171,7 @@ Layout::layout(Relobj* object, unsigned int shndx, const char* name,
|
||||||
// If we are not doing a relocateable link, choose the name to use
|
// If we are not doing a relocateable link, choose the name to use
|
||||||
// for the output section.
|
// for the output section.
|
||||||
size_t len = strlen(name);
|
size_t len = strlen(name);
|
||||||
if (!this->options_.is_relocatable())
|
if (!parameters->output_is_object())
|
||||||
name = Layout::output_section_name(name, &len);
|
name = Layout::output_section_name(name, &len);
|
||||||
|
|
||||||
// FIXME: Handle SHF_OS_NONCONFORMING here.
|
// FIXME: Handle SHF_OS_NONCONFORMING here.
|
||||||
|
@ -395,7 +396,7 @@ Layout::finalize(const Input_objects* input_objects, Symbol_table* symtab)
|
||||||
Target* const target = input_objects->target();
|
Target* const target = input_objects->target();
|
||||||
const int size = target->get_size();
|
const int size = target->get_size();
|
||||||
|
|
||||||
target->finalize_sections(&this->options_, this);
|
target->finalize_sections(this);
|
||||||
|
|
||||||
Output_segment* phdr_seg = NULL;
|
Output_segment* phdr_seg = NULL;
|
||||||
if (input_objects->any_dynamic())
|
if (input_objects->any_dynamic())
|
||||||
|
@ -453,7 +454,6 @@ Layout::finalize(const Input_objects* input_objects, Symbol_table* symtab)
|
||||||
Output_file_header* file_header;
|
Output_file_header* file_header;
|
||||||
file_header = new Output_file_header(size,
|
file_header = new Output_file_header(size,
|
||||||
big_endian,
|
big_endian,
|
||||||
this->options_,
|
|
||||||
target,
|
target,
|
||||||
symtab,
|
symtab,
|
||||||
segment_headers);
|
segment_headers);
|
||||||
|
@ -1057,8 +1057,8 @@ Layout::sized_create_version_sections(
|
||||||
unsigned char* vbuf;
|
unsigned char* vbuf;
|
||||||
unsigned int vsize;
|
unsigned int vsize;
|
||||||
versions->symbol_section_contents SELECT_SIZE_ENDIAN_NAME(size, big_endian)(
|
versions->symbol_section_contents SELECT_SIZE_ENDIAN_NAME(size, big_endian)(
|
||||||
&this->options_, &this->dynpool_, local_symcount, dynamic_symbols,
|
&this->dynpool_, local_symcount, dynamic_symbols, &vbuf, &vsize
|
||||||
&vbuf, &vsize SELECT_SIZE_ENDIAN(size, big_endian));
|
SELECT_SIZE_ENDIAN(size, big_endian));
|
||||||
|
|
||||||
Output_section_data* vdata = new Output_data_const_buffer(vbuf, vsize, 2);
|
Output_section_data* vdata = new Output_data_const_buffer(vbuf, vsize, 2);
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "gold.h"
|
#include "gold.h"
|
||||||
|
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
#include "parameters.h"
|
||||||
#include "dirsearch.h"
|
#include "dirsearch.h"
|
||||||
#include "workqueue.h"
|
#include "workqueue.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
@ -28,6 +29,7 @@ main(int argc, char** argv)
|
||||||
// Handle the command line options.
|
// Handle the command line options.
|
||||||
Command_line command_line;
|
Command_line command_line;
|
||||||
command_line.process(argc - 1, argv + 1);
|
command_line.process(argc - 1, argv + 1);
|
||||||
|
initialize_parameters(&command_line.options());
|
||||||
|
|
||||||
// The work queue.
|
// The work queue.
|
||||||
Workqueue workqueue(command_line.options());
|
Workqueue workqueue(command_line.options());
|
||||||
|
|
|
@ -386,8 +386,7 @@ Sized_relobj<size, big_endian>::include_linkonce_section(
|
||||||
|
|
||||||
template<int size, bool big_endian>
|
template<int size, bool big_endian>
|
||||||
void
|
void
|
||||||
Sized_relobj<size, big_endian>::do_layout(const General_options& options,
|
Sized_relobj<size, big_endian>::do_layout(Symbol_table* symtab,
|
||||||
Symbol_table* symtab,
|
|
||||||
Layout* layout,
|
Layout* layout,
|
||||||
Read_symbols_data* sd)
|
Read_symbols_data* sd)
|
||||||
{
|
{
|
||||||
|
@ -427,7 +426,7 @@ Sized_relobj<size, big_endian>::do_layout(const General_options& options,
|
||||||
|
|
||||||
if (this->handle_gnu_warning_section(name, i, symtab))
|
if (this->handle_gnu_warning_section(name, i, symtab))
|
||||||
{
|
{
|
||||||
if (!options.is_relocatable())
|
if (!parameters->output_is_object())
|
||||||
omit[i] = true;
|
omit[i] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -171,9 +171,8 @@ class Object
|
||||||
// Pass sections which should be included in the link to the Layout
|
// Pass sections which should be included in the link to the Layout
|
||||||
// object, and record where the sections go in the output file.
|
// object, and record where the sections go in the output file.
|
||||||
void
|
void
|
||||||
layout(const General_options& options, Symbol_table* symtab,
|
layout(Symbol_table* symtab, Layout* layout, Read_symbols_data* sd)
|
||||||
Layout* layout, Read_symbols_data* sd)
|
{ this->do_layout(symtab, layout, sd); }
|
||||||
{ this->do_layout(options, symtab, layout, sd); }
|
|
||||||
|
|
||||||
// Add symbol information to the global symbol table.
|
// Add symbol information to the global symbol table.
|
||||||
void
|
void
|
||||||
|
@ -233,8 +232,7 @@ class Object
|
||||||
|
|
||||||
// Lay out sections--implemented by child class.
|
// Lay out sections--implemented by child class.
|
||||||
virtual void
|
virtual void
|
||||||
do_layout(const General_options&, Symbol_table*, Layout*,
|
do_layout(Symbol_table*, Layout*, Read_symbols_data*) = 0;
|
||||||
Read_symbols_data*) = 0;
|
|
||||||
|
|
||||||
// Add symbol information to the global symbol table--implemented by
|
// Add symbol information to the global symbol table--implemented by
|
||||||
// child class.
|
// child class.
|
||||||
|
@ -589,8 +587,7 @@ class Sized_relobj : public Relobj
|
||||||
|
|
||||||
// Lay out the input sections.
|
// Lay out the input sections.
|
||||||
void
|
void
|
||||||
do_layout(const General_options&, Symbol_table*, Layout*,
|
do_layout(Symbol_table*, Layout*, Read_symbols_data*);
|
||||||
Read_symbols_data*);
|
|
||||||
|
|
||||||
// Add the symbols to the symbol table.
|
// Add the symbols to the symbol table.
|
||||||
void
|
void
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "parameters.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
#include "reloc.h"
|
#include "reloc.h"
|
||||||
|
@ -226,13 +227,11 @@ Output_segment_headers::do_sized_write(Output_file* of)
|
||||||
|
|
||||||
Output_file_header::Output_file_header(int size,
|
Output_file_header::Output_file_header(int size,
|
||||||
bool big_endian,
|
bool big_endian,
|
||||||
const General_options& options,
|
|
||||||
const Target* target,
|
const Target* target,
|
||||||
const Symbol_table* symtab,
|
const Symbol_table* symtab,
|
||||||
const Output_segment_headers* osh)
|
const Output_segment_headers* osh)
|
||||||
: size_(size),
|
: size_(size),
|
||||||
big_endian_(big_endian),
|
big_endian_(big_endian),
|
||||||
options_(options),
|
|
||||||
target_(target),
|
target_(target),
|
||||||
symtab_(symtab),
|
symtab_(symtab),
|
||||||
segment_header_(osh),
|
segment_header_(osh),
|
||||||
|
@ -316,7 +315,7 @@ Output_file_header::do_sized_write(Output_file* of)
|
||||||
|
|
||||||
elfcpp::ET e_type;
|
elfcpp::ET e_type;
|
||||||
// FIXME: ET_DYN.
|
// FIXME: ET_DYN.
|
||||||
if (this->options_.is_relocatable())
|
if (parameters->output_is_object())
|
||||||
e_type = elfcpp::ET_REL;
|
e_type = elfcpp::ET_REL;
|
||||||
else
|
else
|
||||||
e_type = elfcpp::ET_EXEC;
|
e_type = elfcpp::ET_EXEC;
|
||||||
|
@ -564,9 +563,7 @@ Output_data_reloc_base<sh_type, dynamic, size, big_endian>::do_write(
|
||||||
|
|
||||||
template<int size, bool big_endian>
|
template<int size, bool big_endian>
|
||||||
void
|
void
|
||||||
Output_data_got<size, big_endian>::Got_entry::write(
|
Output_data_got<size, big_endian>::Got_entry::write(unsigned char* pov) const
|
||||||
const General_options* options,
|
|
||||||
unsigned char* pov) const
|
|
||||||
{
|
{
|
||||||
Valtype val = 0;
|
Valtype val = 0;
|
||||||
|
|
||||||
|
@ -580,7 +577,7 @@ Output_data_got<size, big_endian>::Got_entry::write(
|
||||||
// value. Otherwise we just write zero. The target code is
|
// value. Otherwise we just write zero. The target code is
|
||||||
// responsible for creating a relocation entry to fill in the
|
// responsible for creating a relocation entry to fill in the
|
||||||
// value at runtime.
|
// value at runtime.
|
||||||
if (gsym->final_value_is_known(options))
|
if (gsym->final_value_is_known())
|
||||||
{
|
{
|
||||||
Sized_symbol<size>* sgsym;
|
Sized_symbol<size>* sgsym;
|
||||||
// This cast is a bit ugly. We don't want to put a
|
// This cast is a bit ugly. We don't want to put a
|
||||||
|
@ -639,7 +636,7 @@ Output_data_got<size, big_endian>::do_write(Output_file* of)
|
||||||
p != this->entries_.end();
|
p != this->entries_.end();
|
||||||
++p)
|
++p)
|
||||||
{
|
{
|
||||||
p->write(this->options_, pov);
|
p->write(pov);
|
||||||
pov += add;
|
pov += add;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1546,7 +1543,7 @@ Output_file::open(off_t file_size)
|
||||||
{
|
{
|
||||||
this->file_size_ = file_size;
|
this->file_size_ = file_size;
|
||||||
|
|
||||||
int mode = this->options_.is_relocatable() ? 0666 : 0777;
|
int mode = parameters->output_is_object() ? 0666 : 0777;
|
||||||
int o = ::open(this->name_, O_RDWR | O_CREAT | O_TRUNC, mode);
|
int o = ::open(this->name_, O_RDWR | O_CREAT | O_TRUNC, mode);
|
||||||
if (o < 0)
|
if (o < 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -248,7 +248,6 @@ class Output_file_header : public Output_data
|
||||||
public:
|
public:
|
||||||
Output_file_header(int size,
|
Output_file_header(int size,
|
||||||
bool big_endian,
|
bool big_endian,
|
||||||
const General_options&,
|
|
||||||
const Target*,
|
const Target*,
|
||||||
const Symbol_table*,
|
const Symbol_table*,
|
||||||
const Output_segment_headers*);
|
const Output_segment_headers*);
|
||||||
|
@ -281,7 +280,6 @@ class Output_file_header : public Output_data
|
||||||
|
|
||||||
int size_;
|
int size_;
|
||||||
bool big_endian_;
|
bool big_endian_;
|
||||||
const General_options& options_;
|
|
||||||
const Target* target_;
|
const Target* target_;
|
||||||
const Symbol_table* symtab_;
|
const Symbol_table* symtab_;
|
||||||
const Output_segment_headers* segment_header_;
|
const Output_segment_headers* segment_header_;
|
||||||
|
@ -892,9 +890,8 @@ class Output_data_got : public Output_section_data
|
||||||
public:
|
public:
|
||||||
typedef typename elfcpp::Elf_types<size>::Elf_Addr Valtype;
|
typedef typename elfcpp::Elf_types<size>::Elf_Addr Valtype;
|
||||||
|
|
||||||
Output_data_got(const General_options* options)
|
Output_data_got()
|
||||||
: Output_section_data(Output_data::default_alignment(size)),
|
: Output_section_data(Output_data::default_alignment(size)), entries_()
|
||||||
options_(options), entries_()
|
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
// Add an entry for a global symbol to the GOT. Return true if this
|
// Add an entry for a global symbol to the GOT. Return true if this
|
||||||
|
@ -958,7 +955,7 @@ class Output_data_got : public Output_section_data
|
||||||
|
|
||||||
// Write the GOT entry to an output view.
|
// Write the GOT entry to an output view.
|
||||||
void
|
void
|
||||||
write(const General_options*, unsigned char* pov) const;
|
write(unsigned char* pov) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum
|
enum
|
||||||
|
@ -998,8 +995,6 @@ class Output_data_got : public Output_section_data
|
||||||
set_got_size()
|
set_got_size()
|
||||||
{ this->set_data_size(this->got_offset(this->entries_.size())); }
|
{ this->set_data_size(this->got_offset(this->entries_.size())); }
|
||||||
|
|
||||||
// Options.
|
|
||||||
const General_options* options_;
|
|
||||||
// The list of GOT entries.
|
// The list of GOT entries.
|
||||||
Got_entries entries_;
|
Got_entries entries_;
|
||||||
};
|
};
|
||||||
|
|
36
gold/parameters.cc
Normal file
36
gold/parameters.cc
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
// parameters.cc -- general parameters for a link using gold
|
||||||
|
|
||||||
|
#include "gold.h"
|
||||||
|
|
||||||
|
#include "options.h"
|
||||||
|
#include "parameters.h"
|
||||||
|
|
||||||
|
namespace gold
|
||||||
|
{
|
||||||
|
|
||||||
|
// Initialize the parameters from the options.
|
||||||
|
|
||||||
|
Parameters::Parameters(const General_options* options)
|
||||||
|
: optimization_level_(options->optimization_level())
|
||||||
|
{
|
||||||
|
if (options->is_shared())
|
||||||
|
this->output_file_type_ = OUTPUT_SHARED;
|
||||||
|
else if (options->is_relocatable())
|
||||||
|
this->output_file_type_ = OUTPUT_OBJECT;
|
||||||
|
else
|
||||||
|
this->output_file_type_ = OUTPUT_EXECUTABLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The global variable.
|
||||||
|
|
||||||
|
const Parameters* parameters;
|
||||||
|
|
||||||
|
// Initialize the global variable.
|
||||||
|
|
||||||
|
void
|
||||||
|
initialize_parameters(const General_options* options)
|
||||||
|
{
|
||||||
|
parameters = new Parameters(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // End namespace gold.
|
70
gold/parameters.h
Normal file
70
gold/parameters.h
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
// parameters.h -- general parameters for a link using gold -*- C++ -*-
|
||||||
|
|
||||||
|
#ifndef GOLD_PARAMETERS_H
|
||||||
|
#define GOLD_PARAMETERS_H
|
||||||
|
|
||||||
|
namespace gold
|
||||||
|
{
|
||||||
|
|
||||||
|
class General_options;
|
||||||
|
|
||||||
|
// Here we define the Parameters class which simply holds simple
|
||||||
|
// general parameters which apply to the entire link. We use a global
|
||||||
|
// variable for this. This is in contrast to the General_options
|
||||||
|
// class, which holds the complete state of position independent
|
||||||
|
// command line options. The hope is that Parameters will stay fairly
|
||||||
|
// simple, so that if this turns into a library it will be clear how
|
||||||
|
// these parameters should be set.
|
||||||
|
|
||||||
|
class Parameters
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Parameters(const General_options*);
|
||||||
|
|
||||||
|
// Whether we are generating a regular executable.
|
||||||
|
bool
|
||||||
|
output_is_executable() const
|
||||||
|
{ return this->output_file_type_ == OUTPUT_EXECUTABLE; }
|
||||||
|
|
||||||
|
// Whether we are generating a shared library.
|
||||||
|
bool
|
||||||
|
output_is_shared() const
|
||||||
|
{ return this->output_file_type_ == OUTPUT_SHARED; }
|
||||||
|
|
||||||
|
// Whether we are generating an object file.
|
||||||
|
bool
|
||||||
|
output_is_object() const
|
||||||
|
{ return this->output_file_type_ == OUTPUT_OBJECT; }
|
||||||
|
|
||||||
|
// The general linker optimization level.
|
||||||
|
int
|
||||||
|
optimization_level() const
|
||||||
|
{ return this->optimization_level_; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
// The types of output files.
|
||||||
|
enum Output_file_type
|
||||||
|
{
|
||||||
|
// Generating executable.
|
||||||
|
OUTPUT_EXECUTABLE,
|
||||||
|
// Generating shared library.
|
||||||
|
OUTPUT_SHARED,
|
||||||
|
// Generating object file.
|
||||||
|
OUTPUT_OBJECT
|
||||||
|
};
|
||||||
|
|
||||||
|
// The type of the output file.
|
||||||
|
Output_file_type output_file_type_;
|
||||||
|
// The optimization level.
|
||||||
|
int optimization_level_;
|
||||||
|
};
|
||||||
|
|
||||||
|
// This is a global variable.
|
||||||
|
extern const Parameters* parameters;
|
||||||
|
|
||||||
|
// Initialize the global variable.
|
||||||
|
extern void initialize_parameters(const General_options*);
|
||||||
|
|
||||||
|
} // End namespace gold.
|
||||||
|
|
||||||
|
#endif // !defined(GOLD_PARAMATERS_H)
|
|
@ -25,6 +25,8 @@ options.cc
|
||||||
options.h
|
options.h
|
||||||
output.cc
|
output.cc
|
||||||
output.h
|
output.h
|
||||||
|
parameters.cc
|
||||||
|
parameters.h
|
||||||
readsyms.cc
|
readsyms.cc
|
||||||
readsyms.h
|
readsyms.h
|
||||||
reloc.cc
|
reloc.cc
|
||||||
|
|
221
gold/po/gold.pot
221
gold/po/gold.pot
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2007-05-16 10:40-0700\n"
|
"POT-Creation-Date: 2007-09-21 00:18-0700\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -16,42 +16,47 @@ msgstr ""
|
||||||
"Content-Type: text/plain; charset=CHARSET\n"
|
"Content-Type: text/plain; charset=CHARSET\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
#: archive.cc:62
|
#: archive.cc:69
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: no archive symbol table (run ranlib)\n"
|
msgid "%s: %s: no archive symbol table (run ranlib)\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: archive.cc:91
|
#: archive.cc:121
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: bad archive symbol table names\n"
|
msgid "%s: %s: bad archive symbol table names\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: archive.cc:129
|
#: archive.cc:153
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s; %s: malformed archive header at %ld\n"
|
msgid "%s; %s: malformed archive header at %ld\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: archive.cc:150
|
#: archive.cc:174
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: malformed archive header size at %ld\n"
|
msgid "%s: %s: malformed archive header size at %ld\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: archive.cc:162
|
#: archive.cc:186
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: malformed archive header name at %ld\n"
|
msgid "%s: %s: malformed archive header name at %ld\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: archive.cc:188
|
#: archive.cc:212
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: bad extended name index at %ld\n"
|
msgid "%s: %s: bad extended name index at %ld\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: archive.cc:199
|
#: archive.cc:223
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: bad extended name entry at header %ld\n"
|
msgid "%s: %s: bad extended name entry at header %ld\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: archive.cc:280 archive.cc:293
|
#: archive.cc:318
|
||||||
|
#, c-format
|
||||||
|
msgid "%s: %s: short archive header at %ld\n"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: archive.cc:367 archive.cc:380
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: member at %ld is not an ELF object"
|
msgid "%s: %s: member at %ld is not an ELF object"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -61,47 +66,47 @@ msgstr ""
|
||||||
msgid "can not read directory %s"
|
msgid "can not read directory %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dynobj.cc:109
|
#: dynobj.cc:110
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: unexpected duplicate type %u section: %u, %u\n"
|
msgid "%s: %s: unexpected duplicate type %u section: %u, %u\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dynobj.cc:150
|
#: dynobj.cc:151
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: unexpected link in section %u header: %u != %u\n"
|
msgid "%s: %s: unexpected link in section %u header: %u != %u\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dynobj.cc:188
|
#: dynobj.cc:189
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: DYNAMIC section %u link out of range: %u\n"
|
msgid "%s: %s: DYNAMIC section %u link out of range: %u\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dynobj.cc:198
|
#: dynobj.cc:199
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: DYNAMIC section %u link %u is not a strtab\n"
|
msgid "%s: %s: DYNAMIC section %u link %u is not a strtab\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dynobj.cc:220
|
#: dynobj.cc:221
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: DT_SONAME value out of range: %lld >= %lld\n"
|
msgid "%s: %s: DT_SONAME value out of range: %lld >= %lld\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dynobj.cc:237
|
#: dynobj.cc:238
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: missing DT_NULL in dynamic segment\n"
|
msgid "%s: %s: missing DT_NULL in dynamic segment\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dynobj.cc:285
|
#: dynobj.cc:286
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: invalid dynamic symbol table name index: %u\n"
|
msgid "%s: %s: invalid dynamic symbol table name index: %u\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dynobj.cc:293
|
#: dynobj.cc:294
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: dynamic symbol table name section has wrong type: %u\n"
|
msgid "%s: %s: dynamic symbol table name section has wrong type: %u\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dynobj.cc:368 object.cc:420
|
#: dynobj.cc:368 object.cc:419
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: bad section name offset for section %u: %lu\n"
|
msgid "%s: %s: bad section name offset for section %u: %lu\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -166,7 +171,7 @@ msgstr ""
|
||||||
msgid "%s: %s: size of dynamic symbols is not multiple of symbol size\n"
|
msgid "%s: %s: size of dynamic symbols is not multiple of symbol size\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: dynobj.cc:1241
|
#: dynobj.cc:1244
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: symbol %s has undefined version %s\n"
|
msgid "%s: symbol %s has undefined version %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -250,57 +255,57 @@ msgid "pthread_cond_signal failed"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. FIXME: This needs to specify the location somehow.
|
#. FIXME: This needs to specify the location somehow.
|
||||||
#: i386.cc:100
|
#: i386.cc:105
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: missing expected TLS relocation\n"
|
msgid "%s: missing expected TLS relocation\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: i386.cc:729 i386.cc:870 i386.cc:1136
|
#: i386.cc:726 i386.cc:876 i386.cc:1138
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: unexpected reloc %u in object file\n"
|
msgid "%s: %s: unexpected reloc %u in object file\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: i386.cc:765 i386.cc:784
|
#: i386.cc:763 i386.cc:783
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: unsupported reloc %u against local symbol\n"
|
msgid "%s: %s: unsupported reloc %u against local symbol\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: i386.cc:906 i386.cc:927
|
#: i386.cc:912 i386.cc:933
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: unsupported reloc %u against global symbol %s\n"
|
msgid "%s: %s: unsupported reloc %u against global symbol %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: i386.cc:950
|
#: i386.cc:956
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: unsupported RELA reloc section\n"
|
msgid "%s: %s: unsupported RELA reloc section\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: i386.cc:1041
|
#: i386.cc:1046
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: missing expected TLS relocation\n"
|
msgid "%s: %s: missing expected TLS relocation\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: i386.cc:1168 i386.cc:1245 i386.cc:1256
|
#: i386.cc:1170 i386.cc:1247 i386.cc:1258
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: unsupported reloc %u\n"
|
msgid "%s: %s: unsupported reloc %u\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: i386.cc:1195
|
#: i386.cc:1197
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: TLS reloc but no TLS segment\n"
|
msgid "%s: %s: TLS reloc but no TLS segment\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: i386.cc:1230
|
#: i386.cc:1232
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: unsupported reloc type %u\n"
|
msgid "%s: %s: unsupported reloc type %u\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: i386.cc:1439
|
#: i386.cc:1441
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: TLS relocation out of range\n"
|
msgid "%s: %s: TLS relocation out of range\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: i386.cc:1457
|
#: i386.cc:1459
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: TLS relocation against invalid instruction\n"
|
msgid "%s: %s: TLS relocation against invalid instruction\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -376,7 +381,7 @@ msgstr ""
|
||||||
msgid "%s: %s: unsupported ELF file type %d\n"
|
msgid "%s: %s: unsupported ELF file type %d\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: object.cc:853 object.cc:906 object.cc:927
|
#: object.cc:853 object.cc:906 object.cc:941
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: ELF file too short\n"
|
msgid "%s: %s: ELF file too short\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -411,6 +416,26 @@ msgstr ""
|
||||||
msgid "%s: %s: unsupported ELF data encoding %d\n"
|
msgid "%s: %s: unsupported ELF data encoding %d\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: object.cc:918
|
||||||
|
#, c-format
|
||||||
|
msgid "%s: %s: not configured to support 32-bit big-endian object\n"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: object.cc:931
|
||||||
|
#, c-format
|
||||||
|
msgid "%s: %s: not configured to support 32-bit little-endian object\n"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: object.cc:953
|
||||||
|
#, c-format
|
||||||
|
msgid "%s: %s: not configured to support 64-bit big-endian object\n"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: object.cc:966
|
||||||
|
#, c-format
|
||||||
|
msgid "%s: %s: not configured to support 64-bit little-endian object\n"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:115
|
#: options.cc:115
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -418,141 +443,181 @@ msgid ""
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:227
|
#: options.cc:230
|
||||||
msgid "Search for library LIBNAME"
|
msgid "Search for library LIBNAME"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:228
|
#: options.cc:231
|
||||||
msgid "-lLIBNAME --library LIBNAME"
|
msgid "-lLIBNAME, --library LIBNAME"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:230
|
#: options.cc:233
|
||||||
msgid "Start a library search group"
|
msgid "Start a library search group"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:232
|
#: options.cc:235
|
||||||
msgid "End a library search group"
|
msgid "End a library search group"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:234
|
#: options.cc:237
|
||||||
|
msgid "Export all dynamic symbols"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: options.cc:239
|
||||||
msgid "Set dynamic linker path"
|
msgid "Set dynamic linker path"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:235
|
#: options.cc:240
|
||||||
msgid "-I PROGRAM, --dynamic-linker PROGRAM"
|
msgid "-I PROGRAM, --dynamic-linker PROGRAM"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:237
|
#: options.cc:242
|
||||||
msgid "Add directory to search path"
|
msgid "Add directory to search path"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:238
|
#: options.cc:243
|
||||||
msgid "-L DIR, --library-path DIR"
|
msgid "-L DIR, --library-path DIR"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:240
|
#: options.cc:245
|
||||||
msgid "Ignored for compatibility"
|
msgid "Ignored for compatibility"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:242
|
#: options.cc:247
|
||||||
|
msgid "Optimize output file size"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: options.cc:248
|
||||||
|
msgid "-O level"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: options.cc:250
|
||||||
msgid "Set output file name"
|
msgid "Set output file name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:243
|
#: options.cc:251
|
||||||
msgid "-o FILE, --output FILE"
|
msgid "-o FILE, --output FILE"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:245
|
#: options.cc:253
|
||||||
msgid "Generate relocatable output"
|
msgid "Generate relocatable output"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:247
|
#: options.cc:255
|
||||||
|
msgid "Add DIR to runtime search path"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: options.cc:256
|
||||||
|
msgid "-R DIR, -rpath DIR"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: options.cc:258
|
||||||
|
msgid "Create exception frame header"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: options.cc:261
|
||||||
|
msgid "Add DIR to link time shared library search path"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: options.cc:262
|
||||||
|
msgid "--rpath-link DIR"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: options.cc:264
|
||||||
msgid "Generate shared library"
|
msgid "Generate shared library"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:249
|
#: options.cc:266
|
||||||
msgid "Do not link against shared libraries"
|
msgid "Do not link against shared libraries"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:252
|
#: options.cc:269
|
||||||
msgid "Only set DT_NEEDED for following dynamic libs if used"
|
msgid "Only set DT_NEEDED for dynamic libs if used"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:255
|
#: options.cc:272
|
||||||
msgid "Always DT_NEEDED for following dynamic libs (default)"
|
msgid "Always DT_NEEDED for dynamic libs (default)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:257
|
#: options.cc:275
|
||||||
|
msgid "Include all archive contents"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: options.cc:279
|
||||||
|
msgid "Include only needed archive contents"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: options.cc:282
|
||||||
msgid "Report usage information"
|
msgid "Report usage information"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:393 options.cc:444 options.cc:523
|
#: options.cc:425 options.cc:476 options.cc:555
|
||||||
msgid "missing argument"
|
msgid "missing argument"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:406 options.cc:453
|
#: options.cc:438 options.cc:485
|
||||||
msgid "unknown option"
|
msgid "unknown option"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:461
|
#: options.cc:493
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: missing group end"
|
msgid "%s: missing group end"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:536
|
#: options.cc:568
|
||||||
msgid "may not nest groups"
|
msgid "may not nest groups"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:546
|
#: options.cc:578
|
||||||
msgid "group end without group start"
|
msgid "group end without group start"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:556
|
#: options.cc:588
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: use the --help option for usage information\n"
|
msgid "%s: use the --help option for usage information\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:565 script.cc:1133
|
#: options.cc:597 script.cc:1133
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: %s\n"
|
msgid "%s: %s: %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: options.cc:574
|
#: options.cc:606
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: -%c: %s\n"
|
msgid "%s: -%c: %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: output.cc:903
|
#: output.cc:901
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: invalid alignment %lu for section \"%s\"\n"
|
msgid "%s: %s: invalid alignment %lu for section \"%s\"\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: output.cc:1519
|
#: output.cc:1550
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: open: %s\n"
|
msgid "%s: %s: open: %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: output.cc:1528
|
#: output.cc:1559
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: lseek: %s\n"
|
msgid "%s: %s: lseek: %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: output.cc:1535
|
#: output.cc:1566
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: write: %s\n"
|
msgid "%s: %s: write: %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: output.cc:1545
|
#: output.cc:1576
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: mmap: %s\n"
|
msgid "%s: %s: mmap: %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: output.cc:1559
|
#: output.cc:1590
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: munmap: %s\n"
|
msgid "%s: %s: munmap: %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: output.cc:1567
|
#: output.cc:1598
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: close: %s\n"
|
msgid "%s: %s: close: %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -562,13 +627,13 @@ msgstr ""
|
||||||
msgid "%s: %s: ordinary object found in input group\n"
|
msgid "%s: %s: ordinary object found in input group\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: readsyms.cc:136
|
#: readsyms.cc:134
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: file is empty\n"
|
msgid "%s: %s: file is empty\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. Here we have to handle any other input file types we need.
|
#. Here we have to handle any other input file types we need.
|
||||||
#: readsyms.cc:149
|
#: readsyms.cc:147
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: not an object or archive\n"
|
msgid "%s: %s: not an object or archive\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -593,52 +658,52 @@ msgstr ""
|
||||||
msgid "%s: %s: reloc section %u size %lu uneven"
|
msgid "%s: %s: reloc section %u size %lu uneven"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: resolve.cc:147
|
#: resolve.cc:117
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: invalid STB_LOCAL symbol %s in external symbols\n"
|
msgid "%s: %s: invalid STB_LOCAL symbol %s in external symbols\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: resolve.cc:153
|
#: resolve.cc:123
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: unsupported symbol binding %d for symbol %s\n"
|
msgid "%s: %s: unsupported symbol binding %d for symbol %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: symtab.cc:450 symtab.cc:547
|
#: symtab.cc:456 symtab.cc:553
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: mixing 32-bit and 64-bit ELF objects\n"
|
msgid "%s: %s: mixing 32-bit and 64-bit ELF objects\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: symtab.cc:467
|
#: symtab.cc:473
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: bad global symbol name offset %u at %lu\n"
|
msgid "%s: %s: bad global symbol name offset %u at %lu\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: symtab.cc:554
|
#: symtab.cc:560
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: too few symbol versions\n"
|
msgid "%s: %s: too few symbol versions\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: symtab.cc:574
|
#: symtab.cc:580
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: bad symbol name offset %u at %lu\n"
|
msgid "%s: %s: bad symbol name offset %u at %lu\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: symtab.cc:618
|
#: symtab.cc:633
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: versym for symbol %zu out of range: %u\n"
|
msgid "%s: %s: versym for symbol %zu out of range: %u\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: symtab.cc:626
|
#: symtab.cc:641
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: versym for symbol %zu has no name: %u\n"
|
msgid "%s: %s: versym for symbol %zu has no name: %u\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: symtab.cc:1106 symtab.cc:1278
|
#: symtab.cc:1174 symtab.cc:1346
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: unsupported symbol section 0x%x\n"
|
msgid "%s: %s: unsupported symbol section 0x%x\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: symtab.cc:1471
|
#: symtab.cc:1539
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s: %s: warning: %s\n"
|
msgid "%s: %s: warning: %s\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
|
@ -97,8 +97,7 @@ Read_symbols::run(Workqueue* workqueue)
|
||||||
|
|
||||||
Read_symbols_data* sd = new Read_symbols_data;
|
Read_symbols_data* sd = new Read_symbols_data;
|
||||||
obj->read_symbols(sd);
|
obj->read_symbols(sd);
|
||||||
workqueue->queue_front(new Add_symbols(this->options_,
|
workqueue->queue_front(new Add_symbols(this->input_objects_,
|
||||||
this->input_objects_,
|
|
||||||
this->symtab_, this->layout_,
|
this->symtab_, this->layout_,
|
||||||
obj, sd,
|
obj, sd,
|
||||||
this->this_blocker_,
|
this->this_blocker_,
|
||||||
|
@ -119,8 +118,7 @@ Read_symbols::run(Workqueue* workqueue)
|
||||||
Archive* arch = new Archive(this->input_argument_->file().name(),
|
Archive* arch = new Archive(this->input_argument_->file().name(),
|
||||||
input_file);
|
input_file);
|
||||||
arch->setup();
|
arch->setup();
|
||||||
workqueue->queue(new Add_archive_symbols(this->options_,
|
workqueue->queue(new Add_archive_symbols(this->symtab_,
|
||||||
this->symtab_,
|
|
||||||
this->layout_,
|
this->layout_,
|
||||||
this->input_objects_,
|
this->input_objects_,
|
||||||
arch,
|
arch,
|
||||||
|
@ -182,8 +180,7 @@ Read_symbols::do_group(Workqueue* workqueue)
|
||||||
}
|
}
|
||||||
|
|
||||||
const int saw_undefined = this->symtab_->saw_undefined();
|
const int saw_undefined = this->symtab_->saw_undefined();
|
||||||
workqueue->queue(new Finish_group(this->options_,
|
workqueue->queue(new Finish_group(this->input_objects_,
|
||||||
this->input_objects_,
|
|
||||||
this->symtab_,
|
this->symtab_,
|
||||||
this->layout_,
|
this->layout_,
|
||||||
input_group,
|
input_group,
|
||||||
|
@ -247,8 +244,7 @@ Add_symbols::run(Workqueue*)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->object_->layout(this->options_, this->symtab_, this->layout_,
|
this->object_->layout(this->symtab_, this->layout_, this->sd_);
|
||||||
this->sd_);
|
|
||||||
this->object_->add_symbols(this->symtab_, this->sd_);
|
this->object_->add_symbols(this->symtab_, this->sd_);
|
||||||
}
|
}
|
||||||
delete this->sd_;
|
delete this->sd_;
|
||||||
|
@ -297,7 +293,7 @@ Finish_group::run(Workqueue*)
|
||||||
{
|
{
|
||||||
Task_lock_obj<Archive> tl(**p);
|
Task_lock_obj<Archive> tl(**p);
|
||||||
|
|
||||||
(*p)->add_symbols(this->options_, this->symtab_, this->layout_,
|
(*p)->add_symbols(this->symtab_, this->layout_,
|
||||||
this->input_objects_);
|
this->input_objects_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,12 +83,12 @@ class Add_symbols : public Task
|
||||||
// THIS_BLOCKER is used to prevent this task from running before the
|
// THIS_BLOCKER is used to prevent this task from running before the
|
||||||
// one for the previous input file. NEXT_BLOCKER is used to prevent
|
// one for the previous input file. NEXT_BLOCKER is used to prevent
|
||||||
// the next task from running.
|
// the next task from running.
|
||||||
Add_symbols(const General_options& options, Input_objects* input_objects,
|
Add_symbols(Input_objects* input_objects, Symbol_table* symtab,
|
||||||
Symbol_table* symtab, Layout* layout, Object* object,
|
Layout* layout, Object* object,
|
||||||
Read_symbols_data* sd, Task_token* this_blocker,
|
Read_symbols_data* sd, Task_token* this_blocker,
|
||||||
Task_token* next_blocker)
|
Task_token* next_blocker)
|
||||||
: options_(options), input_objects_(input_objects), symtab_(symtab),
|
: input_objects_(input_objects), symtab_(symtab), layout_(layout),
|
||||||
layout_(layout), object_(object), sd_(sd), this_blocker_(this_blocker),
|
object_(object), sd_(sd), this_blocker_(this_blocker),
|
||||||
next_blocker_(next_blocker)
|
next_blocker_(next_blocker)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -108,7 +108,6 @@ class Add_symbols : public Task
|
||||||
private:
|
private:
|
||||||
class Add_symbols_locker;
|
class Add_symbols_locker;
|
||||||
|
|
||||||
const General_options& options_;
|
|
||||||
Input_objects* input_objects_;
|
Input_objects* input_objects_;
|
||||||
Symbol_table* symtab_;
|
Symbol_table* symtab_;
|
||||||
Layout* layout_;
|
Layout* layout_;
|
||||||
|
@ -155,11 +154,11 @@ class Input_group
|
||||||
class Finish_group : public Task
|
class Finish_group : public Task
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Finish_group(const General_options& options, Input_objects* input_objects,
|
Finish_group(Input_objects* input_objects, Symbol_table* symtab,
|
||||||
Symbol_table* symtab, Layout* layout, Input_group* input_group,
|
Layout* layout, Input_group* input_group,
|
||||||
int saw_undefined, Task_token* this_blocker,
|
int saw_undefined, Task_token* this_blocker,
|
||||||
Task_token* next_blocker)
|
Task_token* next_blocker)
|
||||||
: options_(options), input_objects_(input_objects), symtab_(symtab),
|
: input_objects_(input_objects), symtab_(symtab),
|
||||||
layout_(layout), input_group_(input_group),
|
layout_(layout), input_group_(input_group),
|
||||||
saw_undefined_(saw_undefined), this_blocker_(this_blocker),
|
saw_undefined_(saw_undefined), this_blocker_(this_blocker),
|
||||||
next_blocker_(next_blocker)
|
next_blocker_(next_blocker)
|
||||||
|
@ -179,7 +178,6 @@ class Finish_group : public Task
|
||||||
run(Workqueue*);
|
run(Workqueue*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const General_options& options_;
|
|
||||||
Input_objects* input_objects_;
|
Input_objects* input_objects_;
|
||||||
Symbol_table* symtab_;
|
Symbol_table* symtab_;
|
||||||
Layout* layout_;
|
Layout* layout_;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "elfcpp.h"
|
#include "elfcpp.h"
|
||||||
|
#include "parameters.h"
|
||||||
#include "stringpool.h"
|
#include "stringpool.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
|
|
||||||
|
@ -305,9 +306,9 @@ class Symbol
|
||||||
// Return true if the final value of this symbol is known at link
|
// Return true if the final value of this symbol is known at link
|
||||||
// time.
|
// time.
|
||||||
bool
|
bool
|
||||||
final_value_is_known(const General_options* options) const
|
final_value_is_known() const
|
||||||
{
|
{
|
||||||
if (options->is_shared())
|
if (parameters->output_is_shared())
|
||||||
return false;
|
return false;
|
||||||
return this->source_ != FROM_OBJECT || !this->object()->is_dynamic();
|
return this->source_ != FROM_OBJECT || !this->object()->is_dynamic();
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,8 +91,8 @@ class Target
|
||||||
// This is called to tell the target to complete any sections it is
|
// This is called to tell the target to complete any sections it is
|
||||||
// handling. After this all sections must have their final size.
|
// handling. After this all sections must have their final size.
|
||||||
void
|
void
|
||||||
finalize_sections(const General_options* options, Layout* layout)
|
finalize_sections(Layout* layout)
|
||||||
{ return this->do_finalize_sections(options, layout); }
|
{ return this->do_finalize_sections(layout); }
|
||||||
|
|
||||||
// Return a string to use to fill out a code section. This is
|
// Return a string to use to fill out a code section. This is
|
||||||
// basically one or more NOPS which must fill out the specified
|
// basically one or more NOPS which must fill out the specified
|
||||||
|
@ -135,7 +135,7 @@ class Target
|
||||||
|
|
||||||
// Virtual function which may be implemented by the child class.
|
// Virtual function which may be implemented by the child class.
|
||||||
virtual void
|
virtual void
|
||||||
do_finalize_sections(const General_options*, Layout*)
|
do_finalize_sections(Layout*)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
// Virtual function which must be implemented by the child class if
|
// Virtual function which must be implemented by the child class if
|
||||||
|
|
Loading…
Reference in a new issue