@Override
	public Symbol getSymbol(String name, Address address, Namespace namespace) {
		if (namespace == null) {
			namespace = program.getGlobalNamespace();
		}

		if (isDeletedNamespace(namespace)) {
			return null;
		}
		checkValidNamespaceArgument(namespace);

		long namespaceId = namespace.getID();

		lock.acquire();
		try {
			DBRecord record = adapter.getSymbolRecord(address, name, namespaceId);
			if (record != null) {
				return getSymbol(record);
			}
		}
		catch (IOException e) {
			program.dbError(e);
		}
		finally {
			lock.release();
		}

		// check for default external symbol
		if (namespace.isExternal() && SymbolUtilities.isPossibleDefaultExternalName(name)) {
			return searchNamespaceForSymbol(namespace, name, address);
		}

		// also check for possible default parameter or local variable symbol
		if (namespace instanceof Function &&
			SymbolUtilities.isPossibleDefaultLocalOrParamName(name)) {
			return searchNamespaceForSymbol(namespace, name, address);
		}

		// check if name is a default name
		Symbol symbol = getSymbolForDynamicName(name);
		if (symbol != null && address.equals(symbol.getAddress()) &&
			namespace.equals(symbol.getParentNamespace())) {
			return symbol;
		}
		return null;
	}
Removes the symbol directly

@param sym the symbol to remove.
@return true if the symbol was removed, false otherwise.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/SymbolManager.java