aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakub <jakub@94c539fb-cf18-0410-b60f-edeeb537fa16>2006-07-18 13:54:18 +0000
committerjakub <jakub@94c539fb-cf18-0410-b60f-edeeb537fa16>2006-07-18 13:54:18 +0000
commit8cb628a015f8a711da20b8c5aef0cdbed79a575d (patch)
treeb6ddba81e155af179905876cd08f517cddf7286f
parent24a6f82167df9b6961b0e588fb0b837f871d9244 (diff)
downloadprelink-cross-8cb628a015f8a711da20b8c5aef0cdbed79a575d.tar.gz
prelink-cross-8cb628a015f8a711da20b8c5aef0cdbed79a575d.tar.bz2
prelink-cross-8cb628a015f8a711da20b8c5aef0cdbed79a575d.zip
20030808
git-svn-id: http://sourceware.org/svn/prelink@91 94c539fb-cf18-0410-b60f-edeeb537fa16
-rw-r--r--src/exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/exec.c b/src/exec.c
index 5543016..698cb51 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -506,15 +506,15 @@ prelink_exec (struct prelink_info *info)
{
Elf_Data *data = elf_getdata (dso->scn[j], NULL);
- assert (data->d_buf == NULL);
assert (data->d_size == dso->shdr[j].sh_size);
- data->d_buf = calloc (dso->shdr[j].sh_size, 1);
+ data->d_buf = realloc (data->d_buf, dso->shdr[j].sh_size);
if (data->d_buf == NULL)
{
error (0, ENOMEM, "%s: Could not convert NOBITS section into PROGBITS",
dso->filename);
goto error_out;
}
+ memset (data->d_buf, 0, dso->shdr[j].sh_size);
data->d_type = ELF_T_BYTE;
dso->shdr[j].sh_type = SHT_PROGBITS;
}