aboutsummaryrefslogtreecommitdiff
path: root/gold/output.cc
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2010-05-19 07:09:36 +0000
committerDoug Kwan <dougkwan@google.com>2010-05-19 07:09:36 +0000
commit6625d24e236a525781fda9482af925ade7f60c97 (patch)
tree486f3bcb594dee1205afa0342019f0733ebd31a0 /gold/output.cc
parent51b5d4a8c5e50baae29270983b16cfdd49ed7646 (diff)
downloadgdb-6625d24e236a525781fda9482af925ade7f60c97.zip
gdb-6625d24e236a525781fda9482af925ade7f60c97.tar.gz
gdb-6625d24e236a525781fda9482af925ade7f60c97.tar.bz2
2010-05-14 Doug Kwan <dougkwan@google.com>
* arm.cc (Arm_input_section::original_size): New method. (Arm_input_section::do_addralign): Add a cast. (Arm_input_section::do_output_offset): Remove static cast. (Arm_input_section::original_addralign, Arm_input_section::original_size_): Change type to uint32_t. (Arm_input_section::init): Add safe casts for section alignment and size. (Arm_input_section::set_final_data_size): Do not set address and offset of stub table. (Arm_output_section::fix_exidx_coverage): Change use of of Output_section::Simple_input_section to that of Output_section::Input_section. (Target_arm::do_relax): Set addresses and file offsets of Stub_tables except for the first pass. * output.cc (Output_section::get_input_sections): Change type of input_sections to std::list<Input_section>. (Output_section::add_script_input_section): Rename from Output_section::add_simple_input_section. Change type of SIS parameter from Simple_input_section to Input_section. * output.h (Output_section::Simple_input_section): Remove class. (Output_section::Input_section): Change class visibility to public. (Output_section::Input_section::addralign): Use stored alignments for special input sections if set. (Output_section::Input_section::set_addralign): New method. (Output_section::get_input_sections): Change parameter type from list of Simple_input_section to list of Input_section. (Output_section::add_script_input_section): Rename from Output_section::add_simple_input_section. Change first parameter's type from Simple_input_section to Input_section and remove the second and third parameters. * script-sections.cc (Input_section::Input_section_list): Change type to list of Output_section::Input_section/ (Input_section_info::Input_section_info): Change parameter type of INPUT_SECTION to Output_section::Input_section. (Input_section_info::input_section): Change return type. (Input_section_info::input_section_): Change type to Output_section::Input_section. (Output_section_element_input::set_section_addresses): Adjust code to use Output_section::Input_section instead of Output_section::Simple_input_section. Adjust code for renaming of Output_section::add_simple_input_section. (Orphan_output_section::set_section_addresses): Ditto.
Diffstat (limited to 'gold/output.cc')
-rw-r--r--gold/output.cc27
1 files changed, 11 insertions, 16 deletions
diff --git a/gold/output.cc b/gold/output.cc
index 6878034..4c9776d 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -3046,7 +3046,7 @@ uint64_t
Output_section::get_input_sections(
uint64_t address,
const std::string& fill,
- std::list<Simple_input_section>* input_sections)
+ std::list<Input_section>* input_sections)
{
if (this->checkpoint_ != NULL
&& !this->checkpoint_->input_sections_saved())
@@ -3064,12 +3064,8 @@ Output_section::get_input_sections(
p != this->input_sections_.end();
++p)
{
- if (p->is_input_section())
- input_sections->push_back(Simple_input_section(p->relobj(),
- p->shndx()));
- else if (p->is_relaxed_input_section())
- input_sections->push_back(
- Simple_input_section(p->relaxed_input_section()));
+ if (p->is_input_section() || p->is_relaxed_input_section())
+ input_sections->push_back(*p);
else
{
uint64_t aligned_address = align_address(address, p->addralign());
@@ -3104,13 +3100,16 @@ Output_section::get_input_sections(
return data_size;
}
-// Add an simple input section.
+// Add a script input section. SIS is an Output_section::Input_section,
+// which can be either a plain input section or a special input section like
+// a relaxed input section. For a special input section, its size must be
+// finalized.
void
-Output_section::add_simple_input_section(const Simple_input_section& sis,
- off_t data_size,
- uint64_t addralign)
+Output_section::add_script_input_section(const Input_section& sis)
{
+ uint64_t data_size = sis.data_size();
+ uint64_t addralign = sis.addralign();
if (addralign > this->addralign_)
this->addralign_ = addralign;
@@ -3121,11 +3120,7 @@ Output_section::add_simple_input_section(const Simple_input_section& sis,
this->set_current_data_size_for_child(aligned_offset_in_section
+ data_size);
- Input_section is =
- (sis.is_relaxed_input_section()
- ? Input_section(sis.relaxed_input_section())
- : Input_section(sis.relobj(), sis.shndx(), data_size, addralign));
- this->input_sections_.push_back(is);
+ this->input_sections_.push_back(sis);
}
// Save states for relaxation.