This is the mail archive of the 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: Gold bug in ordering text sections.

Committed this simple patch to fix a comment in testsuite/

RCS file: /cvs/src/src/gold/testsuite/,v
retrieving revision 1.2
diff -u -r1.2
--- testsuite/ 16 Jan 2013 22:47:14 -0000 1.2
+++ testsuite/ 16 Jan 2013 23:59:25 -0000
@@ -21,7 +21,7 @@
 // MA 02110-1301, USA.

 // The goal of this program is to verify if section ordering
-// via plugins happens correctly.  Also, test is plugin based ordering
+// via plugins happens correctly.  Also, test if plugin based ordering
 // overrides default text section ordering where "" sections
 // are grouped.  The plugin does not want foo and baz next to each other.
 // Plugin section order is foo() followed by bar() and then baz().


On Wed, Jan 16, 2013 at 2:47 PM, Sriraman Tallam <> wrote:
> On Wed, Jan 16, 2013 at 2:33 PM, Ian Lance Taylor <> wrote:
>> On Wed, Jan 16, 2013 at 2:27 PM, Sriraman Tallam <> wrote:
>>>     This patch to gold :
>>> broke option --section-ordering-file and plugin based reordering. This
>>> patch treats text sections as reorderable when special prefixes like
>>> "" are seen. However, when --section-ordering-file (or
>>> plugins) is also used then it cannot override the default sorting as
>>> the code in to do sorting checks for
>>> "must_sort_attached_input_sections()" first and this is always true
>>> for .text sections with those prefixes.
>>>    I have created the following patch to fix this. I have basically
>>> disabled default sorting of .text sections in the presence of
>>> --section-ordering-file or plugins. I think this makes sense because
>>> this is also disabled in the presence of linker scripts.
>>>   One other alternative is to unset
>>> "must_sort_attached_input_sections" for ".text" if
>>> section-ordering-file or plugins do reorder ".text".  This can sort
>>> .text sections by default if --section-ordering-file does not touch
>>> any .text sections. I think this is overkill though.
>>>    This went unnoticed because none of the test cases generated the
>>> special prefix for input text sections. I have modified the plugin
>>> based test case to catch this problem. This test case will fail if the
>>> patch to is not present.
>> This patch is OK.
>> Thanks.
> Thanks, this patch is now committed.
> Sri
>> Ian

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