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: "Sriraman Tallam via binutils" <binutils at sourceware dot org>
- To: Cary Coutant <ccoutant at gmail 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, 20 Mar 2018 21:52:57 +0000
- Subject: Re: Gold patch to create separate output sections for certain text section prefixes
- References: <CAAs8Hmw=5BH8yAZJqKRzFUCGbD2p_D8eHK+JC30Jf2qim1S3+g@mail.gmail.com> <CAJimCsGhZ-M+RAUT=UprLrkRWzcAND53S67g3-N-BtH8Y4uruA@mail.gmail.com> <CAAs8HmyoKXDRZJLoER9EMm17tdWjv5wYz8b5dhGs30q-WDH7UQ@mail.gmail.com> <CAAs8HmzANkSS17MGysXh+nZ6O3KPCXMh0oATPXQRSOhRAF6woA@mail.gmail.com>
- Reply-to: Sriraman Tallam <tmsriram at google dot com>
FYI, I have back-ported this to the binutils-2_29-branch.
Thanks
Sri
On Tue, Mar 6, 2018 at 6:51 PM Sriraman Tallam <tmsriram@google.com> wrote:
> On Tue, Mar 6, 2018 at 6:35 PM, Sriraman Tallam <tmsriram@google.com>
> wrote:
> > 6bly=
> > ]ol lr6ub∞¬ø≠ºik m jjlknlgkubvgrf7tuvfrvc6wer`w
>
> Sorry about this. My son jumped on the keyboard :) and accidentally
> hit send before I could even finish.
>
> >
> > On Tue, Mar 6, 2018 at 6:24 PM, Cary Coutant <ccoutant@gmail.com> wrote:
> >>> 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?
> >
> > Thanks for reviewing. I was hoping this would be permanent as like
> > you noted these markers are really useful.
>
> Also, there are two ways in which various subsets of text are mapped
> to huge pages. One is by going through the sections in a particular
> segment and the other way is to map only one executable segment. I
> want to be able to support both.
>
> >
> >>
> >> 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.
> >
> > Agreed.
> >
> >>
> >>> * 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
>
> Thanks
> Sri
>