public static Address[] getExternalLinkageAddresses(Program program, Address externalAddr) {
		if (!externalAddr.isExternalAddress()) {
			return new Address[0];
		}

		AddressSet set = new AddressSet();
		Listing listing = program.getListing();

		ReferenceIterator iter = program.getReferenceManager().getReferencesTo(externalAddr);
		while (iter.hasNext()) {
			Reference ref = iter.next();
			RefType refType = ref.getReferenceType();
			if (refType == RefType.DATA || refType == RefType.EXTERNAL_REF) {
				Data data = listing.getDefinedDataAt(ref.getFromAddress());
				if (data != null && (data.getDataType() instanceof Pointer)) {
					set.add(ref.getFromAddress());
				}
			}
		}

		findExternalThunkLinkages(program, externalAddr, set);

		Address[] linkAddresses = new Address[(int) set.getNumAddresses()];
		int index = 0;
		for (Address addr : set.getAddresses(true)) {
			linkAddresses[index++] = addr;
		}

		return linkAddresses;
	}
Locate all possible linkage addresses which correspond to the specified external address.
This will correspond to either a generic reference type (DATA or EXTERNAL_REF) on a pointer
or a thunk to the external location.  Both pointers and thunk constructs are utilized to
perform dynamic linking between programs and external libraries they reference.  These
linkage locations facilitate the function calls into any dynamically
linked external program (i.e., library).
@param program the program
@param externalAddr external location address
@return array of possible linkage addresses found
Ghidra/Features/Base/src/main/java/ghidra/app/nav/NavigationUtils.java