@Override
	public int getReferenceCount() {
		lock.acquire();
		try {
			checkIsValid();
			ReferenceManager rm = symbolMgr.getReferenceManager();

			// If there is only one symbol, then all the references to this address count
			if (address.isExternalAddress() || hasExactlyOneSymbolAtAddress(address)) {
				return rm.getReferenceCountTo(address);
			}

			// search through references and see which ones apply specifically to this symbol
			ReferenceIterator iter = rm.getReferencesTo(address);
			int count = 0;
			boolean isPrimary = this.isPrimary();
			while (iter.hasNext()) {
				Reference ref = iter.next();
				long symbolID = ref.getSymbolID();
				// references refer to me if it matches my key or I'm primary and it doesn't
				// specify a specific symbol id
				if (symbolID == key || (isPrimary && symbolID < 0)) {
					count++;
				}
			}
			return count;
		}
		finally {
			lock.release();
		}
	}
low level record adjustment to move a symbol. Used only when moving a memory block or
 changing the image base.
 
@param newAddress the new address for the symbol
@param newName the new name for the symbol (or null if the name should stay the same)
@param newNamespace the new namespace for the symbol (or null if it should stay the same)
@param newSource the new SourceType for the symbol (or null if it should stay the same)
@param pinned the new pinned state
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/MemorySymbol.java