public FunctionSymbol createExternalFunctionSymbol(Address addr, String name,
			Namespace namespace, SourceType source, String originalImportName,
			Address externalProgramAddress) throws IOException, InvalidInputException {
		if (!addr.isExternalAddress()) {
			throw new IllegalArgumentException("External address required");
		}
		if (externalProgramAddress != null && !externalProgramAddress.isLoadedMemoryAddress()) {
			throw new IllegalArgumentException("Memory address required for external program");
		}
		try {
			DBRecord record = doCreateBasicSymbolRecord(name, namespace, addr, SymbolType.FUNCTION,
				true, source, false);
			MemorySymbol.setExternalFields(record, originalImportName, externalProgramAddress);
			adapter.updateSymbolRecord(record);

			FunctionSymbol newSymbol = new FunctionSymbol(this, cache, addr, record);

			symbolAdded(newSymbol);
			return newSymbol;
		}
		catch (DuplicateNameException e) {
			throw new RuntimeException("Unexpected", e); // duplicate was avoided by caller
		}
	}
Internal method for creating external function symbol.
<p>
NOTE: Any name conflict concerns must be checked before invoking this method. 

@param addr the address for the new symbol
@param name the name of the new symbol
@param namespace the namespace for the new symbol (null may be specified for global
           namespace)
@param source the SourceType of the new symbol
@param externalProgramAddress associated external program memory address (may be null) 
@param originalImportName  original imported name (i.e., mangled name)
@return the new symbol
@throws IOException if IO error occurs
@throws InvalidInputException if the name contains illegal characters (i.e. space)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/SymbolManager.java