private void setLabel(Listing listing, SymbolTable symTable, Address addr, CodeUnitInfo info) {

		if (!info.hasSymbols()) {
			return;
		}

		Function function = listing.getFunctionContaining(addr);
		Namespace scope = null;
		if (function != null) {
			scope = symTable.getNamespace(addr);
		}
		boolean functionExists = (function != null);

		// Copy primary symbol
		String primaryName = info.getPrimarySymbolName();
		if (primaryName != null) {
			Symbol s = symTable.getPrimarySymbol(addr);
			try {
				SourceType newSource = info.getPrimarySymbolSource();
				if (newSource != SourceType.DEFAULT) {
					// Only set the label if it is not a default label.
					if (s == null || (s.isDynamic()) ||
						(s.getSource() != SourceType.DEFAULT && !s.getName().equals(primaryName))) {
						s = symTable.createLabel(addr, primaryName, scope, newSource);
					}
					else {
						s.setName(primaryName, newSource);
					}
				}
			}
			catch (DuplicateNameException e) {
				messages.append("Could not set label name--duplicate name: " + primaryName)
						.append('\n');
			}
			catch (InvalidInputException e) {
				// should not happen
				Msg.error(this, "CodeUnitInfoEdit: Bad symbol name: '" + primaryName + "'", e);
				return;
			}
		}

		// Copy function scope symbols
		if (functionExists) {
			createSymbols(symTable, addr, info.getFunctionScopeSymbolNames(), scope,
				info.getFunctionScopeSymbolSources());
		}

		// Copy other symbols in the global scope
		createSymbols(symTable, addr, info.getOtherSymbolNames(), null,
			info.getOtherSymbolSources());
	}
Set the label at the given address.
@param symTable symbol table
@param addr address for the label
@param info object containing label and aliases
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/comments/CodeUnitInfoPasteCmd.java