public final Reference createExternalReference(Instruction instruction, int operandIndex,
			String libraryName, String externalLabel, Address externalAddr, RefType refType)
			throws Exception {
		ReferenceManager referenceManager = currentProgram.getReferenceManager();
		Reference reference =
			referenceManager.addExternalReference(instruction.getMinAddress(), libraryName,
				externalLabel, externalAddr, SourceType.USER_DEFINED, operandIndex, refType);
		return reference;
	}
Creates an external reference from the given instruction.
@param instruction the instruction
@param operandIndex the operand index on the instruction
@param libraryName the name of the library being referred
@param externalLabel the name of function in the library being referred
@param externalAddr the address of the function in the library being referred
@param refType the appropriate external reference type (e.g., DATA, COMPUTED_CALL, etc.)
@return the newly created external reference
@throws Exception if an exception occurs
Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java