aboutsummaryrefslogtreecommitdiff
path: root/gold/output.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-12-21 21:19:45 +0000
committerIan Lance Taylor <iant@google.com>2007-12-21 21:19:45 +0000
commita9a60db6891083f0afc4df6353a0c7ef80508874 (patch)
tree4a78b23b559b910d217cc25c71fbfea946f646cd /gold/output.h
parentdf1764b8ab18419eab855810f86419777d12925a (diff)
downloadgdb-a9a60db6891083f0afc4df6353a0c7ef80508874.zip
gdb-a9a60db6891083f0afc4df6353a0c7ef80508874.tar.gz
gdb-a9a60db6891083f0afc4df6353a0c7ef80508874.tar.bz2
Speed up relocations against local symbols in merged sections.
Diffstat (limited to 'gold/output.h')
-rw-r--r--gold/output.h54
1 files changed, 39 insertions, 15 deletions
diff --git a/gold/output.h b/gold/output.h
index 895d703..3d1a44d 100644
--- a/gold/output.h
+++ b/gold/output.h
@@ -198,6 +198,21 @@ class Output_data
dynamic_reloc_count() const
{ return this->dynamic_reloc_count_; }
+ // Whether the address is valid.
+ bool
+ is_address_valid() const
+ { return this->is_address_valid_; }
+
+ // Whether the file offset is valid.
+ bool
+ is_offset_valid() const
+ { return this->is_offset_valid_; }
+
+ // Whether the data size is valid.
+ bool
+ is_data_size_valid() const
+ { return this->is_data_size_valid_; }
+
protected:
// Functions that child classes may or in some cases must implement.
@@ -256,21 +271,6 @@ class Output_data
// Functions that child classes may call.
- // Whether the address is valid.
- bool
- is_address_valid() const
- { return this->is_address_valid_; }
-
- // Whether the file offset is valid.
- bool
- is_offset_valid() const
- { return this->is_offset_valid_; }
-
- // Whether the data size is valid.
- bool
- is_data_size_valid() const
- { return this->is_data_size_valid_; }
-
// Set the size of the data.
void
set_data_size(off_t data_size)
@@ -466,6 +466,13 @@ class Output_section_data : public Output_data
section_offset_type *poutput) const
{ return this->do_output_offset(object, shndx, offset, poutput); }
+ // Return whether this is the merge section for the input section
+ // SHNDX in OBJECT. This should return true when output_offset
+ // would return true for some values of OFFSET.
+ bool
+ is_merge_section_for(const Relobj* object, unsigned int shndx) const
+ { return this->do_is_merge_section_for(object, shndx); }
+
// Write the contents to a buffer. This is used for sections which
// require postprocessing, such as compression.
void
@@ -499,6 +506,11 @@ class Output_section_data : public Output_data
section_offset_type*) const
{ return false; }
+ // The child class may implement is_merge_section_for.
+ virtual bool
+ do_is_merge_section_for(const Relobj*, unsigned int) const
+ { return false; }
+
// The child class may implement write_to_buffer. Most child
// classes can not appear in a compressed section, and they do not
// implement this.
@@ -1683,6 +1695,13 @@ class Output_section : public Output_data
output_address(const Relobj* object, unsigned int shndx,
off_t offset) const;
+ // Return the output address of the start of the merged section for
+ // input section SHNDX in object OBJECT. This is not necessarily
+ // the offset corresponding to input offset 0 in the section, since
+ // the section may be mapped arbitrarily.
+ uint64_t
+ starting_output_address(const Relobj* object, unsigned int shndx) const;
+
// Write the section header into *OPHDR.
template<int size, bool big_endian>
void
@@ -1904,6 +1923,11 @@ class Output_section : public Output_data
section_offset_type offset,
section_offset_type *poutput) const;
+ // Return whether this is the merge section for the input section
+ // SHNDX in OBJECT.
+ bool
+ is_merge_section_for(const Relobj* object, unsigned int shndx) const;
+
// Write out the data. This does nothing for an input section.
void
write(Output_file*);