@Override
	public Symbol getSymbol(Reference ref) {
		if (ref == null) {
			return null;
		}
		if (ref.isMemoryReference()) {
			long symId = ref.getSymbolID();
			if (symId >= 0) {
				Symbol s = getSymbol(symId);
				// Ensure that referenced symbol exists and has an address which corresponds
				// to ref's to-address. This will always be either a LABEL or FUNCTION.
				if (s != null && ref.getToAddress().equals(s.getAddress())) {
					return s;
				}
			}
		}
		if (!ref.isExternalReference()) {
			// We check for variables first just in case ref refers to a memory parameter
			Variable var = refManager.getReferencedVariable(ref);
			if (var != null) {
				return var.getSymbol();
			}
		}
		return getPrimarySymbol(ref.getToAddress());
	}
Get all external symbols whose original import name matches the specified extLabel with an
optional constraint on a matching Library.
@param library optional Library constraint (may be null to ignore).
@param extProgAddr external program memory address
@return external symbol iterator
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/SymbolManager.java