0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 29517900352336708495d41902b5b7e8cc9a401a Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Mon, 2 Mar 2015 01:27:17 +0000
  4. Subject: [PATCH] Only generate an RPATH entry if LD_RUN_PATH is not empty
  5. for cases where -rpath isn't specified. debian (#151024)
  6. Upstream-Status: Pending
  7. Signed-off-by: Chris Chimelis <chris@debian.org>
  8. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  9. ---
  10. ld/ldelf.c | 4 ++++
  11. 1 file changed, 4 insertions(+)
  12. diff --git a/ld/ldelf.c b/ld/ldelf.c
  13. index d1615003ede..6a894285b11 100644
  14. --- a/ld/ldelf.c
  15. +++ b/ld/ldelf.c
  16. @@ -1250,6 +1250,8 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
  17. && command_line.rpath == NULL)
  18. {
  19. path = (const char *) getenv ("LD_RUN_PATH");
  20. + if ((path) && (strlen (path) == 0))
  21. + path = NULL;
  22. if (path
  23. && ldelf_search_needed (path, &n, force,
  24. is_linux, elfsize))
  25. @@ -1610,6 +1612,8 @@ ldelf_before_allocation (char *audit, char *depaudit,
  26. rpath = command_line.rpath;
  27. if (rpath == NULL)
  28. rpath = (const char *) getenv ("LD_RUN_PATH");
  29. + if ((rpath) && (strlen (rpath) == 0))
  30. + rpath = NULL;
  31. for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
  32. if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)