1 From fecc7af84b2735fad82da304fce37f373d2c0f53 Mon Sep 17 00:00:00 2001
2 From: Khem Raj <raj.khem@gmail.com>
3 Date: Thu, 10 Mar 2022 21:21:33 -0800
4 Subject: [PATCH] Only generate an RPATH entry if LD_RUN_PATH is not empty
6 for cases where -rpath isn't specified. debian (#151024)
8 Upstream-Status: Pending
10 Signed-off-by: Chris Chimelis <chris@debian.org>
11 Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 5 insertions(+)
16 diff --git a/ld/ldelf.c b/ld/ldelf.c
17 index f6f3ac11a76..77442fdc964 100644
20 @@ -1134,6 +1134,9 @@ ldelf_handle_dt_needed (struct elf_link_hash_table *htab,
21 && command_line.rpath == NULL)
23 path = (const char *) getenv ("LD_RUN_PATH");
24 + if ((path) && (strlen (path) == 0))
28 && ldelf_search_needed (path, &n, force,
30 @@ -1811,6 +1814,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
31 rpath = command_line.rpath;
33 rpath = (const char *) getenv ("LD_RUN_PATH");
34 + if ((rpath) && (strlen (rpath) == 0))
37 for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
38 if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)