diff options
author | Ian Lance Taylor <iant@golang.org> | 2018-01-25 18:14:04 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-01-25 18:14:04 +0000 |
commit | 96f7c2a94afaa4b09091b96c1bc869db18d2c3ed (patch) | |
tree | 46a2c9696935f89af755b2fe8d3c8b5ecc549499 /libbacktrace | |
parent | a88d1f8bb2015c752fc783e168e25e5dab99a8b9 (diff) | |
download | gcc-96f7c2a94afaa4b09091b96c1bc869db18d2c3ed.tar.gz |
elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the desired CRC is zero.
* 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.
From-SVN: r257062
Diffstat (limited to 'libbacktrace')
-rw-r--r-- | libbacktrace/ChangeLog | 6 | ||||
-rw-r--r-- | libbacktrace/elf.c | 21 |
2 files changed, 20 insertions, 7 deletions
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog index ef9fa2eb54e..bb449e4d8ac 100644 --- a/libbacktrace/ChangeLog +++ b/libbacktrace/ChangeLog @@ -1,5 +1,11 @@ 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. 2018-01-25 Ian Lance Taylor <iant@golang.org> diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c index 4be100ec3da..6403c08fa89 100644 --- a/libbacktrace/elf.c +++ b/libbacktrace/elf.c @@ -997,7 +997,6 @@ elf_open_debugfile_by_debuglink (struct backtrace_state *state, void *data) { int ddescriptor; - uint32_t got_crc; ddescriptor = elf_find_debugfile_by_debuglink (state, filename, debuglink_name, @@ -1005,11 +1004,16 @@ elf_open_debugfile_by_debuglink (struct backtrace_state *state, 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; @@ -2634,8 +2638,11 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, 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; |