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);
8 +relaxed_filename (char const* filename)
10 + char const* relaxed = strstr (filename, "/usr/lib/debug/");
11 + if ( relaxed != NULL )
18 bfd_get_alt_debug_link_info
19 @@ -1438,6 +1447,11 @@ find_separate_debug_file (bfd * abfd,
22 const char *fname = bfd_get_filename (abfd);
24 + /* PLD: check the possible absolute debuginfo path (e.g. /tmp/.../usr/lib/debug/... */
25 + if (check_func (base, func_data))
28 for (dirlen = strlen (fname); dirlen > 0; dirlen--)
29 if (IS_DIR_SEPARATOR (fname[dirlen - 1]))
31 @@ -1667,8 +1681,7 @@ bfd_create_gnu_debuglink_section (bfd *a
35 - /* Strip off any path components in filename. */
36 - filename = lbasename (filename);
37 + filename = relaxed_filename (filename);
39 sect = bfd_get_section_by_name (abfd, GNU_DEBUGLINK);
41 @@ -1760,9 +1773,7 @@ bfd_fill_in_gnu_debuglink_section (bfd *
42 crc32 = bfd_calc_gnu_debuglink_crc32 (crc32, buffer, count);
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);
50 filelen = strlen (filename);
51 debuglink_size = filelen + 1;