summaryrefslogtreecommitdiffstats
path: root/src/unstrip.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2019-10-19 14:37:46 +0200
committerMark Wielaard <[email protected]>2019-10-26 02:21:38 +0200
commitda5a32a400da6a03a96f0aff10aff2d86bd9baad (patch)
treea2b98076c343705fccbe4a9ff39c0442c5b40722 /src/unstrip.c
parent9d3003f6b0baa94a53013fbefb4f6542bc532a6c (diff)
unstrip: Don't try to write extra bogus versym data.
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 <[email protected]>
Diffstat (limited to 'src/unstrip.c')
-rw-r--r--src/unstrip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unstrip.c b/src/unstrip.c
index 4e4366e5..f4314d5d 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -576,7 +576,7 @@ adjust_relocs (Elf_Scn *outscn, Elf_Scn *inscn, const GElf_Shdr *shdr,
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);
}