@Override
	public Symbol getPrimarySymbol(Address addr) {
		if (!addr.isMemoryAddress() && !addr.isExternalAddress()) {
			return null;
		}
		if (addr.isExternalAddress()) {
			Symbol[] symbols = getSymbols(addr);
			return symbols.length > 0 ? symbols[0] : null;
		}

		lock.acquire();
		try {
			DBRecord record = adapter.getPrimarySymbol(addr);
			if (record != null) {
				return getSymbol(record);
			}
			if (addr.isMemoryAddress() && refManager.hasReferencesTo(addr)) {
				return getDynamicSymbol(addr);
			}
		}
		catch (IOException e) {
			program.dbError(e);
		}
		finally {
			lock.release();
		}
		return null;
	}
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