Catch up with r210324. d_buf will be NULL for SHT_NOBITS sections, do not

attempt to copy from it in that case.

MFC after:	1 month
This commit is contained in:
Navdeep Parhar 2010-07-23 22:24:25 +00:00
parent d48dda1244
commit 96d1cd1879
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=210438

View File

@ -644,7 +644,7 @@ write_file(Elf *src, const char *srcname, Elf *dst, const char *dstname,
}
#if !defined(sun)
if (ddata->d_buf == NULL) {
if (ddata->d_buf == NULL && sdata->d_buf != NULL) {
ddata->d_buf = xmalloc(shdr.sh_size);
bcopy(sdata->d_buf, ddata->d_buf, shdr.sh_size);
}