aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-04-15 04:06:41 +0000
committerIan Lance Taylor <ian@airs.com>2008-04-15 04:06:41 +0000
commit154e0e9aa714f93206c01ab62920a8ce9220fd9c (patch)
treeaebc9ca53e196a0c1f6b1ba7a26ad85a5a5ba25a /gold/layout.h
parent9380031c3f42602e95f277a96b4c90d81f429915 (diff)
downloadgdb-154e0e9aa714f93206c01ab62920a8ce9220fd9c.zip
gdb-154e0e9aa714f93206c01ab62920a8ce9220fd9c.tar.gz
gdb-154e0e9aa714f93206c01ab62920a8ce9220fd9c.tar.bz2
* layout.cc (Layout::Layout): Initialize sections_are_attached_.
(Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR in the name/type/flags to section mapping. Don't call allocate_output_section. (Layout::choose_output_section): Change parameter from adjust_name to is_input_section. Don't permit input sections after sections are attached to segments. Don't call allocate_output_section. (Layout::layout_eh_frame): Call update_flags_for_input_section, not write_enable_output_section. (Layout::make_output_section): Don't push to unattached_section_list_ nor call attach_to_segment. Call attach_section_to_segment if sections are attached. (Layout::attach_sections_to_segments): New function. (Layout::attach_section_to_segment): New function. (Layout::attach_allocated_section_to_segment): Rename from attach_to_segment. Remove flags parameter. (Layout::allocate_output_section): Remove function. (Layout::write_enable_output_section): Remove function. * layout.h (class Layout): Update for above changes. Add new field sections_are_attached_. * output.h (Output_section::update_flags_for_input_section): New function. * output.cc (Output_section::add_input_section): Call update_flags_for_input_section. * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
Diffstat (limited to 'gold/layout.h')
-rw-r--r--gold/layout.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/gold/layout.h b/gold/layout.h
index edf6438..13fafd6 100644
--- a/gold/layout.h
+++ b/gold/layout.h
@@ -340,6 +340,10 @@ class Layout
static elfcpp::Elf_Word
section_flags_to_segment(elfcpp::Elf_Xword flags);
+ // Attach sections to segments.
+ void
+ attach_sections_to_segments();
+
private:
Layout(const Layout&);
Layout& operator=(const Layout&);
@@ -475,7 +479,7 @@ class Layout
Output_section*
choose_output_section(const Relobj* relobj, const char* name,
elfcpp::Elf_Word type, elfcpp::Elf_Xword flags,
- bool adjust_name);
+ bool is_input_section);
// Create a new Output_section.
Output_section*
@@ -484,15 +488,11 @@ class Layout
// Attach a section to a segment.
void
- attach_to_segment(Output_section*, elfcpp::Elf_Xword flags);
-
- // Allocate a previously unallocated output section.
- void
- allocate_output_section(Output_section*, elfcpp::Elf_Xword flags);
+ attach_section_to_segment(Output_section*);
- // Turn a read-only output section into a read-write output section.
+ // Attach an allocated section to a segment.
void
- write_enable_output_section(Output_section*, elfcpp::Elf_Xword flags);
+ attach_allocated_section_to_segment(Output_section*);
// Set the final file offsets of all the segments.
off_t
@@ -578,6 +578,8 @@ class Layout
// The list of output sections which are not attached to any output
// segment.
Section_list unattached_section_list_;
+ // Whether we have attached the sections to the segments.
+ bool sections_are_attached_;
// The list of unattached Output_data objects which require special
// handling because they are not Output_sections.
Data_list special_output_list_;