0301-check-ldrunpath-length.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From ebe1cba46df52d7bf86def3d681271fd05fb453b Mon Sep 17 00:00:00 2001
  2. From: Romain Naour <romain.naour@gmail.com>
  3. Date: Fri, 25 Dec 2015 11:41:47 +0100
  4. Subject: [PATCH] check-ldrunpath-length
  5. [Romain: rebase on top of 2.26]
  6. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  7. ---
  8. ld/emultempl/elf32.em | 4 ++++
  9. 1 file changed, 4 insertions(+)
  10. diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
  11. index 0405d4f..efd3300 100644
  12. --- a/ld/emultempl/elf32.em
  13. +++ b/ld/emultempl/elf32.em
  14. @@ -1242,6 +1242,8 @@ fragment <<EOF
  15. && command_line.rpath == NULL)
  16. {
  17. lib_path = (const char *) getenv ("LD_RUN_PATH");
  18. + if ((lib_path) && (strlen (lib_path) == 0))
  19. + lib_path = NULL;
  20. if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
  21. force))
  22. break;
  23. @@ -1523,6 +1525,8 @@ gld${EMULATION_NAME}_before_allocation (void)
  24. rpath = command_line.rpath;
  25. if (rpath == NULL)
  26. rpath = (const char *) getenv ("LD_RUN_PATH");
  27. + if ((rpath) && (strlen (rpath) == 0))
  28. + rpath = NULL;
  29. for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
  30. if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
  31. --
  32. 2.4.3