private String getSymbolLabelString(Program program, Symbol symbol, Address markupAddress) {
		Address symbolAddress = symbol.getAddress();
		if (symbolAddress.isMemoryAddress()) {
			CodeUnit cu = program.getListing().getCodeUnitContaining(symbolAddress);
			if (isOffcut(symbolAddress, cu)) {
				return getOffcutLabelString(symbolAddress, cu, markupAddress);
			}
			else if (isStringData(cu)) {
				return getLabelStringForStringData((Data) cu, symbol);
			}
		}
		String name = symbol.getName();
		String displayName =
			addNamespace(program, symbol.getParentNamespace(), name, markupAddress);
		return simplifyTemplate(displayName);
	}
Generate a string for the given symbol, accounting for offcut situations.
Ghidra/Features/Base/src/main/java/ghidra/program/model/listing/CodeUnitFormat.java