code: def link(
      obj_files,
      out_file=None,
      shared=False,
      Runner=None,
      cwd=None,
      cplus=False,
      fort=False,
      extra_objs=None,
      **kwargs,
  ):
      """Link object files.
  
      Parameters
      ==========
  
      obj_files: iterable of str
          Paths to object files.
      out_file: str (optional)
          Path to executable/shared library, if ``None`` it will be
          deduced from the last item in obj_files.
      shared: bool
          Generate a shared library?
      Runner: CompilerRunner subclass (optional)
          If not given the ``cplus`` and ``fort`` flags will be inspected
          (fallback is the C compiler).
      cwd: str
          Path to the root of relative paths and working directory for compiler.
      cplus: bool
          C++ objects? default: ``False``.
      fort: bool
          Fortran objects? default: ``False``.
      extra_objs: list
          List of paths to extra object files / static libraries.
      \\*\\*kwargs: dict
          Keyword arguments passed to ``Runner``.
  
      Returns
      =======
  
      The absolute path to the generated shared object / executable.
  
      """
      if out_file is None:
          out_file, ext = os.path.splitext(
              os.path.basename(obj_files[-1])
          )
          if shared:
              out_file += get_config_var("EXT_SUFFIX")
  
      if not Runner:
          if fort:
              Runner, extra_kwargs, vendor = get_mixed_fort_c_linker(
                  vendor=kwargs.get("vendor", None),
                  cplus=cplus,
                  cwd=cwd,
              )
              for k, v in extra_kwargs.items():
                  if k in kwargs:
                      kwargs[k].expand(v)
                  else:
                      kwargs[k] = v
          else:
              if cplus:
                  Runner = CppCompilerRunner
              else:
                  Runner = CCompilerRunner
  
      flags = kwargs.pop("flags", [])
      if shared:
          if "-shared" not in flags:
              flags.append("-shared")
      run_linker = kwargs.pop("run_linker", True)
      if not run_linker:
          raise ValueError("run_linker was set to False (nonsensical).")
  
      out_file = get_abspath(out_file, cwd=cwd)
      runner = Runner(
          obj_files + (extra_objs or []),
          out_file,
          flags,
          cwd=cwd,
          **kwargs,
      )
      runner.run()
      return out_file
  
imports: import glob
  import os
  import shutil
  import subprocess
  import sys
  import tempfile
  import warnings
  from sysconfig import get_config_var, get_config_vars, get_path
  from .runners import CCompilerRunner, CppCompilerRunner, FortranCompilerRunner
  from .util import get_abspath, make_dirs, copy, Glob, ArbitraryDepthGlob, glob_at_depth, import_module_from_file, pyx_is_cplus, sha256_of_string, sha256_of_file, CompileError
label_desc: Use image node_id 3 for calling a global function with example usage: link(obj_files, out_file, shared, Runner, cwd, cplus, fort, extra_objs) and returns: out_file