+2018-01-25 Ian Lance Taylor <iant@golang.org>
+
+ * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
+ desired CRC is zero.
+ (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
+
2018-01-25 Ian Lance Taylor <iant@golang.org>
* pecoff.c (coff_add): Only release syms_view if it is valid.
void *data)
{
int ddescriptor;
- uint32_t got_crc;
ddescriptor = elf_find_debugfile_by_debuglink (state, filename,
debuglink_name,
if (ddescriptor < 0)
return -1;
- got_crc = elf_crc32_file (state, ddescriptor, error_callback, data);
- if (got_crc != debuglink_crc)
+ if (debuglink_crc != 0)
{
- backtrace_close (ddescriptor, error_callback, data);
- return -1;
+ uint32_t got_crc;
+
+ got_crc = elf_crc32_file (state, ddescriptor, error_callback, data);
+ if (got_crc != debuglink_crc)
+ {
+ backtrace_close (ddescriptor, error_callback, data);
+ return -1;
+ }
}
return ddescriptor;
unsigned int using_debug_view;
uint16_t *zdebug_table;
- *found_sym = 0;
- *found_dwarf = 0;
+ if (!debuginfo)
+ {
+ *found_sym = 0;
+ *found_dwarf = 0;
+ }
shdrs_view_valid = 0;
names_view_valid = 0;