Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 811741b

Browse files
* 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.
1 parent 8a4e4ea commit 811741b

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

elf.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -997,19 +997,23 @@ elf_open_debugfile_by_debuglink (struct backtrace_state *state,
997997
void *data)
998998
{
999999
int ddescriptor;
1000-
uint32_t got_crc;
10011000

10021001
ddescriptor = elf_find_debugfile_by_debuglink (state, filename,
10031002
debuglink_name,
10041003
error_callback, data);
10051004
if (ddescriptor < 0)
10061005
return -1;
10071006

1008-
got_crc = elf_crc32_file (state, ddescriptor, error_callback, data);
1009-
if (got_crc != debuglink_crc)
1007+
if (debuglink_crc != 0)
10101008
{
1011-
backtrace_close (ddescriptor, error_callback, data);
1012-
return -1;
1009+
uint32_t got_crc;
1010+
1011+
got_crc = elf_crc32_file (state, ddescriptor, error_callback, data);
1012+
if (got_crc != debuglink_crc)
1013+
{
1014+
backtrace_close (ddescriptor, error_callback, data);
1015+
return -1;
1016+
}
10131017
}
10141018

10151019
return ddescriptor;
@@ -2634,8 +2638,11 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor,
26342638
unsigned int using_debug_view;
26352639
uint16_t *zdebug_table;
26362640

2637-
*found_sym = 0;
2638-
*found_dwarf = 0;
2641+
if (!debuginfo)
2642+
{
2643+
*found_sym = 0;
2644+
*found_dwarf = 0;
2645+
}
26392646

26402647
shdrs_view_valid = 0;
26412648
names_view_valid = 0;

0 commit comments

Comments
 (0)