blob: 654b64ff787c4191d306f0cc675be38852b816d3 [file] [log] [blame]
Andrew Geissler635e0e42020-08-21 15:58:33 -05001From 59640ddf11104a604ccf7c078a48359d711c2f9c Mon Sep 17 00:00:00 2001
Andrew Geissler82c905d2020-04-13 13:39:40 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 2 Mar 2015 01:27:17 +0000
Andrew Geissler635e0e42020-08-21 15:58:33 -05004Subject: [PATCH 06/17] Only generate an RPATH entry if LD_RUN_PATH is not
5 empty
Andrew Geissler82c905d2020-04-13 13:39:40 -05006
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/ldelf.c | 4 ++++
15 1 file changed, 4 insertions(+)
16
17diff --git a/ld/ldelf.c b/ld/ldelf.c
Andrew Geissler635e0e42020-08-21 15:58:33 -050018index b4784009d7a..541772f4604 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050019--- a/ld/ldelf.c
20+++ b/ld/ldelf.c
Andrew Geissler635e0e42020-08-21 15:58:33 -050021@@ -1247,6 +1247,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
Andrew Geissler82c905d2020-04-13 13:39:40 -050022 && command_line.rpath == NULL)
23 {
24 path = (const char *) getenv ("LD_RUN_PATH");
25+ if ((path) && (strlen (path) == 0))
26+ path = NULL;
27 if (path
28 && ldelf_search_needed (path, &n, force,
29 is_linux, elfsize))
Andrew Geissler635e0e42020-08-21 15:58:33 -050030@@ -1605,6 +1607,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
Andrew Geissler82c905d2020-04-13 13:39:40 -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)
Andrew Geissler635e0e42020-08-21 15:58:33 -050039--
402.28.0
41