WinPE: Require --strip-relocs if relocating compressed data
Thanks to @bitraid for investigating and suggestions. https://github.com/upx/upx/issues/880 modified: pefile.cpp
This commit is contained in:
parent
3533ebe804
commit
a5f5e7fc73
@ -1502,8 +1502,12 @@ void PeFile::processTls2(Reloc *const rel, const Interval *const iv, unsigned ne
|
|||||||
kc += newaddr + sizeof(tls) - tlsp->datastart;
|
kc += newaddr + sizeof(tls) - tlsp->datastart;
|
||||||
*p = kc + imagebase;
|
*p = kc + imagebase;
|
||||||
rel->add_reloc(kc, iv->ivarr[ic].len);
|
rel->add_reloc(kc, iv->ivarr[ic].len);
|
||||||
} else
|
} else {
|
||||||
rel->add_reloc(kc - imagebase, iv->ivarr[ic].len);
|
unsigned const a = kc - imagebase;
|
||||||
|
if (a < newaddr && !opt->win32_pe.strip_relocs)
|
||||||
|
throwCantPack("relocation too low (%#x < %#x); try --strip-relocs", a, newaddr);
|
||||||
|
rel->add_reloc(a, iv->ivarr[ic].len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const unsigned tls_data_size = tlsp->dataend - tlsp->datastart;
|
const unsigned tls_data_size = tlsp->dataend - tlsp->datastart;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user