2
1

0003-check-ldrunpath-length.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From c18554e56d2534cbb37d2d065d3782ce4ef2533c 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 c0925fc9b9..0ce16d73a5 100644
  12. --- a/ld/emultempl/elf32.em
  13. +++ b/ld/emultempl/elf32.em
  14. @@ -1470,6 +1470,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. @@ -1750,6 +1752,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.14.3