'Link the objects.'

def link(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None):

    extra_preargs = copy.copy((extra_preargs or []))
    libraries = copy.copy((libraries or []))
    objects = copy.copy((objects or []))
    libraries.extend(self.dll_libraries)
    if ((export_symbols is not None) and ((target_desc != self.EXECUTABLE) or (self.linker_dll == 'gcc'))):
        temp_dir = os.path.dirname(objects[0])
        (dll_name, dll_extension) = os.path.splitext(os.path.basename(output_filename))
        def_file = os.path.join(temp_dir, (dll_name + '.def'))
        lib_file = os.path.join(temp_dir, (('lib' + dll_name) + '.a'))
        contents = [('LIBRARY    %s' % os.path.basename(output_filename)), 'EXPORTS']
        for sym in export_symbols:
            contents.append(sym)
        self.execute(write_file, (def_file, contents), ('writing    %s' % def_file))
        if (self.linker_dll == 'dllwrap'):
            extra_preargs.extend(['--output-lib', lib_file])
            extra_preargs.extend(['--def', def_file])
        else:
            objects.append(def_file)
    if (not debug):
        extra_preargs.append('-s')
    UnixCCompiler.link(self, target_desc, objects, output_filename, output_dir, libraries, library_dirs, runtime_library_dirs, None, debug, extra_preargs, extra_postargs, build_temp, target_lang)
