dynlink: extract more common code
dynlink: add another example