private void deleteExternalLocation(Program p, ExternalLocation extLoc) {
		int txId = p.startTransaction("Delete External Location");
		try {
			p.getSymbolTable().removeSymbolSpecial(extLoc.getSymbol());
		}
		finally {
			p.endTransaction(txId, true);
		}
	}
Add memory reference

@param fromCodeUnit
@param opIndex
@param toAddr
@param isOffsetRef
@param offset
@param refType
@return true if add was successful
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/references/ReferencesPlugin.java