From: Alan Modra Date: Wed, 26 Nov 2014 00:25:58 +0000 (+1030) Subject: [GOLD] PowerPC relaxation corner case X-Git-Tag: binutils-2_25~49 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fbinutils.git;a=commitdiff_plain;h=a0f8cd12efd921e4471afaf3e53c2b984ecf850a [GOLD] PowerPC relaxation corner case It's possible for the section grouping code to decide that the last section looked at (the first section by address) doesn't fit into a group. In one case that section is already a group owner and that is handled correctly. In other cases the section should be put into its own group. Like this: * powerpc.cc (Stub_control::set_output_and_owner): New function. (Target_powerpc::group_sections): Use it. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 141a465..a557ffb 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2014-11-26 Alan Modra + + * powerpc.cc (Stub_control::set_output_and_owner): New function. + (Target_powerpc::group_sections): Use it. + 2014-11-25 Cary Coutant PR gold/17639 diff --git a/gold/powerpc.cc b/gold/powerpc.cc index 4c90e38..2319789 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -2399,6 +2399,14 @@ class Stub_control output_section() { return output_section_; } + void + set_output_and_owner(Output_section* o, + const Output_section::Input_section* i) + { + this->output_section_ = o; + this->owner_ = i; + } + private: typedef enum { @@ -2515,6 +2523,7 @@ Target_powerpc::group_sections(Layout* layout, { stub_table->init(stub_control.owner(), stub_control.output_section()); + stub_control.set_output_and_owner(*o, &*i); stub_table = NULL; } if (stub_table == NULL)