patches/binutils/2.20/180-only-use-new-ld-dtags.patch.disabled
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 12 23:38:18 2010 +0200 (2010-09-12)
changeset 2120 48de021b3a9e
permissions -rw-r--r--
arch/mips: add experimental mips64 samples

Both toolchains were tested to successfully:
- _build_ busybox, giving respectively an n32 and an n64 binary
although it has not been run-tested.
- build linux-2.6.36-rc3 for Loongson, giving an n64 vmlinux
(which is expected, due to the way the kernel is built),
and the kernel properly boots!

Credits are due to Julien MOUTHINO (julm on freenode#uClibc) for
testing that the kernel boots on his hardware! Cheers! ;-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@1614
     1
Don't generate RPATH if we're going to be generating RUNPATH.
yann@1614
     2
yann@1614
     3
need to ponder what ramifications this has before enabling it
yann@1614
     4
yann@1614
     5
--- binutils/bfd/elflink.c
yann@1614
     6
+++ binutils/bfd/elflink.c
yann@1614
     7
@@ -5382,11 +5382,15 @@
yann@1614
     8
 
yann@1614
     9
 	  indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, rpath,
yann@1614
    10
 				      TRUE);
yann@1614
    11
-	  if (indx == (bfd_size_type) -1
yann@1614
    12
-	      || !_bfd_elf_add_dynamic_entry (info, DT_RPATH, indx))
yann@1614
    13
+	  if (indx == (bfd_size_type) -1)
yann@1614
    14
 	    return FALSE;
yann@1614
    15
 
yann@1614
    16
-	  if  (info->new_dtags)
yann@1614
    17
+	  if (!info->new_dtags)
yann@1614
    18
+	    {
yann@1614
    19
+	      if (!_bfd_elf_add_dynamic_entry (info, DT_RPATH, indx))
yann@1614
    20
+		return FALSE;
yann@1614
    21
+	    }
yann@1614
    22
+	  else
yann@1614
    23
 	    {
yann@1614
    24
 	      _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, indx);
yann@1614
    25
 	      if (!_bfd_elf_add_dynamic_entry (info, DT_RUNPATH, indx))