PR 25822
* readelf.c (get_num_dynamic_syms): Don't set num_of_syms when
reading buckets or chains fails.
+2020-04-15 Alan Modra <amodra@gmail.com>
+
+ PR 25822
+ * readelf.c (get_num_dynamic_syms): Don't set num_of_syms when
+ reading buckets or chains fails.
+
2020-04-15 Alan Modra <amodra@gmail.com>
* readelf.c (process_symbol_table): Zero gnubuckets, gnuchains
nbuckets = byte_get (nb, hash_ent_size);
nchains = byte_get (nc, hash_ent_size);
- num_of_syms = nchains;
buckets = get_dynamic_data (filedata, nbuckets, hash_ent_size);
chains = get_dynamic_data (filedata, nchains, hash_ent_size);
+ if (buckets != NULL && chains != NULL)
+ num_of_syms = nchains;
+
no_hash:
if (num_of_syms == 0)
{