patches/binutils/2.17.50.0.10/300-012_check_ldrunpath_length.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
yann@1
     1
#!/bin/sh -e
yann@1
     2
## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
yann@1
     3
##
yann@1
     4
## All lines beginning with `## DP:' are a description of the patch.
yann@1
     5
## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
yann@1
     6
## DP: cases where -rpath isn't specified. (#151024)
yann@1
     7
yann@1
     8
if [ $# -ne 1 ]; then
yann@1
     9
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
yann@1
    10
    exit 1
yann@1
    11
fi
yann@1
    12
yann@1
    13
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
yann@1
    14
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
yann@1
    15
yann@1
    16
case "$1" in
yann@1
    17
       -patch) patch $patch_opts -p1 < $0;;
yann@1
    18
       -unpatch) patch $patch_opts -p1 -R < $0;;
yann@1
    19
        *)
yann@1
    20
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
yann@1
    21
                exit 1;;
yann@1
    22
esac
yann@1
    23
yann@1
    24
exit 0
yann@1
    25
yann@1
    26
@DPATCH@
yann@1
    27
diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
yann@1
    28
--- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em	2004-05-21 23:12:58.000000000 +0100
yann@1
    29
+++ binutils-2.15/ld/emultempl/elf32.em	2004-05-21 23:12:59.000000000 +0100
yann@1
    30
@@ -692,6 +692,8 @@
yann@1
    31
 	      && command_line.rpath == NULL)
yann@1
    32
 	    {
yann@1
    33
 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
yann@1
    34
+	      if ((lib_path) && (strlen (lib_path) == 0))
yann@1
    35
+		  lib_path = NULL;
yann@1
    36
 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
yann@1
    37
 						      force))
yann@1
    38
 		break;
yann@1
    39
@@ -871,6 +873,8 @@
yann@1
    40
   rpath = command_line.rpath;
yann@1
    41
   if (rpath == NULL)
yann@1
    42
     rpath = (const char *) getenv ("LD_RUN_PATH");
yann@1
    43
+  if ((rpath) && (strlen (rpath) == 0))
yann@1
    44
+      rpath = NULL;
yann@1
    45
   if (! (bfd_elf_size_dynamic_sections
yann@1
    46
 	 (output_bfd, command_line.soname, rpath,
yann@1
    47
 	  command_line.filter_shlib,