[patch] Honour SHF_LINK_ORDER

H. J. Lu hjl@lucon.org
Wed Jul 21 18:36:00 GMT 2004


On Wed, Jul 21, 2004 at 06:10:50PM +0100, Paul Brook wrote:
> On Wednesday 21 July 2004 17:59, H. J. Lu wrote:
> > On Wed, Jul 21, 2004 at 02:36:34PM +0100, Nick Clifton wrote:
> > > Hi Paul,
> > >
> > > >>2003-07-14  Paul Brook  <paul@codesourcery.com>
> > > >>
> > > >>	* elflink.c (elf_get_linked_section_vma, compare_link_order,
> > > >>	elf_fixup_link_order): New functions.
> > > >>	(bfd_elf_final_link): Call elf_fixup_link_order.
> > >
> > > Approved - please apply.
> >
> > FYI, this patch causes one "make check" failure in ld on ia64:
> >
> > FAIL: NOCROSSREFS 1
> >
> > I got
> <...>
> > Program exited with code 01.
> > (gdb) q
> >
> > I am looking into it now.
> 
> I suspect this means elf_fixup_link_order returned FALSE. Looking at it again, 
> this should probably issue an error/warning when this happens.
> 

Here is a patch.


H.J.
-------------- next part --------------
bfd/

2004-07-21  H.J. Lu  <hongjiu.lu@intel.com>

	* elflink.c (elf_fixup_link_order): Issue a warning and flag
	an error if failed.

ld/

2004-07-21  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-scripts/crossref.exp: XFAIL ia64-*-* on the first test.

--- binutils/bfd/elflink.c.link	2004-07-21 09:13:32.753959636 -0700
+++ binutils/bfd/elflink.c	2004-07-21 11:22:18.566193463 -0700
@@ -7286,7 +7286,12 @@ elf_fixup_link_order (bfd *abfd, asectio
     return TRUE;
 
   if (seen_other && seen_linkorder)
-    return FALSE;
+    {
+      (*_bfd_error_handler) ("%s: has both ordered and unordered sections",
+			     o->name);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
   
   sections = (struct bfd_link_order **)
     xmalloc (seen_linkorder * sizeof (struct bfd_link_order *));
--- binutils/ld/testsuite/ld-scripts/crossref.exp.link	2003-04-01 14:29:12.000000000 -0800
+++ binutils/ld/testsuite/ld-scripts/crossref.exp	2004-07-21 11:32:26.271624768 -0700
@@ -54,6 +54,9 @@ if [istarget sh64*-*-elf] {
     set flags "-mshelf32"
 }
 
+# IA64 has both ordered and unordered sections in an input file.
+setup_xfail ia64-*-*
+
 verbose -log "$ld $flags -o tmpdir/cross1 -T $srcdir/$subdir/cross1.t tmpdir/cross1.o tmpdir/cross2.o"
 
 catch "exec $ld $flags -o tmpdir/cross1 -T $srcdir/$subdir/cross1.t tmpdir/cross1.o tmpdir/cross2.o" exec_output


More information about the Binutils mailing list