Index: lld/trunk/lib/ReaderWriter/ELF/SegmentChunks.cpp =================================================================== --- lld/trunk/lib/ReaderWriter/ELF/SegmentChunks.cpp +++ lld/trunk/lib/ReaderWriter/ELF/SegmentChunks.cpp @@ -362,7 +362,7 @@ // Set the segment memory size and the virtual address. this->setMemSize(curSliceAddress - startAddr + curSliceSize); - this->setVirtualAddr(curSliceAddress); + this->setVirtualAddr(startAddr); std::stable_sort(_segmentSlices.begin(), _segmentSlices.end(), SegmentSlice::compare_slices); }