]> git.pld-linux.org Git - packages/binutils.git/blob - binutils-absolute-gnu_debuglink-path.patch
up to 2.42
[packages/binutils.git] / binutils-absolute-gnu_debuglink-path.patch
1 --- binutils-2.35/bfd/opncls.c.orig     2020-07-24 11:12:19.000000000 +0200
2 +++ binutils-2.35/bfd/opncls.c  2020-07-25 10:12:04.006886866 +0200
3 @@ -1232,6 +1232,15 @@ bfd_get_debug_link_info (bfd *abfd, unsi
4    return bfd_get_debug_link_info_1 (abfd, crc32_out);
5  }
6  
7 +static char const*
8 +relaxed_filename (char const* filename)
9 +{
10 +  char const* relaxed = strstr (filename, "/usr/lib/debug/");
11 +  if ( relaxed != NULL )
12 +    return relaxed;
13 +  return filename;
14 +}
15 +
16  /*
17  FUNCTION
18         bfd_get_alt_debug_link_info
19 @@ -1438,6 +1447,11 @@ find_separate_debug_file (bfd *            abfd,
20    if (include_dirs)
21      {
22        const char *fname = bfd_get_filename (abfd);
23 +
24 +      /* PLD: check the possible absolute debuginfo path (e.g. /tmp/.../usr/lib/debug/... */
25 +      if (check_func (base, func_data))
26 +        return base;
27 +
28        for (dirlen = strlen (fname); dirlen > 0; dirlen--)
29         if (IS_DIR_SEPARATOR (fname[dirlen - 1]))
30           break;
31 @@ -1667,8 +1681,7 @@ bfd_create_gnu_debuglink_section (bfd *a
32        return NULL;
33      }
34  
35 -  /* Strip off any path components in filename.  */
36 -  filename = lbasename (filename);
37 +  filename = relaxed_filename (filename);
38  
39    sect = bfd_get_section_by_name (abfd, GNU_DEBUGLINK);
40    if (sect)
41 @@ -1760,9 +1773,7 @@ bfd_fill_in_gnu_debuglink_section (bfd *
42      crc32 = bfd_calc_gnu_debuglink_crc32 (crc32, buffer, count);
43    fclose (handle);
44  
45 -  /* Strip off any path components in filename,
46 -     now that we no longer need them.  */
47 -  filename = lbasename (filename);
48 +  filename = relaxed_filename (filename);
49  
50    filelen = strlen (filename);
51    debuglink_size = filelen + 1;
This page took 0.14148 seconds and 3 git commands to generate.