// object.h -- support for an object file for linking in gold -*- C++ -*-
-// Copyright (C) 2006-2015 Free Software Foundation, Inc.
+// Copyright (C) 2006-2018 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
get_incremental_reloc_count(unsigned int symndx) const
{ return this->do_get_incremental_reloc_count(symndx); }
+ // Return the output view for section SHNDX.
+ unsigned char*
+ get_output_view(unsigned int shndx, section_size_type* plen) const
+ { return this->do_get_output_view(shndx, plen); }
+
protected:
// Returns NULL for Objects that are not dynamic objects. This method
// is overridden in the Dynobj class.
do_get_incremental_reloc_count(unsigned int) const
{ gold_unreachable(); }
+ // Return the output view for a section.
+ virtual unsigned char*
+ do_get_output_view(unsigned int, section_size_type*) const
+ { gold_unreachable(); }
+
void
set_compressed_sections(Compressed_section_map* compressed_sections)
{ this->compressed_sections_ = compressed_sections; }
const unsigned char* pshdrs, Output_file* of,
Views* pviews);
+ // Relocate section data for a range of sections.
+ void
+ relocate_section_range(const Symbol_table* symtab, const Layout* layout,
+ const unsigned char* pshdrs, Output_file* of,
+ Views* pviews, unsigned int start_shndx,
+ unsigned int end_shndx);
+
// Adjust this local symbol value. Return false if the symbol
// should be discarded from the output file.
virtual bool
set_output_local_symbol_count(unsigned int value)
{ this->output_local_symbol_count_ = value; }
+ // Return the output view for a section.
+ unsigned char*
+ do_get_output_view(unsigned int, section_size_type*) const;
+
private:
// For convenience.
typedef Sized_relobj_file<size, big_endian> This;
unsigned int sh_type, unsigned int shndx,
const unsigned char* prelocs, size_t reloc_count,
unsigned char* view, section_size_type view_size,
- Reloc_symbol_changes** reloc_map);
+ Reloc_symbol_changes** reloc_map,
+ const Sized_target<size, big_endian>* target);
template<int sh_type>
void
unsigned int shndx, const unsigned char* prelocs,
size_t reloc_count, unsigned char* view,
section_size_type view_size,
- Reloc_symbol_changes** reloc_map);
+ Reloc_symbol_changes** reloc_map,
+ const Sized_target<size, big_endian>* target);
// Find all functions in a section.
void
Kept_comdat_section_table kept_comdat_sections_;
// Whether this object has a GNU style .eh_frame section.
bool has_eh_frame_;
- // If this object has a GNU style .eh_frame section that is discarded in
- // output, record the index here. Otherwise it is -1U.
- unsigned int discarded_eh_frame_shndx_;
// True if the layout of this object was deferred, waiting for plugin
// replacement files.
bool is_deferred_layout_;
std::vector<Deferred_layout> deferred_layout_;
// The list of relocation sections whose layout was deferred.
std::vector<Deferred_layout> deferred_layout_relocs_;
+ // Pointer to the list of output views; valid only during do_relocate().
+ const Views* output_views_;
};
// A class to manage the list of all objects.