public static Symbol getSymbol(Symbol symbol, Program otherProgram) {
		if (symbol == null) {
			return null;
		}

		SymbolType symbolType = symbol.getSymbolType();

		if (symbolType == SymbolType.GLOBAL) {
			return otherProgram.getGlobalNamespace().getSymbol();
		}

		String name = symbol.getName();
		Symbol otherParent = getSymbol(symbol.getParentSymbol(), otherProgram);
		Namespace otherNamespace = otherParent == null ? null : (Namespace) otherParent.getObject();
		if (otherNamespace == null) {
			return null;
		}

		if (symbolType == SymbolType.LIBRARY) {
			return otherProgram.getSymbolTable().getLibrarySymbol(name);
		}
		if (symbolType == SymbolType.CLASS) {
			return otherProgram.getSymbolTable().getClassSymbol(name, otherNamespace);
		}
		if (symbolType == SymbolType.NAMESPACE) {
			return otherProgram.getSymbolTable().getNamespaceSymbol(name, otherNamespace);
		}
		if (symbolType == SymbolType.PARAMETER || symbolType == SymbolType.LOCAL_VAR) {
			return getVariableSymbol(symbol, otherProgram, otherNamespace);
		}
		if (symbolType == SymbolType.FUNCTION) {
			return getOtherFunctionSymbol(symbol, otherProgram, otherNamespace);
		}
		if (symbolType == SymbolType.LABEL) {
			return getOtherCodeSymbol(symbol, otherProgram, otherNamespace);
		}
		// In case any new SymbolTypes get added
		throw new AssertException("Got unexpected SymbolType: " + symbolType);
	}
Given a symbol for a specified program, get the corresponding symbol from the
specified otherProgram.
<br>
In the case of external locations this performs an exact match based upon symbol name, 
namespace and symbol type.

@param symbol symbol to look for
@param otherProgram other program
@return corresponding symbol for otherProgram or null if no such symbol exists.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/SimpleDiffUtility.java