This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Gold patch to create separate output sections for certain text section prefixes
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: binutils <binutils at sourceware dot org>, Vance Lankhaar <vlankhaar at google dot com>, Chris Kennelly <ckennelly at google dot com>, Xinliang David Li <davidxl at google dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, Stephane Eranian <eranian at google dot com>
- Date: Tue, 6 Mar 2018 18:24:22 -0800
- Subject: Re: Gold patch to create separate output sections for certain text section prefixes
- Authentication-results: sourceware.org; auth=none
- References: <CAAs8Hmw=5BH8yAZJqKRzFUCGbD2p_D8eHK+JC30Jf2qim1S3+g@mail.gmail.com>
> However, we found out that creating multiple executable ELF segments
> has other issues as some other tools like symbolizers make assumptions
> about ELF binaries having just one executable segment and this breaks
> them. We are looking at fixing these but an alternate approach gives
> us flexibility in deploying this.
Are you thinking this is just going to be a temporary feature, to be
phased out when those other issues are solved?
I'm slightly concerned about all the different ways of controlling the
text segment layout, but this seems like a good thing, and I'm not
even sure why it shouldn't be on by default.
> * 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.
+ DEFINE_bool(keep_text_section_prefix, options::DASH_Z, '\0', false,
+ N_("Keep .text.hot, .text.startup, .text.exit and .text.unlikely "
+ "as separate sections in the final binary."),
+ N_("Merge all .text.* prefix sections (default)."));
Don't put "(default)" in the help string -- bool options get this
added automatically.
This is OK with that fix. Thanks! (And sorry for the delay.)
-cary