Move getRealLinkageName to a common place and remove all the duplicates of it.