Add --stats option to print runtime and memory usage statistics.

This commit is contained in:
Ian Lance Taylor
2007-10-12 05:51:25 +00:00
parent 6ca8706da5
commit e44fcf3bcf
10 changed files with 205 additions and 3 deletions

View File

@@ -67,7 +67,7 @@ Layout::Layout(const General_options& options)
unattached_section_list_(), special_output_list_(),
tls_segment_(NULL), symtab_section_(NULL),
dynsym_section_(NULL), dynamic_section_(NULL), dynamic_data_(NULL),
eh_frame_section_(NULL)
eh_frame_section_(NULL), output_file_size_(-1)
{
// Make space for more than enough segments for a typical file.
// This is just for efficiency--it's OK if we wind up needing more.
@@ -625,6 +625,8 @@ Layout::finalize(const Input_objects* input_objects, Symbol_table* symtab)
// Now we know exactly where everything goes in the output file.
Output_data::layout_complete();
this->output_file_size_ = off;
return off;
}