diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index 9264a5b2..a21e3f80 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -3435,7 +3435,7 @@ int PackLinuxElf32::pack2(OutputFile *fo, Filter &ft) } x.offset = get_te32(&phdri[k].p_offset); x.size = get_te32(&phdri[k].p_filesz); - if (!is_shlib || hdr_u_len < x.size) { + if (!is_shlib || (off_t)hdr_u_len < x.size) { if (0 == nx) { // 1st PT_LOAD32 must cover Ehdr at 0==p_offset unsigned const delta = hdr_u_len; if (ft.id < 0x40) { @@ -3559,7 +3559,7 @@ int PackLinuxElf64::pack2(OutputFile *fo, Filter &ft) } x.offset = get_te64(&phdri[k].p_offset); x.size = get_te64(&phdri[k].p_filesz); - if (!is_shlib || hdr_u_len < x.size) { + if (!is_shlib || (off_t)hdr_u_len < x.size) { if (0 == nx) { // 1st PT_LOAD64 must cover Ehdr at 0==p_offset unsigned const delta = hdr_u_len; if (ft.id < 0x40) {