Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lld: elf: Fix sections with explict addresses in regions
Patch by Gabriel Smith. The address for a section would be evaluated before the region was switched to. Because of this, the position within the region would not be updated. After the region is swapped to the dot would be set to the out of date position within the region, undoing the section address evaluation. To fix this, the region is swapped to before the section's address is evaluated. As part of the fallout of this, expandMemoryRegions needed to be gated in setDot on the condition that the evaluated address is less than the dot. This is for the case where sections are not listed from lowest address to highest address. Finally, a test for the case where sections are listed "out of order" was added. Differential Revision: https://reviews.llvm.org/D60744 llvm-svn: 358638
- Loading branch information