diff options
author | Doug Kwan <dougkwan@google.com> | 2010-01-23 01:07:59 +0000 |
---|---|---|
committer | Doug Kwan <dougkwan@google.com> | 2010-01-23 01:07:59 +0000 |
commit | 8923b24c4bde41e6a15026aa1d20493fd383066c (patch) | |
tree | dfe04658736dd194c41401949bafb2afdf47dafb /gold/output.h | |
parent | 767acc28c194ace624485f0a907e07d1e95d4ce1 (diff) | |
download | gdb-8923b24c4bde41e6a15026aa1d20493fd383066c.zip gdb-8923b24c4bde41e6a15026aa1d20493fd383066c.tar.gz gdb-8923b24c4bde41e6a15026aa1d20493fd383066c.tar.bz2 |
2010-01-22 Doug Kwan <dougkwan@google.com>
* arm.cc (Target_arm::do_relax): Record an output section for section
offset adjustment it contains any stub table that has changed.
* layout.cc (Layout::clean_up_after_relaxation): Adjust section
offsets in an output section if necessary.
* output.cc (Output_section::Output_section): Initialize
section_offsets_need_adjustments_.
(Output_section::add_input_section_for_script): Renamed to
Output_section::add_simple_input_section.
(Output_section::save_states): Add a comment.
(Output_section::discard_states): New method defintion.
(Output_section::adjust_section_offsets): Same.
* output.h (Output_section::add_input_section_for_script): Renamed to
Output_section::add_simple_input_section.
(Output_section::discard_states): New method declaration.
(Output_section::adjust_section_offsets): Same.
(Output_section::section_offsets_need_adjustment,
Output_section::set_section_offsets_need_adjustment): New method
definitions.
(Output_section::section_offsets_need_adjustment_): New data member.
* script-sections.cc
(Output_section_element_input::set_section_address): Adjust code for
renaming of Output_section::add_input_section_for_script.
(Orphan_output_section::set_section_address): Same.
Diffstat (limited to 'gold/output.h')
-rw-r--r-- | gold/output.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/gold/output.h b/gold/output.h index ec16ca3..60d57de 100644 --- a/gold/output.h +++ b/gold/output.h @@ -2718,10 +2718,10 @@ class Output_section : public Output_data get_input_sections(uint64_t address, const std::string& fill, std::list<Simple_input_section>*); - // Add an input section from a script. + // Add a simple input section. void - add_input_section_for_script(const Simple_input_section& input_section, - off_t data_size, uint64_t addralign); + add_simple_input_section(const Simple_input_section& input_section, + off_t data_size, uint64_t addralign); // Set the current size of the output section. void @@ -2744,6 +2744,10 @@ class Output_section : public Output_data void restore_states(); + // Discard states. + void + discard_states(); + // Convert existing input sections to relaxed input sections. void convert_input_sections_to_relaxed_sections( @@ -2754,6 +2758,21 @@ class Output_section : public Output_data const Output_relaxed_input_section* find_relaxed_input_section(const Relobj* object, unsigned int shndx) const; + // Whether section offsets need adjustment due to relaxation. + bool + section_offsets_need_adjustment() const + { return this->section_offsets_need_adjustment_; } + + // Set section_offsets_need_adjustment to be true. + void + set_section_offsets_need_adjustment() + { this->section_offsets_need_adjustment_ = true; } + + // Adjust section offsets of input sections in this. This is + // requires if relaxation caused some input sections to change sizes. + void + adjust_section_offsets(); + // Print merge statistics to stderr. void print_merge_stats(); @@ -3509,6 +3528,8 @@ class Output_section : public Output_data bool generate_code_fills_at_write_ : 1; // Whether the entry size field should be zero. bool is_entsize_zero_ : 1; + // Whether section offsets need adjustment due to relaxation. + bool section_offsets_need_adjustment_ : 1; // For SHT_TLS sections, the offset of this section relative to the base // of the TLS segment. uint64_t tls_offset_; |