private void updateExternalLocation(Program toPgm, ExternalReference fromRef) {
		ExternalLocation fromExtLoc = fromRef.getExternalLocation();
		Namespace fromNamespace = fromExtLoc.getParentNameSpace();
		String fromExtLabel = fromExtLoc.getLabel();
		Address fromExtAddr = fromExtLoc.getAddress();
		SourceType fromSourceType = fromExtLoc.getSource();

		ExternalManager toExtMgr = toPgm.getExternalManager();
		try {
			Program fromPgm = fromExtLoc.getSymbol().getProgram();
			Namespace toNamespace = DiffUtility.createNamespace(fromPgm, fromNamespace, toPgm);
			ExternalLocation toExternalLocation =
				SimpleDiffUtility.getMatchingExternalLocation(fromPgm, fromExtLoc, toPgm, false);
			if (toExternalLocation == null) {
				toExtMgr.addExtLocation(toNamespace, fromExtLabel, fromExtAddr, fromSourceType);
			}
			else {
				String toExtLabel = toExternalLocation.getLabel();
				// Found the named external and updated its external address if necessary.
				toExternalLocation.setLocation(toExtLabel, fromExtAddr, fromExtLoc.getSource());
			}
		}
		catch (InvalidInputException e) {
			Msg.error(this, "Unexpected Exception: " + e.getMessage(), e);
			errorMsg.append(
				"InvalidInputException updating external location: " + e.getMessage() + "\n");
		}
		catch (DuplicateNameException e) {
			Msg.error(this, "Unexpected Exception: " + e.getMessage(), e);
			errorMsg.append(
				"DuplicateNameException updating external location: " + e.getMessage() + "\n");
		}
	}
Replaces the reference in program1 with the reference from the origin program.
@param resultRef the program1 reference to be replaced.
@param originRef the program2 reference used to replace what's in program1.
@return the resulting reference in program1. null if reference is removed
by the replace.
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMerge.java