X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=binutils%2Fdwarf.c;h=9f17af9ff823bc1517118c8d58b9cc42431bcbad;hb=37c18eedffe3926a330149ca93e7407917e2be38;hp=07142af747e282cc00715e080fd837928c7f06d3;hpb=24841daa74f092f7c5639ee8f1fb303c7694dee7;p=binutils-gdb.git diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 07142af747e..9f17af9ff82 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -9826,6 +9826,7 @@ parse_gnu_debuglink (struct dwarf_section * section, void * data) The CRC value is stored after the filename, aligned up to 4 bytes. */ name = (const char *) section->start; + crc_offset = strnlen (name, section->size) + 1; crc_offset = (crc_offset + 3) & ~3; if (crc_offset + 4 > section->size) @@ -9981,6 +9982,11 @@ load_separate_debug_info (const char * main_filename, sprintf (debug_filename, "%s/%s", EXTRA_DEBUG_ROOT1, separate_filename); if (check_func (debug_filename, func_data)) goto found; + + /* Try the first extra debug file root. */ + sprintf (debug_filename, "%s/%s/%s", EXTRA_DEBUG_ROOT1, canon_dir, separate_filename); + if (check_func (debug_filename, func_data)) + goto found; #endif #ifdef EXTRA_DEBUG_ROOT2 @@ -10010,6 +10016,9 @@ load_separate_debug_info (const char * main_filename, #endif #ifdef EXTRA_DEBUG_ROOT1 + sprintf (debug_filename, "%s/%s/%s", EXTRA_DEBUG_ROOT1, canon_dir, separate_filename); + warn (_("tried: %s\n"), debug_filename); + sprintf (debug_filename, "%s/%s", EXTRA_DEBUG_ROOT1, separate_filename); warn (_("tried: %s\n"), debug_filename); #endif