+2009-10-28 Ian Lance Taylor <iant@google.com>
+
+ * object.h (class Relobj): Drop options parameter from
+ gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
+ do_scan_relocs, do_relocate. Change all callers.
+ (class Sized_relobj): Drop options parameters from
+ do_gc_process_relocs, do_scan_relocs, do_relocate,
+ do_relocate_sections, relocate_sections, emit_relocs_scan,
+ emit_relocs_scan_reltype. Change all callers.
+ (struct Relocate_info): Remove options field and all references to
+ it.
+ * reloc.h (class Read_relocs): Remove options constructor
+ parameter and options_ field. Change all callers.
+ (class Gc_process_relocs, class Scan_relocs): Likewise.
+ (class Relocate_task): Likewise.
+ * target-reloc.h (scan_relocs): Remove options parameter. Change
+ all callers.
+ (scan_relocatable_relocs): Likewise.
+ * target.h (class Sized_target): Remove options parameter from
+ gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
+ all callers.
+ * gc.h (gc_process_relocs): Remove options parameter. Change all
+ callers.
+ * arm.cc: Update functions to remove options parameters.
+ * i386.cc: Likewise.
+ * powerpc.cc: Likewise.
+ * sparc.cc: Likewise.
+ * x86_64.cc: Likewise.
+ * testsuite/testfile.cc: Likewise.
+
2009-10-28 Doug Kwan <dougkwan@google.com>
* arm.cc (Arm_relobj): New class definition.
// Process the relocations to determine unreferenced sections for
// garbage collection.
void
- gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
+ gc_process_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, big_endian>* object,
unsigned int data_shndx,
// Scan the relocations to look for symbol adjustments.
void
- scan_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, big_endian>* object,
unsigned int data_shndx,
// Scan the relocs during a relocatable link.
void
- scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocatable_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, big_endian>* object,
unsigned int data_shndx,
{ }
inline void
- local(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_arm* target,
+ local(Symbol_table* symtab, Layout* layout, Target_arm* target,
Sized_relobj<32, big_endian>* object,
unsigned int data_shndx,
Output_section* output_section,
const elfcpp::Sym<32, big_endian>& lsym);
inline void
- global(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_arm* target,
+ global(Symbol_table* symtab, Layout* layout, Target_arm* target,
Sized_relobj<32, big_endian>* object,
unsigned int data_shndx,
Output_section* output_section,
const Relobj::Output_sections& out_sections(this->output_sections());
Relocate_info<32, big_endian> relinfo;
- relinfo.options = ¶meters->options();
relinfo.symtab = symtab;
relinfo.layout = layout;
relinfo.object = this;
template<bool big_endian>
inline void
-Target_arm<big_endian>::Scan::local(const General_options&,
- Symbol_table* symtab,
+Target_arm<big_endian>::Scan::local(Symbol_table* symtab,
Layout* layout,
Target_arm* target,
Sized_relobj<32, big_endian>* object,
template<bool big_endian>
inline void
-Target_arm<big_endian>::Scan::global(const General_options&,
- Symbol_table* symtab,
+Target_arm<big_endian>::Scan::global(Symbol_table* symtab,
Layout* layout,
Target_arm* target,
Sized_relobj<32, big_endian>* object,
template<bool big_endian>
void
-Target_arm<big_endian>::gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
+Target_arm<big_endian>::gc_process_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, big_endian>* object,
unsigned int data_shndx,
typedef typename Target_arm<big_endian>::Scan Scan;
gold::gc_process_relocs<32, big_endian, Arm, elfcpp::SHT_REL, Scan>(
- options,
symtab,
layout,
this,
template<bool big_endian>
void
-Target_arm<big_endian>::scan_relocs(const General_options& options,
- Symbol_table* symtab,
+Target_arm<big_endian>::scan_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, big_endian>* object,
unsigned int data_shndx,
}
gold::scan_relocs<32, big_endian, Target_arm, elfcpp::SHT_REL, Scan>(
- options,
symtab,
layout,
this,
template<bool big_endian>
void
Target_arm<big_endian>::scan_relocatable_relocs(
- const General_options& options,
Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, big_endian>* object,
gold::scan_relocatable_relocs<32, big_endian, elfcpp::SHT_REL,
Scan_relocatable_relocs>(
- options,
symtab,
layout,
object,
typename Scan>
inline void
gc_process_relocs(
- const General_options& ,
Symbol_table* symtab,
Layout*,
Target_type* ,
|| parameters->options().icf_enabled())
{
workqueue->queue(new Task_function(new Gc_runner(options,
- input_objects,
+ input_objects,
symtab,
layout,
mapfile),
{
// We can read and process the relocations in any order.
blocker->add_blocker();
- workqueue->queue(new Read_relocs(options, symtab, layout, *p,
- symtab_lock, blocker));
+ workqueue->queue(new Read_relocs(symtab, layout, *p, symtab_lock,
+ blocker));
}
Task_token* this_blocker = new Task_token(true);
++p)
{
blocker->add_blocker();
- workqueue->queue(new Scan_relocs(options, symtab, layout, *p,
- (*p)->get_relocs_data(),symtab_lock, blocker));
+ workqueue->queue(new Scan_relocs(symtab, layout, *p,
+ (*p)->get_relocs_data(),
+ symtab_lock, blocker));
}
}
else
// relocations. That task will in turn queue a task to wait
// until it can write to the symbol table.
blocker->add_blocker();
- workqueue->queue(new Read_relocs(options, symtab, layout, *p,
- symtab_lock, blocker));
+ workqueue->queue(new Read_relocs(symtab, layout, *p, symtab_lock,
+ blocker));
}
}
if (input_sections_blocker != NULL)
input_sections_blocker->add_blocker();
final_blocker->add_blocker();
- workqueue->queue(new Relocate_task(options, symtab, layout, *p, of,
+ workqueue->queue(new Relocate_task(symtab, layout, *p, of,
input_sections_blocker,
output_sections_blocker,
final_blocker));
// Process the relocations to determine unreferenced sections for
// garbage collection.
void
- gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
+ gc_process_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, false>* object,
unsigned int data_shndx,
// Scan the relocations to look for symbol adjustments.
void
- scan_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, false>* object,
unsigned int data_shndx,
// Scan the relocs during a relocatable link.
void
- scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocatable_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, false>* object,
unsigned int data_shndx,
struct Scan
{
inline void
- local(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_i386* target,
+ local(Symbol_table* symtab, Layout* layout, Target_i386* target,
Sized_relobj<32, false>* object,
unsigned int data_shndx,
Output_section* output_section,
const elfcpp::Sym<32, false>& lsym);
inline void
- global(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_i386* target,
+ global(Symbol_table* symtab, Layout* layout, Target_i386* target,
Sized_relobj<32, false>* object,
unsigned int data_shndx,
Output_section* output_section,
// Scan a relocation for a local symbol.
inline void
-Target_i386::Scan::local(const General_options&,
- Symbol_table* symtab,
+Target_i386::Scan::local(Symbol_table* symtab,
Layout* layout,
Target_i386* target,
Sized_relobj<32, false>* object,
// Scan a relocation for a global symbol.
inline void
-Target_i386::Scan::global(const General_options&,
- Symbol_table* symtab,
+Target_i386::Scan::global(Symbol_table* symtab,
Layout* layout,
Target_i386* target,
Sized_relobj<32, false>* object,
// Process relocations for gc.
void
-Target_i386::gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
+Target_i386::gc_process_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, false>* object,
unsigned int data_shndx,
{
gold::gc_process_relocs<32, false, Target_i386, elfcpp::SHT_REL,
Target_i386::Scan>(
- options,
symtab,
layout,
this,
// Scan relocations for a section.
void
-Target_i386::scan_relocs(const General_options& options,
- Symbol_table* symtab,
+Target_i386::scan_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, false>* object,
unsigned int data_shndx,
gold::scan_relocs<32, false, Target_i386, elfcpp::SHT_REL,
Target_i386::Scan>(
- options,
symtab,
layout,
this,
// Scan the relocs during a relocatable link.
void
-Target_i386::scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
+Target_i386::scan_relocatable_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<32, false>* object,
unsigned int data_shndx,
gold::scan_relocatable_relocs<32, false, elfcpp::SHT_REL,
Scan_relocatable_relocs>(
- options,
symtab,
layout,
object,
// Process the relocs, during garbage collection only.
void
- gc_process_relocs(const General_options& options, Symbol_table* symtab,
- Layout* layout, Read_relocs_data* rd)
- { return this->do_gc_process_relocs(options, symtab, layout, rd); }
+ gc_process_relocs(Symbol_table* symtab, Layout* layout, Read_relocs_data* rd)
+ { return this->do_gc_process_relocs(symtab, layout, rd); }
// Scan the relocs and adjust the symbol table.
void
- scan_relocs(const General_options& options, Symbol_table* symtab,
- Layout* layout, Read_relocs_data* rd)
- { return this->do_scan_relocs(options, symtab, layout, rd); }
+ scan_relocs(Symbol_table* symtab, Layout* layout, Read_relocs_data* rd)
+ { return this->do_scan_relocs(symtab, layout, rd); }
// The number of local symbols in the input symbol table.
virtual unsigned int
// Relocate the input sections and write out the local symbols.
void
- relocate(const General_options& options, const Symbol_table* symtab,
- const Layout* layout, Output_file* of)
- { return this->do_relocate(options, symtab, layout, of); }
+ relocate(const Symbol_table* symtab, const Layout* layout, Output_file* of)
+ { return this->do_relocate(symtab, layout, of); }
// Return whether an input section is being included in the link.
bool
// Process the relocs--implemented by child class.
virtual void
- do_gc_process_relocs(const General_options&, Symbol_table*, Layout*,
- Read_relocs_data*) = 0;
+ do_gc_process_relocs(Symbol_table*, Layout*, Read_relocs_data*) = 0;
// Scan the relocs--implemented by child class.
virtual void
- do_scan_relocs(const General_options&, Symbol_table*, Layout*,
- Read_relocs_data*) = 0;
+ do_scan_relocs(Symbol_table*, Layout*, Read_relocs_data*) = 0;
// Return the number of local symbols--implemented by child class.
virtual unsigned int
// Relocate the input sections and write out the local
// symbols--implemented by child class.
virtual void
- do_relocate(const General_options& options, const Symbol_table* symtab,
- const Layout*, Output_file* of) = 0;
+ do_relocate(const Symbol_table* symtab, const Layout*, Output_file* of) = 0;
// Get the offset of a section--implemented by child class.
virtual uint64_t
// Process the relocs to find list of referenced sections. Used only
// during garbage collection.
void
- do_gc_process_relocs(const General_options&, Symbol_table*, Layout*,
- Read_relocs_data*);
+ do_gc_process_relocs(Symbol_table*, Layout*, Read_relocs_data*);
// Scan the relocs and adjust the symbol table.
void
- do_scan_relocs(const General_options&, Symbol_table*, Layout*,
- Read_relocs_data*);
+ do_scan_relocs(Symbol_table*, Layout*, Read_relocs_data*);
// Count the local symbols.
void
// Relocate the input sections and write out the local symbols.
void
- do_relocate(const General_options& options, const Symbol_table* symtab,
- const Layout*, Output_file* of);
+ do_relocate(const Symbol_table* symtab, const Layout*, Output_file* of);
// Get the size of a section.
uint64_t
// This may be overriden by a child class.
virtual void
- do_relocate_sections(const General_options& options,
- const Symbol_table* symtab, const Layout* layout,
+ do_relocate_sections(const Symbol_table* symtab, const Layout* layout,
const unsigned char* pshdrs, Views* pviews);
private:
// Relocate the sections in the output file.
void
- relocate_sections(const General_options& options, const Symbol_table* symtab,
- const Layout* layout, const unsigned char* pshdrs,
- Views* pviews)
- { this->do_relocate_sections(options, symtab, layout, pshdrs, pviews); }
+ relocate_sections(const Symbol_table* symtab, const Layout* layout,
+ const unsigned char* pshdrs, Views* pviews)
+ { this->do_relocate_sections(symtab, layout, pshdrs, pviews); }
// Scan the input relocations for --emit-relocs.
void
- emit_relocs_scan(const General_options&, Symbol_table*, Layout*,
- const unsigned char* plocal_syms,
+ emit_relocs_scan(Symbol_table*, Layout*, const unsigned char* plocal_syms,
const Read_relocs_data::Relocs_list::iterator&);
// Scan the input relocations for --emit-relocs, templatized on the
// type of the relocation section.
template<int sh_type>
void
- emit_relocs_scan_reltype(const General_options&, Symbol_table*, Layout*,
+ emit_relocs_scan_reltype(Symbol_table*, Layout*,
const unsigned char* plocal_syms,
const Read_relocs_data::Relocs_list::iterator&,
Relocatable_relocs*);
template<int size, bool big_endian>
struct Relocate_info
{
- // Command line options.
- const General_options* options;
// Symbol table.
const Symbol_table* symtab;
// Layout.
// Process the relocations to determine unreferenced sections for
// garbage collection.
void
- gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
+ gc_process_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
// Scan the relocations to look for symbol adjustments.
void
- scan_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
// Scan the relocs during a relocatable link.
void
- scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocatable_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
{ }
inline void
- local(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_powerpc* target,
+ local(Symbol_table* symtab, Layout* layout, Target_powerpc* target,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
Output_section* output_section,
const elfcpp::Sym<size, big_endian>& lsym);
inline void
- global(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_powerpc* target,
+ global(Symbol_table* symtab, Layout* layout, Target_powerpc* target,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
Output_section* output_section,
template<int size, bool big_endian>
inline void
Target_powerpc<size, big_endian>::Scan::local(
- const General_options&,
Symbol_table* symtab,
Layout* layout,
Target_powerpc<size, big_endian>* target,
template<int size, bool big_endian>
inline void
Target_powerpc<size, big_endian>::Scan::global(
- const General_options&,
Symbol_table* symtab,
Layout* layout,
Target_powerpc<size, big_endian>* target,
template<int size, bool big_endian>
void
Target_powerpc<size, big_endian>::gc_process_relocs(
- const General_options& options,
Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
typedef typename Target_powerpc<size, big_endian>::Scan Scan;
gold::gc_process_relocs<size, big_endian, Powerpc, elfcpp::SHT_RELA, Scan>(
- options,
symtab,
layout,
this,
template<int size, bool big_endian>
void
Target_powerpc<size, big_endian>::scan_relocs(
- const General_options& options,
Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
}
gold::scan_relocs<size, big_endian, Powerpc, elfcpp::SHT_RELA, Scan>(
- options,
symtab,
layout,
this,
template<int size, bool big_endian>
void
Target_powerpc<size, big_endian>::scan_relocatable_relocs(
- const General_options& options,
Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
gold::scan_relocatable_relocs<size, big_endian, elfcpp::SHT_RELA,
Scan_relocatable_relocs>(
- options,
symtab,
layout,
object,
if (parameters->options().gc_sections()
|| parameters->options().icf_enabled())
{
- workqueue->queue_next(new Gc_process_relocs(this->options_,
- this->symtab_,
+ workqueue->queue_next(new Gc_process_relocs(this->symtab_,
this->layout_,
this->object_, rd,
this->symtab_lock_,
}
else
{
- workqueue->queue_next(new Scan_relocs(this->options_, this->symtab_,
- this->layout_, this->object_, rd,
+ workqueue->queue_next(new Scan_relocs(this->symtab_, this->layout_,
+ this->object_, rd,
this->symtab_lock_,
this->blocker_));
}
void
Gc_process_relocs::run(Workqueue*)
{
- this->object_->gc_process_relocs(this->options_, this->symtab_, this->layout_,
- this->rd_);
+ this->object_->gc_process_relocs(this->symtab_, this->layout_, this->rd_);
this->object_->release();
}
void
Scan_relocs::run(Workqueue*)
{
- this->object_->scan_relocs(this->options_, this->symtab_, this->layout_,
- this->rd_);
+ this->object_->scan_relocs(this->symtab_, this->layout_, this->rd_);
this->object_->release();
delete this->rd_;
this->rd_ = NULL;
void
Relocate_task::run(Workqueue*)
{
- this->object_->relocate(this->options_, this->symtab_, this->layout_,
- this->of_);
+ this->object_->relocate(this->symtab_, this->layout_, this->of_);
// This is normally the last thing we will do with an object, so
// uncache all views.
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::do_gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Read_relocs_data* rd)
+Sized_relobj<size, big_endian>::do_gc_process_relocs(Symbol_table* symtab,
+ Layout* layout,
+ Read_relocs_data* rd)
{
Sized_target<size, big_endian>* target =
parameters->sized_target<size, big_endian>();
// only scan allocated sections. We may see a non-allocated
// section here if we are emitting relocs.
if (p->is_data_section_allocated)
- target->gc_process_relocs(options, symtab, layout, this,
+ target->gc_process_relocs(symtab, layout, this,
p->data_shndx, p->sh_type,
p->contents->data(), p->reloc_count,
p->output_section,
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::do_scan_relocs(const General_options& options,
- Symbol_table* symtab,
+Sized_relobj<size, big_endian>::do_scan_relocs(Symbol_table* symtab,
Layout* layout,
Read_relocs_data* rd)
{
// only scan allocated sections. We may see a non-allocated
// section here if we are emitting relocs.
if (p->is_data_section_allocated)
- target->scan_relocs(options, symtab, layout, this, p->data_shndx,
+ target->scan_relocs(symtab, layout, this, p->data_shndx,
p->sh_type, p->contents->data(),
p->reloc_count, p->output_section,
p->needs_special_offset_handling,
this->local_symbol_count_,
local_symbols);
if (parameters->options().emit_relocs())
- this->emit_relocs_scan(options, symtab, layout, local_symbols, p);
+ this->emit_relocs_scan(symtab, layout, local_symbols, p);
}
else
{
Relocatable_relocs* rr = this->relocatable_relocs(p->reloc_shndx);
gold_assert(rr != NULL);
rr->set_reloc_count(p->reloc_count);
- target->scan_relocatable_relocs(options, symtab, layout, this,
+ target->scan_relocatable_relocs(symtab, layout, this,
p->data_shndx, p->sh_type,
p->contents->data(),
p->reloc_count,
template<int size, bool big_endian>
void
Sized_relobj<size, big_endian>::emit_relocs_scan(
- const General_options& options,
Symbol_table* symtab,
Layout* layout,
const unsigned char* plocal_syms,
rr->set_reloc_count(p->reloc_count);
if (p->sh_type == elfcpp::SHT_REL)
- this->emit_relocs_scan_reltype<elfcpp::SHT_REL>(options, symtab, layout,
+ this->emit_relocs_scan_reltype<elfcpp::SHT_REL>(symtab, layout,
plocal_syms, p, rr);
else
{
gold_assert(p->sh_type == elfcpp::SHT_RELA);
- this->emit_relocs_scan_reltype<elfcpp::SHT_RELA>(options, symtab,
- layout, plocal_syms, p,
- rr);
+ this->emit_relocs_scan_reltype<elfcpp::SHT_RELA>(symtab, layout,
+ plocal_syms, p, rr);
}
}
template<int sh_type>
void
Sized_relobj<size, big_endian>::emit_relocs_scan_reltype(
- const General_options& options,
Symbol_table* symtab,
Layout* layout,
const unsigned char* plocal_syms,
{
scan_relocatable_relocs<size, big_endian, sh_type,
Emit_relocs_strategy<sh_type> >(
- options,
symtab,
layout,
this,
template<int size, bool big_endian>
void
-Sized_relobj<size, big_endian>::do_relocate(const General_options& options,
- const Symbol_table* symtab,
+Sized_relobj<size, big_endian>::do_relocate(const Symbol_table* symtab,
const Layout* layout,
Output_file* of)
{
// Apply relocations.
- this->relocate_sections(options, symtab, layout, pshdrs, &views);
+ this->relocate_sections(symtab, layout, pshdrs, &views);
// After we've done the relocations, we release the hash tables,
// since we no longer need them.
template<int size, bool big_endian>
void
Sized_relobj<size, big_endian>::do_relocate_sections(
- const General_options& options,
const Symbol_table* symtab,
const Layout* layout,
const unsigned char* pshdrs,
const std::vector<Address>& out_offsets(this->section_offsets_);
Relocate_info<size, big_endian> relinfo;
- relinfo.options = &options;
relinfo.symtab = symtab;
relinfo.layout = layout;
relinfo.object = this;
#ifdef HAVE_TARGET_32_LITTLE
template
void
-Sized_relobj<32, false>::do_gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Read_relocs_data* rd);
+Sized_relobj<32, false>::do_gc_process_relocs(Symbol_table* symtab,
+ Layout* layout,
+ Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
-Sized_relobj<32, true>::do_gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Read_relocs_data* rd);
+Sized_relobj<32, true>::do_gc_process_relocs(Symbol_table* symtab,
+ Layout* layout,
+ Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
-Sized_relobj<64, false>::do_gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Read_relocs_data* rd);
+Sized_relobj<64, false>::do_gc_process_relocs(Symbol_table* symtab,
+ Layout* layout,
+ Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
-Sized_relobj<64, true>::do_gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Read_relocs_data* rd);
+Sized_relobj<64, true>::do_gc_process_relocs(Symbol_table* symtab,
+ Layout* layout,
+ Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
void
-Sized_relobj<32, false>::do_scan_relocs(const General_options& options,
- Symbol_table* symtab,
+Sized_relobj<32, false>::do_scan_relocs(Symbol_table* symtab,
Layout* layout,
Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
-Sized_relobj<32, true>::do_scan_relocs(const General_options& options,
- Symbol_table* symtab,
+Sized_relobj<32, true>::do_scan_relocs(Symbol_table* symtab,
Layout* layout,
Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
-Sized_relobj<64, false>::do_scan_relocs(const General_options& options,
- Symbol_table* symtab,
+Sized_relobj<64, false>::do_scan_relocs(Symbol_table* symtab,
Layout* layout,
Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
-Sized_relobj<64, true>::do_scan_relocs(const General_options& options,
- Symbol_table* symtab,
+Sized_relobj<64, true>::do_scan_relocs(Symbol_table* symtab,
Layout* layout,
Read_relocs_data* rd);
#endif
#ifdef HAVE_TARGET_32_LITTLE
template
void
-Sized_relobj<32, false>::do_relocate(const General_options& options,
- const Symbol_table* symtab,
+Sized_relobj<32, false>::do_relocate(const Symbol_table* symtab,
const Layout* layout,
Output_file* of);
#endif
#ifdef HAVE_TARGET_32_BIG
template
void
-Sized_relobj<32, true>::do_relocate(const General_options& options,
- const Symbol_table* symtab,
+Sized_relobj<32, true>::do_relocate(const Symbol_table* symtab,
const Layout* layout,
Output_file* of);
#endif
#ifdef HAVE_TARGET_64_LITTLE
template
void
-Sized_relobj<64, false>::do_relocate(const General_options& options,
- const Symbol_table* symtab,
+Sized_relobj<64, false>::do_relocate(const Symbol_table* symtab,
const Layout* layout,
Output_file* of);
#endif
#ifdef HAVE_TARGET_64_BIG
template
void
-Sized_relobj<64, true>::do_relocate(const General_options& options,
- const Symbol_table* symtab,
+Sized_relobj<64, true>::do_relocate(const Symbol_table* symtab,
const Layout* layout,
Output_file* of);
#endif
template
void
Sized_relobj<32, false>::do_relocate_sections(
- const General_options& options,
const Symbol_table* symtab,
const Layout* layout,
const unsigned char* pshdrs,
template
void
Sized_relobj<32, true>::do_relocate_sections(
- const General_options& options,
const Symbol_table* symtab,
const Layout* layout,
const unsigned char* pshdrs,
template
void
Sized_relobj<64, false>::do_relocate_sections(
- const General_options& options,
const Symbol_table* symtab,
const Layout* layout,
const unsigned char* pshdrs,
template
void
Sized_relobj<64, true>::do_relocate_sections(
- const General_options& options,
const Symbol_table* symtab,
const Layout* layout,
const unsigned char* pshdrs,
public:
// SYMTAB_LOCK is used to lock the symbol table. BLOCKER should be
// unblocked when the Scan_relocs task completes.
- Read_relocs(const General_options& options, Symbol_table* symtab,
- Layout* layout, Relobj* object, Task_token* symtab_lock,
- Task_token* blocker)
- : options_(options), symtab_(symtab), layout_(layout), object_(object),
+ Read_relocs(Symbol_table* symtab, Layout* layout, Relobj* object,
+ Task_token* symtab_lock, Task_token* blocker)
+ : symtab_(symtab), layout_(layout), object_(object),
symtab_lock_(symtab_lock), blocker_(blocker)
{ }
get_name() const;
private:
- const General_options& options_;
Symbol_table* symtab_;
Layout* layout_;
Relobj* object_;
public:
// SYMTAB_LOCK is used to lock the symbol table. BLOCKER should be
// unblocked when the task completes.
- Gc_process_relocs(const General_options& options, Symbol_table* symtab,
- Layout* layout, Relobj* object, Read_relocs_data* rd,
- Task_token* symtab_lock, Task_token* blocker)
- : options_(options), symtab_(symtab), layout_(layout), object_(object),
- rd_(rd), symtab_lock_(symtab_lock), blocker_(blocker)
+ Gc_process_relocs(Symbol_table* symtab, Layout* layout, Relobj* object,
+ Read_relocs_data* rd, Task_token* symtab_lock,
+ Task_token* blocker)
+ : symtab_(symtab), layout_(layout), object_(object), rd_(rd),
+ symtab_lock_(symtab_lock), blocker_(blocker)
{ }
// The standard Task methods.
get_name() const;
private:
- const General_options& options_;
Symbol_table* symtab_;
Layout* layout_;
Relobj* object_;
public:
// SYMTAB_LOCK is used to lock the symbol table. BLOCKER should be
// unblocked when the task completes.
- Scan_relocs(const General_options& options, Symbol_table* symtab,
- Layout* layout, Relobj* object, Read_relocs_data* rd,
- Task_token* symtab_lock, Task_token* blocker)
- : options_(options), symtab_(symtab), layout_(layout), object_(object),
- rd_(rd), symtab_lock_(symtab_lock), blocker_(blocker)
+ Scan_relocs(Symbol_table* symtab, Layout* layout, Relobj* object,
+ Read_relocs_data* rd, Task_token* symtab_lock,
+ Task_token* blocker)
+ : symtab_(symtab), layout_(layout), object_(object), rd_(rd),
+ symtab_lock_(symtab_lock), blocker_(blocker)
{ }
// The standard Task methods.
get_name() const;
private:
- const General_options& options_;
Symbol_table* symtab_;
Layout* layout_;
Relobj* object_;
class Relocate_task : public Task
{
public:
- Relocate_task(const General_options& options, const Symbol_table* symtab,
- const Layout* layout, Relobj* object, Output_file* of,
+ Relocate_task(const Symbol_table* symtab, const Layout* layout,
+ Relobj* object, Output_file* of,
Task_token* input_sections_blocker,
Task_token* output_sections_blocker, Task_token* final_blocker)
- : options_(options), symtab_(symtab), layout_(layout), object_(object),
- of_(of), input_sections_blocker_(input_sections_blocker),
+ : symtab_(symtab), layout_(layout), object_(object), of_(of),
+ input_sections_blocker_(input_sections_blocker),
output_sections_blocker_(output_sections_blocker),
final_blocker_(final_blocker)
{ }
get_name() const;
private:
- const General_options& options_;
const Symbol_table* symtab_;
const Layout* layout_;
Relobj* object_;
// Process the relocations to determine unreferenced sections for
// garbage collection.
void
- gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
+ gc_process_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
// Scan the relocations to look for symbol adjustments.
void
- scan_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
// Scan the relocs during a relocatable link.
void
- scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocatable_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
{ }
inline void
- local(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_sparc* target,
+ local(Symbol_table* symtab, Layout* layout, Target_sparc* target,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
Output_section* output_section,
const elfcpp::Sym<size, big_endian>& lsym);
inline void
- global(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_sparc* target,
+ global(Symbol_table* symtab, Layout* layout, Target_sparc* target,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
Output_section* output_section,
template<int size, bool big_endian>
inline void
Target_sparc<size, big_endian>::Scan::local(
- const General_options&,
Symbol_table* symtab,
Layout* layout,
Target_sparc<size, big_endian>* target,
template<int size, bool big_endian>
inline void
Target_sparc<size, big_endian>::Scan::global(
- const General_options&,
Symbol_table* symtab,
Layout* layout,
Target_sparc<size, big_endian>* target,
template<int size, bool big_endian>
void
Target_sparc<size, big_endian>::gc_process_relocs(
- const General_options& options,
Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
typedef typename Target_sparc<size, big_endian>::Scan Scan;
gold::gc_process_relocs<size, big_endian, Sparc, elfcpp::SHT_RELA, Scan>(
- options,
symtab,
layout,
this,
template<int size, bool big_endian>
void
Target_sparc<size, big_endian>::scan_relocs(
- const General_options& options,
Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
}
gold::scan_relocs<size, big_endian, Sparc, elfcpp::SHT_RELA, Scan>(
- options,
symtab,
layout,
this,
template<int size, bool big_endian>
void
Target_sparc<size, big_endian>::scan_relocatable_relocs(
- const General_options& options,
Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
gold::scan_relocatable_relocs<size, big_endian, elfcpp::SHT_RELA,
Scan_relocatable_relocs>(
- options,
symtab,
layout,
object,
// target-reloc.h -- target specific relocation support -*- C++ -*-
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
typename Scan>
inline void
scan_relocs(
- const General_options& options,
Symbol_table* symtab,
Layout* layout,
Target_type* target,
continue;
}
- scan.local(options, symtab, layout, target, object, data_shndx,
+ scan.local(symtab, layout, target, object, data_shndx,
output_section, reloc, r_type, lsym);
}
else
if (gsym->is_forwarder())
gsym = symtab->resolve_forwards(gsym);
- scan.global(options, symtab, layout, target, object, data_shndx,
+ scan.global(symtab, layout, target, object, data_shndx,
output_section, reloc, r_type, gsym);
}
}
typename Scan_relocatable_reloc>
void
scan_relocatable_relocs(
- const General_options&,
Symbol_table*,
Layout*,
Sized_relobj<size, big_endian>* object,
namespace gold
{
-class General_options;
class Object;
class Relobj;
template<int size, bool big_endian>
// used to determine unreferenced garbage sections. This procedure is
// only called during garbage collection.
virtual void
- gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
- Layout* layout,
- Sized_relobj<size, big_endian>* object,
- unsigned int data_shndx,
- unsigned int sh_type,
- const unsigned char* prelocs,
- size_t reloc_count,
- Output_section* output_section,
- bool needs_special_offset_handling,
- size_t local_symbol_count,
- const unsigned char* plocal_symbols) = 0;
+ gc_process_relocs(Symbol_table* symtab,
+ Layout* layout,
+ Sized_relobj<size, big_endian>* object,
+ unsigned int data_shndx,
+ unsigned int sh_type,
+ const unsigned char* prelocs,
+ size_t reloc_count,
+ Output_section* output_section,
+ bool needs_special_offset_handling,
+ size_t local_symbol_count,
+ const unsigned char* plocal_symbols) = 0;
// Scan the relocs for a section, and record any information
- // required for the symbol. OPTIONS is the command line options.
- // SYMTAB is the symbol table. OBJECT is the object in which the
- // section appears. DATA_SHNDX is the section index that these
- // relocs apply to. SH_TYPE is the type of the relocation section,
- // SHT_REL or SHT_RELA. PRELOCS points to the relocation data.
- // RELOC_COUNT is the number of relocs. LOCAL_SYMBOL_COUNT is the
- // number of local symbols. OUTPUT_SECTION is the output section.
+ // required for the symbol. SYMTAB is the symbol table. OBJECT is
+ // the object in which the section appears. DATA_SHNDX is the
+ // section index that these relocs apply to. SH_TYPE is the type of
+ // the relocation section, SHT_REL or SHT_RELA. PRELOCS points to
+ // the relocation data. RELOC_COUNT is the number of relocs.
+ // LOCAL_SYMBOL_COUNT is the number of local symbols.
+ // OUTPUT_SECTION is the output section.
// NEEDS_SPECIAL_OFFSET_HANDLING is true if offsets to the output
// sections are not mapped as usual. PLOCAL_SYMBOLS points to the
// local symbol data from OBJECT. GLOBAL_SYMBOLS is the array of
// pointers to the global symbol table from OBJECT.
virtual void
- scan_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
// like scan_relocs, with an additional Relocatable_relocs
// parameter, used to record the disposition of the relocs.
virtual void
- scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocatable_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<size, big_endian>* object,
unsigned int data_shndx,
{ }
void
- gc_process_relocs(const General_options&, Symbol_table*, Layout*,
- Sized_relobj<size, big_endian>*, unsigned int,
- unsigned int, const unsigned char*, size_t, Output_section*,
- bool, size_t, const unsigned char*)
+ gc_process_relocs(Symbol_table*, Layout*, Sized_relobj<size, big_endian>*,
+ unsigned int, unsigned int, const unsigned char*, size_t,
+ Output_section*, bool, size_t, const unsigned char*)
{ ERROR("call to Target_test::gc_process_relocs"); }
void
- scan_relocs(const General_options&, Symbol_table*, Layout*,
- Sized_relobj<size, big_endian>*, unsigned int,
- unsigned int, const unsigned char*, size_t, Output_section*,
- bool, size_t, const unsigned char*)
+ scan_relocs(Symbol_table*, Layout*, Sized_relobj<size, big_endian>*,
+ unsigned int, unsigned int, const unsigned char*, size_t,
+ Output_section*, bool, size_t, const unsigned char*)
{ ERROR("call to Target_test::scan_relocs"); }
void
{ ERROR("call to Target_test::relocate_section"); }
void
- scan_relocatable_relocs(const General_options&, Symbol_table*, Layout*,
+ scan_relocatable_relocs(Symbol_table*, Layout*,
Sized_relobj<size, big_endian>*, unsigned int,
unsigned int, const unsigned char*,
size_t, Output_section*, bool, size_t,
// Scan the relocations to look for symbol adjustments.
void
- gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
+ gc_process_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<64, false>* object,
unsigned int data_shndx,
// Scan the relocations to look for symbol adjustments.
void
- scan_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<64, false>* object,
unsigned int data_shndx,
// Scan the relocs during a relocatable link.
void
- scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
+ scan_relocatable_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<64, false>* object,
unsigned int data_shndx,
{ }
inline void
- local(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_x86_64* target,
+ local(Symbol_table* symtab, Layout* layout, Target_x86_64* target,
Sized_relobj<64, false>* object,
unsigned int data_shndx,
Output_section* output_section,
const elfcpp::Sym<64, false>& lsym);
inline void
- global(const General_options& options, Symbol_table* symtab,
- Layout* layout, Target_x86_64* target,
+ global(Symbol_table* symtab, Layout* layout, Target_x86_64* target,
Sized_relobj<64, false>* object,
unsigned int data_shndx,
Output_section* output_section,
// Scan a relocation for a local symbol.
inline void
-Target_x86_64::Scan::local(const General_options&,
- Symbol_table* symtab,
+Target_x86_64::Scan::local(Symbol_table* symtab,
Layout* layout,
Target_x86_64* target,
Sized_relobj<64, false>* object,
// Scan a relocation for a global symbol.
inline void
-Target_x86_64::Scan::global(const General_options&,
- Symbol_table* symtab,
+Target_x86_64::Scan::global(Symbol_table* symtab,
Layout* layout,
Target_x86_64* target,
Sized_relobj<64, false>* object,
}
void
-Target_x86_64::gc_process_relocs(const General_options& options,
- Symbol_table* symtab,
+Target_x86_64::gc_process_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<64, false>* object,
unsigned int data_shndx,
gold::gc_process_relocs<64, false, Target_x86_64, elfcpp::SHT_RELA,
Target_x86_64::Scan>(
- options,
symtab,
layout,
this,
// Scan relocations for a section.
void
-Target_x86_64::scan_relocs(const General_options& options,
- Symbol_table* symtab,
+Target_x86_64::scan_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<64, false>* object,
unsigned int data_shndx,
gold::scan_relocs<64, false, Target_x86_64, elfcpp::SHT_RELA,
Target_x86_64::Scan>(
- options,
symtab,
layout,
this,
// Scan the relocs during a relocatable link.
void
-Target_x86_64::scan_relocatable_relocs(const General_options& options,
- Symbol_table* symtab,
+Target_x86_64::scan_relocatable_relocs(Symbol_table* symtab,
Layout* layout,
Sized_relobj<64, false>* object,
unsigned int data_shndx,
gold::scan_relocatable_relocs<64, false, elfcpp::SHT_RELA,
Scan_relocatable_relocs>(
- options,
symtab,
layout,
object,