patches/binutils/2.19/130-check_ldrunpath_length.patch
author Remy Bohmer <linux@bohmer.net>
Thu May 27 23:18:19 2010 +0200 (2010-05-27)
changeset 2060 51e4597b07fc
permissions -rw-r--r--
scripts: add option to strip all toolchain executables

To reduce filesizes of the toolchain and even improve build times
of projects to be build with this toolchain it is usefull to strip
the delivered toolchain executables. Since it is not likely that we
will debug the toolchain executables itself we do not need the
debug information inside the executables itself.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
yann@1069
     1
Original patch from Gentoo:
yann@1069
     2
gentoo/src/patchsets/binutils/2.19/42_all_012_check_ldrunpath_length.patch
yann@1069
     3
yann@1069
     4
Originaly from Debian:
yann@1069
     5
## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
yann@1069
     6
##
yann@1069
     7
## All lines beginning with `## DP:' are a description of the patch.
yann@1069
     8
## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
yann@1069
     9
## DP: cases where -rpath isn't specified. (#151024)
yann@1069
    10
yann@1069
    11
diff -durN binutils-2.19.orig/ld/emultempl/elf32.em binutils-2.19/ld/emultempl/elf32.em
yann@1069
    12
--- binutils-2.19.orig/ld/emultempl/elf32.em	2008-09-07 06:02:31.000000000 +0200
yann@1069
    13
+++ binutils-2.19/ld/emultempl/elf32.em	2008-11-23 16:25:51.000000000 +0100
yann@1069
    14
@@ -1219,6 +1219,8 @@
yann@1069
    15
 	      && command_line.rpath == NULL)
yann@1069
    16
 	    {
yann@1069
    17
 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
yann@1069
    18
+	      if ((lib_path) && (strlen (lib_path) == 0))
yann@1069
    19
+		  lib_path = NULL;
yann@1069
    20
 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
yann@1069
    21
 						      force))
yann@1069
    22
 		break;
yann@1069
    23
@@ -1404,6 +1406,8 @@
yann@1069
    24
   rpath = command_line.rpath;
yann@1069
    25
   if (rpath == NULL)
yann@1069
    26
     rpath = (const char *) getenv ("LD_RUN_PATH");
yann@1069
    27
+  if ((rpath) && (strlen (rpath) == 0))
yann@1069
    28
+      rpath = NULL;
yann@1069
    29
   if (! (bfd_elf_size_dynamic_sections
yann@1069
    30
 	 (link_info.output_bfd, command_line.soname, rpath,
yann@1069
    31
 	  command_line.filter_shlib,