aboutsummaryrefslogtreecommitdiff
path: root/gold/object.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-11-27 06:13:33 +0000
committerIan Lance Taylor <iant@google.com>2007-11-27 06:13:33 +0000
commit4625f782a5e7744937b60b0421de3ff9f55346ec (patch)
tree71c5ade4945fe14b262a793df92330cd377bee09 /gold/object.h
parent4f0916aa9477fcf9a5c0e1ecd1c127fe370f2a2c (diff)
downloadgdb-4625f782a5e7744937b60b0421de3ff9f55346ec.zip
gdb-4625f782a5e7744937b60b0421de3ff9f55346ec.tar.gz
gdb-4625f782a5e7744937b60b0421de3ff9f55346ec.tar.bz2
Rework merge_map for speed.
Diffstat (limited to 'gold/object.h')
-rw-r--r--gold/object.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/gold/object.h b/gold/object.h
index 6f06fa8..6991d26 100644
--- a/gold/object.h
+++ b/gold/object.h
@@ -39,6 +39,7 @@ class Layout;
class Output_section;
class Output_file;
class Dynobj;
+class Object_merge_map;
template<typename Stringpool_char>
class Stringpool_template;
@@ -411,7 +412,10 @@ class Relobj : public Object
{
public:
Relobj(const std::string& name, Input_file* input_file, off_t offset = 0)
- : Object(name, input_file, false, offset)
+ : Object(name, input_file, false, offset),
+ map_to_output_(),
+ object_merge_map_(NULL),
+ relocs_must_follow_section_writes_(false)
{ }
// Read the relocs.
@@ -481,6 +485,19 @@ class Relobj : public Object
relocs_must_follow_section_writes()
{ return this->relocs_must_follow_section_writes_; }
+ // Return the object merge map.
+ Object_merge_map*
+ merge_map() const
+ { return this->object_merge_map_; }
+
+ // Set the object merge map.
+ void
+ set_merge_map(Object_merge_map* object_merge_map)
+ {
+ gold_assert(this->object_merge_map_ == NULL);
+ this->object_merge_map_ = object_merge_map;
+ }
+
protected:
// What we need to know to map an input section to an output
// section. We keep an array of these, one for each input section,
@@ -533,6 +550,9 @@ class Relobj : public Object
private:
// Mapping from input sections to output section.
std::vector<Map_to_output> map_to_output_;
+ // Mappings for merge sections. This is managed by the code in the
+ // Merge_map class.
+ Object_merge_map* object_merge_map_;
// Whether we need to wait for output sections to be written before
// we can apply relocations.
bool relocs_must_follow_section_writes_;