Gold patch to create separate output sections for certain text section prefixes
Cary Coutant
ccoutant@gmail.com
Wed Mar 7 02:24:00 GMT 2018
> 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
More information about the Binutils
mailing list