protected static List<SegmentInfo> synthesizeSegmentInfo(List<SegmentInfo> segments,
			long firstSectionOffset, long imageAlign) {

		long mask = -imageAlign;
		long addend = imageAlign - 1;

		long determinedSectionOffset = firstSectionOffset;
		long origSectionOffset;
		long sectionLength = 0; // setting "previous" section length to zero for first pass.

		List<SegmentInfo> synthesizedSegmentInfo = new ArrayList<>();
		for (SegmentInfo info : segments) {
			origSectionOffset = info.getStart();
			if (origSectionOffset != 0x00L) {
				determinedSectionOffset = origSectionOffset;
			}
			else {
				// Performing "least integer" (ceiling) function with imageAlign:
				// resultAlign = (long)(imageAlign * leastInteger((double) val / (double) imageAlign))
				// where imageAlign must be a non-zero power of two for this calculation.
				// Uses previous section length.
				determinedSectionOffset += (sectionLength + addend) & mask;
			}

			// the current section length is used for next section offset calculation.
			sectionLength = info.getLength();
			SegmentInfo synthesized = new SegmentInfo(determinedSectionOffset, sectionLength);
			synthesizedSegmentInfo.add(synthesized);
		}

		return synthesizedSegmentInfo;
	}
Clean up possibly incomplete segment information, by synthesizing missing offset data.
@param segments segments to correct
@param firstSectionOffset "known" first section offset
@param imageAlign section alignment
@return new synthesized segment info with synthesized offsets
Ghidra/Features/PDB/src/main/java/ghidra/app/util/pdb/pdbapplicator/PdbAddressCalculator.java