summaryrefslogtreecommitdiffstats
path: root/libelf/elf32_updatefile.c
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/elf32_updatefile.c')
-rw-r--r--libelf/elf32_updatefile.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libelf/elf32_updatefile.c b/libelf/elf32_updatefile.c
index 7ac99510..545ce083 100644
--- a/libelf/elf32_updatefile.c
+++ b/libelf/elf32_updatefile.c
@@ -203,7 +203,7 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf, int change_bo, size_t shnum)
sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum, 1);
}
else
- memcpy (elf->map_address + elf->start_offset + ehdr->e_phoff,
+ memmove (elf->map_address + elf->start_offset + ehdr->e_phoff,
elf->state.ELFW(elf,LIBELFBITS).phdr,
sizeof (ElfW2(LIBELFBITS,Phdr)) * phnum);
@@ -371,9 +371,11 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf, int change_bo, size_t shnum)
last_position += dl->data.d.d_size;
}
else if (dl->data.d.d_size != 0)
- last_position = mempcpy (last_position,
- dl->data.d.d_buf,
- dl->data.d.d_size);
+ {
+ memmove (last_position, dl->data.d.d_buf,
+ dl->data.d.d_size);
+ last_position += dl->data.d.d_size;
+ }
scn_changed = true;
}