private static void findExternalThunkLinkages(Program program, Address externalAddr,
			AddressSet linkageSet) {
		Symbol s = program.getSymbolTable().getPrimarySymbol(externalAddr);
		if (s == null || s.getSymbolType() != SymbolType.FUNCTION) {
			return;
		}
		Function extFunc = (Function) s.getObject();
		Address[] thunkAddrs = extFunc.getFunctionThunkAddresses();
		if (thunkAddrs == null) {
			return;
		}
		for (Address thunkAddr : thunkAddrs) {
			Function f = program.getListing().getFunctionAt(thunkAddr);
			if (f != null && !hasLinkageReference(program, f, linkageSet)) {
				// only add thunk its function body does not refer to a known linkage location
				linkageSet.add(thunkAddr);
			}
		}
	}
Locate direct thunks to the external function identified by externalAddr.  Only consider
those thunks whose function body does not refer to an address contained within the linkageSet
provided.
@param program the program
@param externalAddr external location address
@param linkageSet set of previously discovered pointer linkages to the external
location.  This set will be updated with any thunk linkage locations found.
Ghidra/Features/Base/src/main/java/ghidra/app/nav/NavigationUtils.java