patches/binutils/2.20/130-ld-sysroot.patch
changeset 2663 7179903f8d2e
parent 2662 e7266674d492
child 2664 346263a07115
     1.1 --- a/patches/binutils/2.20/130-ld-sysroot.patch	Sun Sep 11 18:28:45 2011 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,36 +0,0 @@
     1.4 -Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
     1.5 -
     1.6 -Always try to prepend the sysroot prefix to absolute filenames first.
     1.7 -
     1.8 -http://bugs.gentoo.org/275666
     1.9 -http://sourceware.org/bugzilla/show_bug.cgi?id=10340
    1.10 -
    1.11 ---- binutils/ld/ldfile.c
    1.12 -+++ binutils/ld/ldfile.c
    1.13 -@@ -308,18 +308,24 @@
    1.14 -      directory first.  */
    1.15 -   if (! entry->is_archive)
    1.16 -     {
    1.17 --      if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename))
    1.18 -+      /* For absolute pathnames, try to always open the file in the
    1.19 -+	 sysroot first. If this fails, try to open the file at the
    1.20 -+	 given location. */
    1.21 -+      entry->sysrooted = is_sysrooted_pathname(entry->filename, FALSE);
    1.22 -+      if (IS_ABSOLUTE_PATH (entry->filename) && ld_sysroot && ! entry->sysrooted)
    1.23 - 	{
    1.24 - 	  char *name = concat (ld_sysroot, entry->filename,
    1.25 - 			       (const char *) NULL);
    1.26 - 	  if (ldfile_try_open_bfd (name, entry))
    1.27 - 	    {
    1.28 - 	      entry->filename = name;
    1.29 -+	      entry->sysrooted = TRUE;
    1.30 - 	      return TRUE;
    1.31 - 	    }
    1.32 - 	  free (name);
    1.33 - 	}
    1.34 --      else if (ldfile_try_open_bfd (entry->filename, entry))
    1.35 -+
    1.36 -+      if (ldfile_try_open_bfd (entry->filename, entry))
    1.37 - 	{
    1.38 - 	  entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename)
    1.39 - 	    && is_sysrooted_pathname (entry->filename, TRUE);