@@ -408,8 +408,9 @@ static bool checkOffsets(const typename ELFT::Phdr &Phdr,
408408 return true ;
409409
410410 // Only non-empty sections can be at the end of a segment.
411- uint64_t SectionSize = Sec.sh_size ? Sec.sh_size : 1 ;
412- AddressRange SectionAddressRange (Sec.sh_offset , Sec.sh_offset + SectionSize);
411+ uint64_t SectionSize = Sec.sh_size ? Sec.sh_size : 1ull ;
412+ AddressRange SectionAddressRange ((uint64_t )Sec.sh_offset ,
413+ Sec.sh_offset + SectionSize);
413414 AddressRange SegmentAddressRange (Phdr.p_offset ,
414415 Phdr.p_offset + Phdr.p_filesz );
415416 if (SegmentAddressRange.contains (SectionAddressRange))
@@ -425,8 +426,9 @@ template <class ELFT>
425426static bool checkVMA (const typename ELFT::Phdr &Phdr,
426427 const typename ELFT::Shdr &Sec, bool &Overlap) {
427428 // Only non-empty sections can be at the end of a segment.
428- uint64_t SectionSize = Sec.sh_size ? Sec.sh_size : 1 ;
429- AddressRange SectionAddressRange (Sec.sh_addr , Sec.sh_addr + SectionSize);
429+ uint64_t SectionSize = Sec.sh_size ? Sec.sh_size : 1ull ;
430+ AddressRange SectionAddressRange ((uint64_t )Sec.sh_addr ,
431+ Sec.sh_addr + SectionSize);
430432 AddressRange SegmentAddressRange (Phdr.p_vaddr , Phdr.p_vaddr + Phdr.p_memsz );
431433
432434 if (SegmentAddressRange.contains (SectionAddressRange))
0 commit comments