Adding some more debug infor to link step.
Adding function for extension detection.