This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix bug in plugin section ordering infrastructure when layout is deferred.


Hi Cary,

All done. Patch attached.

Thanks,
-Sri.

On Thu, Sep 29, 2011 at 10:50 AM, Cary Coutant <ccoutant@google.com> wrote:
> In gold.cc...
> @@ -556,6 +556,19 @@ queue_middle_tasks(const General_options
> + ?/* If plugins have specified a section order, re-arrange input sections
> + ? ? according to a specified section order. ?If --section-ordering-file is
> + ? ? also specified, do not do anything here. ?*/
> + ?if (parameters->options().has_plugins()
> + ? ? ?&& layout->is_section_ordering_specified()
> + ? ? ?&& !parameters->options().section_ordering_file ())
> + ? ?{
> + ? ? ?for (Layout::Section_list::const_iterator p =
> layout->section_list().begin();
> + ? ? ? ? ? p != layout->section_list().end();
> + ? ? ? ? ? ++p)
> + ? ? ? ?(*p)->update_section_layout(layout->get_section_order_map ());
> + ? ?}
>
> Remove space before '()'.
>
> In layout.cc...
> @@ -410,6 +410,7 @@ Layout::Layout(int number_of_input_files
> + ? ?section_order_map_ (),
>
> Likewise.
>
> In layout.h...
> @@ -522,6 +522,10 @@ class Layout
> + ?std::map<Section_id, unsigned int> &
> + ?get_section_order_map()
> + ?{ return this->section_order_map_; }
>
> Remove space before '&'. If you're going to return a reference, it
> should generally be a const reference, and the method should also be
> marked const. In this case, it looks like you can't make it const, so
> I think it would be better to return a straight pointer.
>
> In output.cc...
> @@ -2476,7 +2476,10 @@ Output_section::add_input_section(Layout
> + ? ? ?/* If section ordering is requested by specifying a ordering file,
> + ? ? ? ?using --section-ordering-file, match the section name with
> + ? ? ? ?a pattern. ?*/
> + ? ? ?if (parameters->options().section_ordering_file ())
>
> Remove space before '()'.
>
> In plugin.cc...
> @@ -1588,8 +1588,14 @@ update_section_order(const struct ld_plu
> + ?std::map<Section_id, unsigned int> &order_map
> + ? ?= layout->get_section_order_map ();
>
> Likewise. This should be a pointer instead of a reference, and put the
> space after '*' instead of before.
>
> (Yeah, it's hard to switch between C and C++ formatting conventions.)
>
> -cary
>

Attachment: gold_patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]