private ExternalLocation findExternalLocation(ExternalLocation origExtLoc,
			Symbol resultToSymbol) {
		if (resultToSymbol != null) {
			ExternalLocation toLocation =
				resultProgram.getExternalManager().getExternalLocation(resultToSymbol);
			if (toLocation != null) {
				return toLocation;
			}
		}
		try {
			return DiffUtility.createExtLocation(originProgram, origExtLoc, resultProgram);
		}
		catch (InvalidInputException | DuplicateNameException e) {
			// can't create one
		}
		return null;
	}
<CODE>addReference</CODE> creates a reference in program1 that is equivalent
to the one specified as a parameter. If a symbol ID is specified, the
reference will refer to the symbol in program1 with that ID. If the reference
is an external reference, then the external location associated with it can be replaced
also by setting the replace external location flag.
@param originRef the reference equivalent to the one to be created.
@param toSymbolID ID of the symbol to referred to. null indicates don't
refer directly to a symbol.
@param replaceExtLoc the replace external location flag. true indicates to replace the
external location, if applicable, with the one defined for the reference passed to this method.
@return the reference that was created. null if none created.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMerge.java