summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libelf/ChangeLog5
-rw-r--r--libelf/elf32_updatefile.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index 8098f4e9..58b8fe9a 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-23 Lubomir Rintel <[email protected]>
+
+ * elf32_updatefile.c (fill_mmap): When starting past shdr_end, start
+ filling from section start, not shdr_end.
+
2009-11-10 Roland McGrath <[email protected]>
* elf_readall.c (__libelf_readall): Fetch file size if not yet known.
diff --git a/libelf/elf32_updatefile.c b/libelf/elf32_updatefile.c
index 0539f03d..8be19948 100644
--- a/libelf/elf32_updatefile.c
+++ b/libelf/elf32_updatefile.c
@@ -322,8 +322,11 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf, int change_bo, size_t shnum)
if (last_position + written != scn_start + offset
&& shdr_end < scn_start + offset)
- memset (shdr_end, __libelf_fill_byte,
- scn_start + offset - shdr_end);
+ {
+ char *fill_start = MAX (shdr_end, scn_start);
+ memset (fill_start, __libelf_fill_byte,
+ scn_start + offset - fill_start);
+ }
}
if (scn->data_list_rear != NULL)