Avoid some warnings.
This commit is contained in:
parent
959aaebede
commit
abc71baaa6
@ -89,7 +89,8 @@ compress_lzma$(objext) : CXXFLAGS += -Wno-cast-qual
|
|||||||
compress_lzma$(objext) : CXXFLAGS += -Wno-non-virtual-dtor
|
compress_lzma$(objext) : CXXFLAGS += -Wno-non-virtual-dtor
|
||||||
compress_lzma$(objext) : CXXFLAGS += -Wno-shadow
|
compress_lzma$(objext) : CXXFLAGS += -Wno-shadow
|
||||||
compress_lzma$(objext) : CXXFLAGS += -Wno-unused
|
compress_lzma$(objext) : CXXFLAGS += -Wno-unused
|
||||||
##compress_lzma$(objext) : CXXFLAGS += -Wno-error
|
# needed for gcc-4.3:
|
||||||
|
compress_lzma$(objext) : CXXFLAGS += -Wno-error
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -542,10 +542,12 @@ void PackArmPe::pack(OutputFile *fo)
|
|||||||
else if (opt->win32_pe.strip_relocs < 0)
|
else if (opt->win32_pe.strip_relocs < 0)
|
||||||
opt->win32_pe.strip_relocs = (ih.imagebase >= 0x10000);
|
opt->win32_pe.strip_relocs = (ih.imagebase >= 0x10000);
|
||||||
if (opt->win32_pe.strip_relocs)
|
if (opt->win32_pe.strip_relocs)
|
||||||
|
{
|
||||||
if (ih.imagebase < 0x10000)
|
if (ih.imagebase < 0x10000)
|
||||||
throwCantPack("--strip-relocs is not allowed when imagebase < 0x10000");
|
throwCantPack("--strip-relocs is not allowed when imagebase < 0x10000");
|
||||||
else
|
else
|
||||||
ih.flags |= RELOCS_STRIPPED;
|
ih.flags |= RELOCS_STRIPPED;
|
||||||
|
}
|
||||||
|
|
||||||
if (memcmp(isection[0].name,"UPX",3) == 0)
|
if (memcmp(isection[0].name,"UPX",3) == 0)
|
||||||
throwAlreadyPackedByUPX();
|
throwAlreadyPackedByUPX();
|
||||||
|
|||||||
@ -256,8 +256,9 @@ bool PackPs1::canPack()
|
|||||||
fi->readx(buf, sizeof(buf));
|
fi->readx(buf, sizeof(buf));
|
||||||
checkAlreadyPacked(buf, sizeof(buf));
|
checkAlreadyPacked(buf, sizeof(buf));
|
||||||
|
|
||||||
for (unsigned i = 0; i < sizeof(buf); i++)
|
for (size_t i = 0; i < sizeof(buf); i++)
|
||||||
if (buf[i] != 0)
|
if (buf[i] != 0)
|
||||||
|
{
|
||||||
if (!opt->force)
|
if (!opt->force)
|
||||||
throwCantPack("unknown data in header (try --force)");
|
throwCantPack("unknown data in header (try --force)");
|
||||||
else
|
else
|
||||||
@ -267,6 +268,7 @@ bool PackPs1::canPack()
|
|||||||
opt->backup = 1;
|
opt->backup = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!checkFileHeader())
|
if (!checkFileHeader())
|
||||||
throwCantPack("unsupported header flags (try --force)");
|
throwCantPack("unsupported header flags (try --force)");
|
||||||
if (!opt->force && file_size < PS_MIN_SIZE)
|
if (!opt->force && file_size < PS_MIN_SIZE)
|
||||||
@ -320,7 +322,7 @@ void PackPs1::buildLoader(const Filter *)
|
|||||||
sa_tmp += overlap = ALIGN_UP((ph.overlap_overhead - sa_tmp), 4u);
|
sa_tmp += overlap = ALIGN_UP((ph.overlap_overhead - sa_tmp), 4u);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCon || !isCon && M_IS_LZMA(ph.method))
|
if (isCon || M_IS_LZMA(ph.method))
|
||||||
foundBss = findBssSection();
|
foundBss = findBssSection();
|
||||||
|
|
||||||
if (M_IS_LZMA(ph.method) && !buildPart2)
|
if (M_IS_LZMA(ph.method) && !buildPart2)
|
||||||
@ -574,11 +576,13 @@ void PackPs1::pack(OutputFile *fo)
|
|||||||
linker->defineSymbol("ldr_sz", M_IS_LZMA(ph.method) ? sz_lunc + 16 : (d_len-pad_code));
|
linker->defineSymbol("ldr_sz", M_IS_LZMA(ph.method) ? sz_lunc + 16 : (d_len-pad_code));
|
||||||
|
|
||||||
if (foundBss)
|
if (foundBss)
|
||||||
|
{
|
||||||
if (M_IS_LZMA(ph.method))
|
if (M_IS_LZMA(ph.method))
|
||||||
linker->defineSymbol("wrkmem", bss_end - 160 - getDecompressorWrkmemSize()
|
linker->defineSymbol("wrkmem", bss_end - 160 - getDecompressorWrkmemSize()
|
||||||
- (sz_lunc + 16));
|
- (sz_lunc + 16));
|
||||||
else
|
else
|
||||||
linker->defineSymbol("wrkmem", bss_end - 16 - (d_len - pad_code));
|
linker->defineSymbol("wrkmem", bss_end - 16 - (d_len - pad_code));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const unsigned entry = comp_data_start - e_len;
|
const unsigned entry = comp_data_start - e_len;
|
||||||
|
|||||||
@ -629,10 +629,12 @@ void PackW32Pe::pack(OutputFile *fo)
|
|||||||
else if (opt->win32_pe.strip_relocs < 0)
|
else if (opt->win32_pe.strip_relocs < 0)
|
||||||
opt->win32_pe.strip_relocs = (ih.imagebase >= 0x400000);
|
opt->win32_pe.strip_relocs = (ih.imagebase >= 0x400000);
|
||||||
if (opt->win32_pe.strip_relocs)
|
if (opt->win32_pe.strip_relocs)
|
||||||
|
{
|
||||||
if (ih.imagebase < 0x400000)
|
if (ih.imagebase < 0x400000)
|
||||||
throwCantPack("--strip-relocs is not allowed when imagebase < 0x400000");
|
throwCantPack("--strip-relocs is not allowed when imagebase < 0x400000");
|
||||||
else
|
else
|
||||||
ih.flags |= RELOCS_STRIPPED;
|
ih.flags |= RELOCS_STRIPPED;
|
||||||
|
}
|
||||||
|
|
||||||
if (memcmp(isection[0].name,"UPX",3) == 0)
|
if (memcmp(isection[0].name,"UPX",3) == 0)
|
||||||
throwAlreadyPackedByUPX();
|
throwAlreadyPackedByUPX();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user