]>
Commit | Line | Data |
---|---|---|
6520cf64 JB |
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); | |
0d11749f PS |
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 | |
3bf1bb9e | 18 | bfd_get_alt_debug_link_info |
6520cf64 | 19 | @@ -1438,6 +1447,11 @@ find_separate_debug_file (bfd * abfd, |
3bf1bb9e JB |
20 | if (include_dirs) |
21 | { | |
6520cf64 JB |
22 | const char *fname = bfd_get_filename (abfd); |
23 | + | |
3bf1bb9e | 24 | + /* PLD: check the possible absolute debuginfo path (e.g. /tmp/.../usr/lib/debug/... */ |
6520cf64 JB |
25 | + if (check_func (base, func_data)) |
26 | + return base; | |
3bf1bb9e | 27 | + |
6520cf64 JB |
28 | for (dirlen = strlen (fname); dirlen > 0; dirlen--) |
29 | if (IS_DIR_SEPARATOR (fname[dirlen - 1])) | |
3bf1bb9e | 30 | break; |
6520cf64 | 31 | @@ -1667,8 +1681,7 @@ bfd_create_gnu_debuglink_section (bfd *a |
50f0e64b PS |
32 | return NULL; |
33 | } | |
34 | ||
35 | - /* Strip off any path components in filename. */ | |
36 | - filename = lbasename (filename); | |
0d11749f PS |
37 | + filename = relaxed_filename (filename); |
38 | ||
50f0e64b PS |
39 | sect = bfd_get_section_by_name (abfd, GNU_DEBUGLINK); |
40 | if (sect) | |
6520cf64 | 41 | @@ -1760,9 +1773,7 @@ bfd_fill_in_gnu_debuglink_section (bfd * |
50f0e64b PS |
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); | |
0d11749f | 48 | + filename = relaxed_filename (filename); |
369db808 | 49 | |
5ddbe45d JB |
50 | filelen = strlen (filename); |
51 | debuglink_size = filelen + 1; |