private void processProgramHeaders(TaskMonitor monitor) throws CancelledException {

		if (elf.isRelocatable() && elf.getProgramHeaderCount() != 0) {
			log("Ignoring unexpected program headers for relocatable ELF (e_phnum=" +
				elf.getProgramHeaderCount() + ")");
			return;
		}

		boolean includeOtherBlocks = ElfLoaderOptionsFactory.includeOtherBlocks(options);

		ElfProgramHeader[] elfProgramHeaders = elf.getProgramHeaders();

		monitor.setMessage("Processing program headers...");
		monitor.initialize(elfProgramHeaders.length);
		for (int i = 0; i < elfProgramHeaders.length; ++i) {
			monitor.checkCancelled();
			monitor.incrementProgress(1);
			ElfProgramHeader elfProgramHeader = elfProgramHeaders[i];
			if (elfProgramHeader.getType() == ElfProgramHeaderConstants.PT_NULL) {
				continue;
			}
			long fileOffset = elfProgramHeader.getOffset();
			if (elfProgramHeader.getType() != ElfProgramHeaderConstants.PT_LOAD) {
				if (!includeOtherBlocks) {
					continue;
				}
				if (elfProgramHeader.isInvalidOffset() || fileOffset >= fileBytes.getSize()) {
					log("Skipping segment[" + i + ", " + elfProgramHeader.getDescription() +
						"] with invalid file offset");
					continue;
				}
				if (elf.getProgramLoadHeaderContainingFileOffset(fileOffset) != null) {
					continue;
				}
				ElfSectionHeader section = elf.getSectionHeaderContainingFileRange(fileOffset,
					elfProgramHeader.getFileSize());
				if (section != null) {
					log("Skipping segment[" + i + ", " + elfProgramHeader.getDescription() +
						"] included by section " + section.getNameAsString());
					continue;
				}
			}
			if (elfProgramHeader.isInvalidOffset() || fileOffset >= fileBytes.getSize()) {
				log("Skipping PT_LOAD segment[" + i + ", " + elfProgramHeader.getDescription() +
					"] with invalid file offset");
				continue;
			}
			processProgramHeader(elfProgramHeader, i);
		}
	}
Expand/create PT_LOAD program header block regions which are zeroed
- to the extent possible.  This should only be done when section headers are
not present.
@param monitor load task monitor
@throws CancelledException if load task is cancelled
Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/ElfProgramBuilder.java