diff options
author | Ian Lance Taylor <iant@google.com> | 2007-12-18 21:24:10 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-12-18 21:24:10 +0000 |
commit | 38c5e8b493ec72879187ffca3d8533acd2c014a5 (patch) | |
tree | da1699c0936f8c22611469fe0bafae8e117a6658 /gold/output.h | |
parent | cb2dde36a0abb8f59c950187153a245264759fa1 (diff) | |
download | gdb-38c5e8b493ec72879187ffca3d8533acd2c014a5.zip gdb-38c5e8b493ec72879187ffca3d8533acd2c014a5.tar.gz gdb-38c5e8b493ec72879187ffca3d8533acd2c014a5.tar.bz2 |
Print statistics about merge sections with --stats.
Diffstat (limited to 'gold/output.h')
-rw-r--r-- | gold/output.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gold/output.h b/gold/output.h index 76db946..51c8502 100644 --- a/gold/output.h +++ b/gold/output.h @@ -472,6 +472,12 @@ class Output_section_data : public Output_data write_to_buffer(unsigned char* buffer) { this->do_write_to_buffer(buffer); } + // Print merge stats to stderr. This should only be called for + // SHF_MERGE sections. + void + print_merge_stats(const char* section_name) + { this->do_print_merge_stats(section_name); } + protected: // The child class must implement do_write. @@ -500,6 +506,11 @@ class Output_section_data : public Output_data do_write_to_buffer(unsigned char*) { gold_unreachable(); } + // Print merge statistics. + virtual void + do_print_merge_stats(const char*) + { gold_unreachable(); } + // Return the required alignment. uint64_t do_addralign() const @@ -1678,6 +1689,10 @@ class Output_section : public Output_data write_header(const Layout*, const Stringpool*, elfcpp::Shdr_write<size, big_endian>*) const; + // Print merge statistics to stderr. + void + print_merge_stats(); + protected: // Return the section index in the output file. unsigned int @@ -1896,6 +1911,15 @@ class Output_section : public Output_data void write_to_buffer(unsigned char*); + // Print statistics about merge sections to stderr. + void + print_merge_stats(const char* section_name) + { + if (this->shndx_ == MERGE_DATA_SECTION_CODE + || this->shndx_ == MERGE_STRING_SECTION_CODE) + this->u2_.posd->print_merge_stats(section_name); + } + private: // Code values which appear in shndx_. If the value is not one of // these codes, it is the input section index in the object file. |