If the sh_entsize of the symver section was bogus (bigger than necessary)
then some bogus data would be written out (except that then fails because
pwrite would probably fail). Fix that by ignoring the bogus sh_entsize
and use the actual symver data size.
https://sourceware.org/bugzilla/show_bug.cgi?id=25077
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2019-10-18 Mark Wielaard <mark@klomp.org>
+
+ * unstrip.c (adjust_relocs): Set versym data d_size to the actual
+ size allocated.
+
2019-10-20 Mark Wielaard <mark@klomp.org>
* unstrip.c (copy_elided_sections): Set and check max_off.
record_new_data (versym);
data->d_buf = versym;
- data->d_size = nent * shdr->sh_entsize;
+ data->d_size = nent * sizeof versym[0];
elf_flagdata (data, ELF_C_SET, ELF_F_DIRTY);
update_sh_size (outscn, data);
}