@Override
	public void setAssociation(Symbol s, Reference ref) {
		// Only valid for non-dynamic memory label symbols
		if (s.getSymbolType() != SymbolType.LABEL || s.isDynamic() || s.isExternal()) {
			return;
		}
		lock.acquire();
		try {
			Address symAddr = s.getAddress();
			if (!symAddr.equals(ref.getToAddress())) {
				throw new IllegalArgumentException("Symbol address(" + symAddr +
					") not equal to reference's To address(" + ref.getToAddress() + ")");
			}
			try {
				setSymbolID(ref, s.getID());
			}
			catch (IOException e) {
				program.dbError(e);
			}
			program.setObjChanged(ProgramEvent.SYMBOL_ASSOCIATION_ADDED, ref.getFromAddress(), ref,
				null, s);
		}
		finally {
			lock.release();
		}
	}
Symbol has been added
@param sym new symbol
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/references/ReferenceDBManager.java