1
0
mirror of https://github.com/upx/upx synced 2025-10-05 19:20:23 +08:00

Stupid MSVC 14.2, 14.3; obtuse clang 14.0.5 (and MemBuffer vs alignment)

MSVC: cannot say "if (0)" to get "check symtax+semantics, but do not emit code"
clang+MemBuffer: must fight too much to get pointer to wider-than-char
	modified:   src/p_lx_elf.cpp
This commit is contained in:
John Reiser 2022-12-11 14:41:38 -08:00
parent d89813e911
commit 4cdf77e16f

View File

@ -4837,8 +4837,9 @@ PackLinuxElf64::unRela64(
if (jump_slots.getSize() < (r_offset - plt_va)) {
throwInternalError("bad r_offset for jump_slots");
}
upx_uint64_t *slot = (upx_uint64_t *)(r_offset - plt_va
+ (unsigned char *)jump_slots);
// really upx_uint64_t *, but clang makes it hard to say that
unsigned char *slot = r_offset - plt_va
+ (unsigned char *)jump_slots.getVoidPtr();
upx_uint64_t w = get_te64(slot);
if (xct_off <= w) {
set_te64(slot, w - asl_delta);
@ -4925,10 +4926,12 @@ void PackLinuxElf64::un_shlib_1(
adjABS(sym, 0ul - (unsigned long)asl_delta);
}
}
#if 0 //{ Stupid MSVC 14.2, 14.3
if (0 && fo) {
fo->seek(off_dynsym, SEEK_SET);
fo->rewrite(sym0, sz_dynsym);
}
#endif //}
}
}