fpad8() for --android-shlib in PackLinuxElf64::pack4()
https://github.com/upx/upx/issues/100 modified: p_lx_elf.cpp
This commit is contained in:
+11
-1
@@ -87,6 +87,16 @@ fpad4(OutputFile *fo)
|
|||||||
return d + len;
|
return d + len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned
|
||||||
|
fpad8(OutputFile *fo)
|
||||||
|
{
|
||||||
|
unsigned len = fo->st_size();
|
||||||
|
unsigned d = 7u & (0 - len);
|
||||||
|
upx_uint64_t zero = 0;
|
||||||
|
fo->write(&zero, d);
|
||||||
|
return d + len;
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned
|
static unsigned
|
||||||
funpad4(InputFile *fi)
|
funpad4(InputFile *fi)
|
||||||
{
|
{
|
||||||
@@ -3714,7 +3724,7 @@ void PackLinuxElf64::pack4(OutputFile *fo, Filter &ft)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (k && fo) {
|
if (k && fo) {
|
||||||
set_te64(&ehdri.e_shoff, fpad4(fo));
|
set_te64(&ehdri.e_shoff, fpad8(fo));
|
||||||
set_te16(&ehdri.e_shentsize, sizeof(*shdri));
|
set_te16(&ehdri.e_shentsize, sizeof(*shdri));
|
||||||
set_te16(&ehdri.e_shnum, 1+ k);
|
set_te16(&ehdri.e_shnum, 1+ k);
|
||||||
Elf64_Shdr shdr_undef; memset(&shdr_undef, 0, sizeof(shdr_undef));
|
Elf64_Shdr shdr_undef; memset(&shdr_undef, 0, sizeof(shdr_undef));
|
||||||
|
|||||||
Reference in New Issue
Block a user