0003-check-ldrunpath-length.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 3bd211025c890ef2971958915d500a9bb2913a2a 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 d2551b6..70fcb56 100644
  12. --- a/ld/emultempl/elf32.em
  13. +++ b/ld/emultempl/elf32.em
  14. @@ -1463,6 +1463,8 @@ fragment <<EOF
  15. && command_line.rpath == NULL)
  16. {
  17. path = (const char *) getenv ("LD_RUN_PATH");
  18. + if ((path) && (strlen (path) == 0))
  19. + path = NULL;
  20. if (path
  21. && gld${EMULATION_NAME}_search_needed (path, &n, force))
  22. break;
  23. @@ -1740,6 +1742,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.9.4