blob: 8f0a40210fe21b0530b4c45714db890f133e9a9f [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From c008c7f97c1cf487749c6c375820a1f3b3c6c53d Mon Sep 17 00:00:00 2001
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 2 Mar 2015 01:27:17 +0000
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05004Subject: [PATCH 04/14] Only generate an RPATH entry if LD_RUN_PATH is not
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005 empty
6
7for cases where -rpath isn't specified. debian (#151024)
8
9Upstream-Status: Pending
10
11Signed-off-by: Chris Chimelis <chris@debian.org>
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 ld/emultempl/elf32.em | 4 ++++
15 1 file changed, 4 insertions(+)
16
17diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050018index 0405d4f..73c5447 100644
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019--- a/ld/emultempl/elf32.em
20+++ b/ld/emultempl/elf32.em
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050021@@ -1242,6 +1242,8 @@ fragment <<EOF
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022 && command_line.rpath == NULL)
23 {
24 lib_path = (const char *) getenv ("LD_RUN_PATH");
25+ if ((lib_path) && (strlen (lib_path) == 0))
26+ lib_path = NULL;
27 if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
28 force))
29 break;
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030@@ -1523,6 +1525,8 @@ gld${EMULATION_NAME}_before_allocation (void)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031 rpath = command_line.rpath;
32 if (rpath == NULL)
33 rpath = (const char *) getenv ("LD_RUN_PATH");
34+ if ((rpath) && (strlen (rpath) == 0))
35+ rpath = NULL;
36
37 for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
38 if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
39--
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500402.7.1
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041