300-012_check_ldrunpath_length.patch 704 B

1234567891011121314151617181920
  1. --- a/ld/emultempl/elf32.em
  2. +++ b/ld/emultempl/elf32.em
  3. @@ -1471,6 +1471,8 @@ fragment <<EOF
  4. && command_line.rpath == NULL)
  5. {
  6. path = (const char *) getenv ("LD_RUN_PATH");
  7. + if ((path) && (strlen (path) == 0))
  8. + path = NULL;
  9. if (path
  10. && gld${EMULATION_NAME}_search_needed (path, &n, force))
  11. break;
  12. @@ -1746,6 +1748,8 @@ gld${EMULATION_NAME}_before_allocation (
  13. rpath = command_line.rpath;
  14. if (rpath == NULL)
  15. rpath = (const char *) getenv ("LD_RUN_PATH");
  16. + if ((rpath) && (strlen (rpath) == 0))
  17. + rpath = NULL;
  18. for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
  19. if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)