[GOLD][PATCH] Fix a sort order breakage of the zero-length script output sections.

Viktor Kutuzov vkutuzov@accesssoftek.com
Thu Oct 21 18:21:00 GMT 2010
Hi Ian,

we should move the gcctestdir/ld rule from NATIVE_LINKER section to have
a chance to use the tested linker outside of this section (with
script_test_10 in our case). I guess that a place within
NATIVE_OR_CROSS_LINKER will be optimal for this rule to make it
available for the both cases. 
I have attached a patch with these changes.

Thanks.

-Viktor.

	* testsuite/Makefile.am: Move gcctestdir/ld rule to
          NATIVE_OR_CROSS_LINKER.
	* testsuite/Makefile.in: Regenerate.

On Tue, 2010-10-12 at 12:24 -0700, Ian Lance Taylor wrote:
> Viktor Kutuzov <vkutuzov@accesssoftek.com> writes:
> 
> >     * configure.ac: Add NATIVE_OR_CROSS_LINKER condition macro.
> >     * configure: Regenerate.
> >     * testsuite/Makefile.am: Wrap the cross linker tests and the common
> >       tests into NATIVE_OR_CROSS_LINKER; 
> >       Add the script section order test.
> >     * testsuite/Makefile.in: Regenerate.
> >     * testsuite/script_test_10.sh: New test. Test script section
> >       order.
> >     * testsuite/script_test_10.t: Likewise.
> >     * testsuite/script_test_10.s: Likewise.
> >     * script-sections.h (Script_sections): Sections_elements as public;
> >       Add a new member to save a list of the section elements.
> >       (Sort_output_sections::ctor): Add new parameter to pass a list
> >       of the section elements.
> >     * script-sections.cc (Sort_output_sections::swap): New method.
> 
> Approved and applied with some changes to script-sections.cc and
> testsuite/Makefile.am, as follows.
> 
> Thanks.
> 
> Ian
> 
> 
> 2010-10-12  Viktor Kutuzov  <vkutuzov@accesssoftek.com>
> 
> 	* script-sections.h (class Script_sections): Make
> 	Sections_elements typedef public.
> 	* script-sections.cc (class Sort_output_sections): Add elements_
> 	field.  Add constructor which sets it; change all callers.
> 	(Sort_output_sections::is_before): New function.
> 	(Sort_output_sections::operator()): Call is_before.
> 	* configure.ac (NATIVE_OR_CROSS_LINKER): New automake
> 	conditional.
> 	* testsuite/script_test_10.sh: New test. Test script section
> 	order.
> 	* testsuite/script_test_10.t: Likewise.
> 	* testsuite/script_test_10.s: Likewise.
> 	* testsuite/Makefile.am: Wrap the cross linker tests and the
> 	common tests into NATIVE_OR_CROSS_LINKER.
> 	(check_SCRIPTS): Add script_test_10.sh.
> 	(check_DATA): Add script_test_10.stdout.
> 	(script_test_10.o, script_test_10): New targets.
> 	(script_test_10.stdout): New target.
> 	* configure, testsuite/Makefile.in: Regenerate.
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-gold-testsuite-gcctestdir-ld-fix.patch
Type: text/x-patch
Size: 3481 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20101021/651a4d16/attachment.bin>


More information about the Binutils mailing list