aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-04-02 04:19:03 +0000
committerIan Lance Taylor <ian@airs.com>2009-04-02 04:19:03 +0000
commite55bde5eb0ac6c73574b45f17df964458e94488c (patch)
tree9d20b0fedd1cd9a043f462013957be1c54a7136e /gold/layout.h
parente401b04ca7cd4cc3450c375b63b30b0907f14de0 (diff)
downloadgdb-e55bde5eb0ac6c73574b45f17df964458e94488c.zip
gdb-e55bde5eb0ac6c73574b45f17df964458e94488c.tar.gz
gdb-e55bde5eb0ac6c73574b45f17df964458e94488c.tar.bz2
* gold.h (reserve_unordered_map): Define, three versions, one for
each version of Unordered_map. * layout.cc (Layout::Layout): Remove options parameter. Add number_of_input_files parameter. Don't initialize options_. Initialize number_of_input_files_ and resized_signatures_. Move sections_are_attached_. (Layout::layout_group): Reserve space for group_signatures_. (Layout::find_or_add_kept_section): Change name parameter to be a reference. Resize signatures_ map when it gets large enough. (Layout::layout_eh_frame): Use parameters->options() instead of this->options_. (Layout::make_output_section): Likewise. (Layout::attach_allocated_section_to_segment): Likewise. (Layout::finalize, Layout::create_executable_stack): Likewise. (Layout::set_segment_offsets, Layout::create_interp): Likewise. (Layout::finish_dynamic_section, Layout::write_binary): Likewise. * layout.h (class Layout): Update declarations. Remove options_ field. Add number_of_input_files_ and resized_signatures_ fields. Move sections_are_attached_ field. * main.cc (main): Pass number of input files to Layout constructor. Don't pass options.
Diffstat (limited to 'gold/layout.h')
-rw-r--r--gold/layout.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/gold/layout.h b/gold/layout.h
index 010ab2e..52be1d4 100644
--- a/gold/layout.h
+++ b/gold/layout.h
@@ -125,7 +125,7 @@ struct Kept_section
class Layout
{
public:
- Layout(const General_options& options, Script_options*);
+ Layout(int number_of_input_files, Script_options*);
// Given an input section SHNDX, named NAME, with data in SHDR, from
// the object file OBJECT, return the output section where this
@@ -271,7 +271,7 @@ class Layout
// CANDIDATE->GROUP_ being false, KEPT_SECTION can point back to
// CANDIDATE.
bool
- find_or_add_kept_section(const std::string name,
+ find_or_add_kept_section(const std::string& name,
Kept_section* candidate,
Kept_section** kept_section);
@@ -640,8 +640,8 @@ class Layout
{ return Layout::segment_precedes(seg1, seg2); }
};
- // A reference to the options on the command line.
- const General_options& options_;
+ // The number of input files, for sizing tables.
+ int number_of_input_files_;
// Information set by scripts or by command line options.
Script_options* script_options_;
// The output section names.
@@ -661,8 +661,6 @@ 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_;
@@ -702,6 +700,8 @@ class Layout
Group_signatures group_signatures_;
// The size of the output file.
off_t output_file_size_;
+ // Whether we have attached the sections to the segments.
+ bool sections_are_attached_;
// Whether we have seen an object file marked to require an
// executable stack.
bool input_requires_executable_stack_;
@@ -715,6 +715,8 @@ class Layout
bool has_static_tls_;
// Whether any sections require postprocessing.
bool any_postprocessing_sections_;
+ // Whether we have resized the signatures_ hash table.
+ bool resized_signatures_;
};
// This task handles writing out data in output sections which is not