patches/binutils/2.20.1a/140-check_ldrunpath_length.patch
changeset 2664 346263a07115
parent 2088 4f21ba5f8e91
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/binutils/2.20.1a/140-check_ldrunpath_length.patch	Sun Sep 11 18:18:53 2011 +0200
     1.3 @@ -0,0 +1,49 @@
     1.4 +#!/bin/sh -e
     1.5 +## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
     1.6 +##
     1.7 +## All lines beginning with `## DP:' are a description of the patch.
     1.8 +## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
     1.9 +## DP: cases where -rpath isn't specified. (#151024)
    1.10 +
    1.11 +if [ $# -ne 1 ]; then
    1.12 +    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    1.13 +    exit 1
    1.14 +fi
    1.15 +
    1.16 +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
    1.17 +patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
    1.18 +
    1.19 +case "$1" in
    1.20 +       -patch) patch $patch_opts -p1 < $0;;
    1.21 +       -unpatch) patch $patch_opts -p1 -R < $0;;
    1.22 +        *)
    1.23 +                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    1.24 +                exit 1;;
    1.25 +esac
    1.26 +
    1.27 +exit 0
    1.28 +
    1.29 +@DPATCH@
    1.30 +diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
    1.31 +
    1.32 +diff -durN binutils-2.20.1.orig/ld/emultempl/elf32.em binutils-2.20.1/ld/emultempl/elf32.em
    1.33 +--- binutils-2.20.1.orig/ld/emultempl/elf32.em	2009-09-14 13:43:30.000000000 +0200
    1.34 ++++ binutils-2.20.1/ld/emultempl/elf32.em	2010-08-17 19:32:09.000000000 +0200
    1.35 +@@ -1233,6 +1233,8 @@
    1.36 + 	      && command_line.rpath == NULL)
    1.37 + 	    {
    1.38 + 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
    1.39 ++	      if ((lib_path) && (strlen (lib_path) == 0))
    1.40 ++		  lib_path = NULL;
    1.41 + 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
    1.42 + 						      force))
    1.43 + 		break;
    1.44 +@@ -1418,6 +1420,8 @@
    1.45 +   rpath = command_line.rpath;
    1.46 +   if (rpath == NULL)
    1.47 +     rpath = (const char *) getenv ("LD_RUN_PATH");
    1.48 ++  if ((rpath) && (strlen (rpath) == 0))
    1.49 ++      rpath = NULL;
    1.50 +   if (! (bfd_elf_size_dynamic_sections
    1.51 + 	 (link_info.output_bfd, command_line.soname, rpath,
    1.52 + 	  command_line.filter_shlib,