void addReference(long equateID, Address address, int opIndex, long dynamicHash)
			throws IOException {
		lock.acquire();
		try {
			EquateDB equateDB = getEquateDB(equateID);
			String name = equateDB.getName();
			long value = equateDB.getValue();

			long addr = addrMap.getKey(address, true);

			// first remove reference for address and opIndex
			Field[] keys = refAdapter.getRecordKeysForAddr(addr);
			for (Field key : keys) {
				EquateRefDB ref = getEquateRefDB(key.getLongValue());
				if (dynamicHash != 0) {
					if (ref.getDynamicHashValue() == dynamicHash) {
						removeRef(equateDB, ref);
					}
				}
				else if (ref.getDynamicHashValue() == 0 && ref.getOpIndex() == opIndex) {
					removeRef(equateDB, ref);
				}
			}
			DBRecord record =
				refAdapter.createReference(addr, (short) opIndex, dynamicHash, equateID);
			new EquateRefDB(this, refCache, record);

			// fire event: oldValue=EquateInfo, newValue = null
			program.setChanged(ProgramEvent.EQUATE_REFERENCE_ADDED, address, address,
				new EquateInfo(name, value, address, opIndex, dynamicHash), null);
		}
		finally {
			lock.release();
		}
	}
Constructor
@param handle database handle
@param addrMap map that converts addresses to longs and longs to addresses
@param openMode one of ProgramDB.CREATE, UPDATE, UPGRADE, or READ_ONLY
@param lock the program synchronization lock
@param monitor the progress monitor used when upgrading.
@throws VersionException if the database version doesn't match the current version.
@throws IOException if a database error occurs.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/EquateManager.java