Open
Description
https://github.com/llvm/llvm-project/pull/130517/files introduced a change
if (RequiresFirstSectionOutsideFirstPage) {
SectOffset = alignToPowerOf2(SectOffset, PageSize);
RequiresFirstSectionOutsideFirstPage = false;
}
This is an issue for several reasons:
- If the first section is outside of first page (0x4000), but starts at (0x4004), then this gets aligned to (0x8000), which is not necessary. Here a fix could be
if (RequiresFirstSectionOutsideFirstPage && SectOffset < PageSize) {
- However, if the block is actually entered, then trouble happens with next sections: they do not get moved together with this section. Then we can get to a state of
truncated or malformed object (section contents at offset 20160 with a size of 111316, overlaps section contents at offset 32768 with a size of 228)