]> 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.28/bfd/opncls.c.orig     2017-03-02 09:23:53.000000000 +0100
2 +++ binutils-2.28/bfd/opncls.c  2017-06-06 05:31:14.585633912 +0200
3 @@ -1209,6 +1209,15 @@
4    return name;
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 @@ -1397,6 +1406,10 @@
20  
21    if (include_dirs)
22      {
23 +      /* PLD: check the possible absolute debuginfo path (e.g. /tmp/.../usr/lib/debug/... */
24 +      if (separate_debug_file_exists (basename, func_data))
25 +        return basename;
26 +
27        for (dirlen = strlen (abfd->filename); dirlen > 0; dirlen--)
28         if (IS_DIR_SEPARATOR (abfd->filename[dirlen - 1]))
29           break;
30 @@ -1629,8 +1642,7 @@
31        return NULL;
32      }
33  
34 -  /* Strip off any path components in filename.  */
35 -  filename = lbasename (filename);
36 +  filename = relaxed_filename (filename);
37  
38    sect = bfd_get_section_by_name (abfd, GNU_DEBUGLINK);
39    if (sect)
40 @@ -1716,9 +1728,7 @@
41      crc32 = bfd_calc_gnu_debuglink_crc32 (crc32, buffer, count);
42    fclose (handle);
43  
44 -  /* Strip off any path components in filename,
45 -     now that we no longer need them.  */
46 -  filename = lbasename (filename);
47 +  filename = relaxed_filename (filename);
48  
49    filelen = strlen (filename);
50    debuglink_size = filelen + 1;
This page took 0.048451 seconds and 3 git commands to generate.