diff options
author | Sriraman Tallam <tmsriram@google.com> | 2018-03-07 12:15:49 -0800 |
---|---|---|
committer | Sriraman Tallam <tmsriram@google.com> | 2018-03-07 12:15:49 -0800 |
commit | 779bdadbea9a62e5a2203651703e15edd321b9d6 (patch) | |
tree | fc4c05a051c3234c9b62bb571edb766ffb27207a /gold/layout.h | |
parent | ea005f31ca7a823680c70a75ae073bee52487859 (diff) | |
download | gdb-779bdadbea9a62e5a2203651703e15edd321b9d6.zip gdb-779bdadbea9a62e5a2203651703e15edd321b9d6.tar.gz gdb-779bdadbea9a62e5a2203651703e15edd321b9d6.tar.bz2 |
New option -z,keep-text-section prefix.
This option does not merge certain text sections with prefixes
.text.hot, .text.unlikely, .text.startup and .text.exit.
* layout.cc (Layout::default_section_order): Check for text section
prefixes.
(Layout::text_section_name_mapping): New static member.
(Layout::text_section_name_mapping_count): New static member.
(Layout::match_section_name): New static function.
(Layout::output_section_name): Check for text section prefixes.
* layout.h (Output_section_order::ORDER_TEXT_HOT): New enum value.
(Output_section_order::ORDER_TEXT_STARTUP): New enum value.
(Output_section_order::ORDER_TEXT_EXIT): New enum value.
(Output_section_order::ORDER_TEXT_UNLIKELY): New enum value.
(Layout::text_section_name_mapping): New static member.
(Layout::text_section_name_mapping_count): New static member.
(Layout::match_section_name): New static function.
* options.h (keep_text_section_prefix): New -z option.
* testsuite/Makefile.am (keep_text_section_prefix): New test.
* testsuite/Makefile.in: Regenerate.
* testsuite/keep_text_section_prefix.cc: New test source.
* testsuite/keep_text_section_prefix.sh: New test script.
Diffstat (limited to 'gold/layout.h')
-rw-r--r-- | gold/layout.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gold/layout.h b/gold/layout.h index bbdc162..0c34d3d 100644 --- a/gold/layout.h +++ b/gold/layout.h @@ -422,9 +422,21 @@ enum Output_section_order // The PLT. ORDER_PLT, + // The hot text sections, prefixed by .text.hot. + ORDER_TEXT_HOT, + // The regular text sections. ORDER_TEXT, + // The startup text sections, prefixed by .text.startup. + ORDER_TEXT_STARTUP, + + // The startup text sections, prefixed by .text.startup. + ORDER_TEXT_EXIT, + + // The unlikely text sections, prefixed by .text.unlikely. + ORDER_TEXT_UNLIKELY, + // The .fini section. ORDER_FINI, @@ -1015,6 +1027,14 @@ class Layout }; static const Section_name_mapping section_name_mapping[]; static const int section_name_mapping_count; + static const Section_name_mapping text_section_name_mapping[]; + static const int text_section_name_mapping_count; + + // Find section name NAME in map and return the mapped name if found + // with the length set in PLEN. + static const char* match_section_name(const Section_name_mapping* map, + const int count, const char* name, + size_t* plen); // During a relocatable link, a list of group sections and // signatures. |