static Address getThunkedExternalFunctionAddress(Program program, Address entry) {

		if (!program.getMemory().isExternalBlockAddress(entry)) {
			return null;
		}

		SymbolTable symbolTable = program.getSymbolTable();
		Symbol[] symbols = symbolTable.getSymbols(entry);
		if (symbols.length != 1) {
			return null;
		}
		Symbol s = symbols[0];
		if (s.isDynamic() || s.getSymbolType() != SymbolType.LABEL ||
			!s.getParentNamespace().isGlobal()) {
			return null;
		}
		try {
			ExternalManager extMgr = program.getExternalManager();
			ExternalLocation extLoc =
				extMgr.addExtFunction(Library.UNKNOWN, s.getName(), null, s.getSource());
			s.delete(); // remove original symbol from EXTERNAL block
			return extLoc.getExternalSpaceAddress();
		}
		catch (DuplicateNameException | InvalidInputException e) {
			// ignore - unexpected
		}
		return null;
	}
Handle conversion of label within reserved EXTERNAL block to a real 
external function which can be thunked.  This may be necessary when a
loaded symbol failed to identify itself as a function.  This will 
only handle single symbols contained within the global namespace.

@param program the program
@param entry function being created
@return newly created external function address or null
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/CreateThunkFunctionCmd.java