private Program doLoad(ByteProvider provider, String programName, LoadSpec loadSpec,
			List<String> libraryNameList, List<Option> options, Object consumer, MessageLog log,
			TaskMonitor monitor) throws CancelledException, IOException {
		LanguageCompilerSpecPair pair = loadSpec.getLanguageCompilerSpec();
		Language language = getLanguageService().getLanguage(pair.languageID);
		CompilerSpec compilerSpec = language.getCompilerSpecByID(pair.compilerSpecID);

		monitor.setMessage(provider.getName());

		Address imageBaseAddr = language.getAddressFactory()
				.getDefaultAddressSpace()
				.getAddress(
					loadSpec.getDesiredImageBase());
		Program program = createProgram(provider, programName, imageBaseAddr, getName(), language,
			compilerSpec, consumer);

		int transactionID = program.startTransaction("Loading");
		boolean success = false;
		try {
			log.appendMsg("Loading %s...".formatted(provider.getFSRL()));
			load(provider, loadSpec, options, program, monitor, log);
			createDefaultMemoryBlocks(program, language, log);
			libraryNameList.addAll(getLibraryNames(provider, program));
			success = true;
			return program;
		}
		finally {
			program.endTransaction(transactionID, true); // More efficient to commit when program will be discarded
			if (!success) {
				program.release(consumer);
			}
		}
	}
Loads the given provider

@param provider The {@link ByteProvider} to load
@param programName The name of the new program
@param loadSpec The {@link LoadSpec}
@param libraryNameList A {@link List} to be populated with the loaded program's dependent
  library names
@param options The load options
@param log The log
@param consumer A consumer object for {@link DomainObject}s generated
@param monitor A cancelable task monitor
@return The newly loaded {@link Program}
@throws CancelledException if the user cancelled the load operation
@throws IOException if there was an IO-related error during the load
Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/AbstractLibrarySupportLoader.java