private void reexport(Program program, List<Loaded<Program>> loadedPrograms,
			List<DomainFolder> searchFolders, List<LibrarySearchPath> searchPaths,
			List<Option> options, TaskMonitor monitor, MessageLog log)
			throws CancelledException, Exception {

		for (String path : getReexportPaths(program, log)) {
			monitor.checkCancelled();
			Program programToRelease = null;
			try {
				Loaded<Program> match = findLibraryInLoadedList(loadedPrograms, path);
				Program lib = null;
				if (match != null) {
					lib = match.getDomainObject();
				}
				if (lib == null) {
					for (DomainFolder searchFolder : searchFolders) {
						DomainFile df =
							findLibraryInProject(path, searchFolder, searchPaths, options, monitor);
						if (df != null) {
							DomainObject obj = df.getDomainObject(this, true, true, monitor);
							if (obj instanceof Program p) {
								lib = p;
								programToRelease = p;
							}
							break;
						}
					}
				}
				if (lib == null) {
					continue;
				}
				List<Symbol> reexportedSymbols = CollectionUtils
						.asStream(lib.getSymbolTable().getExternalEntryPointIterator())
						.map(lib.getSymbolTable()::getPrimarySymbol)
						.filter(Objects::nonNull)
						.toList();
				Address addr = MachoProgramUtils.addExternalBlock(program,
					reexportedSymbols.size() * 8, log);
				monitor.initialize(reexportedSymbols.size(), "Reexporting symbols...");
				for (Symbol symbol : reexportedSymbols) {
					monitor.increment();
					String name = SymbolUtilities.replaceInvalidChars(symbol.getName(), true);
					program.getSymbolTable().addExternalEntryPoint(addr);
					program.getSymbolTable().createLabel(addr, name, SourceType.IMPORTED);
					Function function = program.getFunctionManager()
							.createFunction(name, addr, new AddressSet(addr), SourceType.IMPORTED);
					ExternalLocation loc = program.getExternalManager()
							.addExtLocation(path, name, null, SourceType.IMPORTED);
					function.setThunkedFunction(loc.createFunction());

					addr = addr.add(8);
				}
			}
			finally {
				if (programToRelease != null) {
					programToRelease.release(this);
				}
			}
		}
	}
"Reexports" symbols from to a {@link Program}

@param program The {@link Program} to receive the reexports
@param loadedPrograms A {@link List} of {@link Loaded} {@link Program}s to find get the
  reexportable symbols from
@param searchFolders A {@link List} of project folders that may contain already-loaded
  {@link Program}s with reexportable symbols
@param searchPaths A {@link List} of file system search paths that will be searched
@param options The load options
@param monitor A cancelable task monitor
@param log The log
@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/MachoLoader.java