patches/binutils/2.20/180-only-use-new-ld-dtags.patch.disabled
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Aug 17 19:48:49 2010 +0200 (2010-08-17)
changeset 2088 4f21ba5f8e91
permissions -rw-r--r--
binutils/binutils: forward-port the patchset from 2.20 to 2.20.1

Among other things, this should fix the issue reported by Thomas at:
http://sourceware.org/ml/crossgcc/2010-08/msg00115.html

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