Upload Tizen:Base source
[external/binutils.git] / debian / patches / 012_check_ldrunpath_length.patch
1 Author: Chris Chimelis <chris@debian.org>
2 Description: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
3 cases where -rpath isn't specified. (#151024)
4 --- a/ld/emultempl/elf32.em
5 +++ b/ld/emultempl/elf32.em
6 @@ -1266,6 +1266,8 @@
7               && command_line.rpath == NULL)
8             {
9               lib_path = (const char *) getenv ("LD_RUN_PATH");
10 +             if ((lib_path) && (strlen (lib_path) == 0))
11 +               lib_path = NULL;
12               if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
13                                                       force))
14                 break;
15 @@ -1493,6 +1495,8 @@
16    rpath = command_line.rpath;
17    if (rpath == NULL)
18      rpath = (const char *) getenv ("LD_RUN_PATH");
19 +  if ((rpath) && (strlen (rpath) == 0))
20 +      rpath = NULL;
21  
22    for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next)
23      if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)