private void applyImports(Program program, MessageLog log, TaskMonitor monitor) {
		monitor.setMessage("Applying imports..." + program.getName());

		ExternalManager em = program.getExternalManager();

		String[] libs = em.getExternalLibraryNames();

		for (String lib : libs) {
			if (monitor.isCancelled()) {
				return;
			}

			int size = program.getLanguage().getLanguageDescription().getSize();

			LibrarySymbolTable symtab = LibraryLookupTable.getSymbolTable(lib, size, log);

			Iterator<ExternalLocation> iter = em.getExternalLocations(lib);
			while (iter.hasNext()) {
				if (monitor.isCancelled()) {
					return;
				}

				ExternalLocation extLoc = iter.next();

				String symName = extLoc.getLabel();

				// this check belongs here, because we want to demangled even
				// if we do not have a symbol table...
				if (symtab == null) {
					continue;
				}

				// if symbol is imported by ordinal, then see if the
				// library contains a name for that ordinal. if so,
				// then rename the symbol

				LibraryExportedSymbol expSym = symtab.getSymbol(symName);
				if (expSym == null) {
					try {
						int ord = SymbolUtilities.getOrdinalValue(symName);
						if (ord == -1) {
							continue;
						}

						expSym = symtab.getSymbol(ord);

						if (expSym == null) {
							log.appendMsg("Unable to locate symbol [" + symName + "] in [" +
								LibraryLookupTable.getExistingExportsFile(lib, size) +
								"]. Please verify the version is correct.");
							continue;
						}

						extLoc.setLocation(expSym.getName(), extLoc.getAddress(),
							SourceType.IMPORTED);
					}
					catch (DuplicateNameException | InvalidInputException e) {
						log.appendMsg("Error creating label: ", e.getMessage());
					}
				}

				int purgeSize = expSym.getPurge();
				// no purge size for 64-bit programs
				boolean isNot32Bit = size > 32;
				if ((purgeSize == -1 || purgeSize < -1024 || purgeSize > 1024) || isNot32Bit) {
					continue;
				}

				// Create or get external function
				Function extFunc = extLoc.createFunction();

				extFunc.setStackPurgeSize(purgeSize);
				if (expSym.hasNoReturn()) {
					extFunc.setNoReturn(true);
				}
// TODO: This should not be done at time of import and should be done
// by a late running analyzer (e.g., stack analyzer) if no signature
// has been established
//				int stackShift = program.getCompilerSpec().getDefaultCallingConvention().getStackshift();
//				if (stackShift == -1) {
//					stackShift = 0;
//				}

//				int numParams = expSym.getPurge() / 4;
//				if (numParams > 0) {
//					// HACK: assumes specific stack-based x86 convention
//					try {
//						Parameter[] params = new Parameter[numParams];
//						for (int ind = 0; ind < numParams; ind++) {
//							params[ind] = new ParameterImpl(null, Undefined.getUndefinedDataType(4),
//								ind * 4 + stackShift, p);
//						}
//						extFunc.replaceParameters(FunctionUpdateType.DYNAMIC_STORAGE_ALL_PARAMS,
//							false, SourceType.ANALYSIS, params);
//					}
//					catch (InvalidInputException | DuplicateNameException e) {
//						log.appendMsg("Error creating label: ", e.getMessage());
//					}
//				}

			}
		}
	}
Applies the library symbol table to the imported symbols of the specified
{@link Program}. Symbols may also be demangled (although this could be a mistake).

@param program The {@link Program} whose imports should be resolved.
@param log import message log
@param monitor task monitor, if cancelled partial results may exist
Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/AbstractOrdinalSupportLoader.java