def METHOD_NAME(self, *, elf_file: ElfFile) -> None:
    """Patch elf_file with the Patcher instance configuration.
    If the ELF is executable, patch it to use the configured linker.
    If the ELF has dependencies (DT_NEEDED), set an rpath to them.
    :param elf_file: a data object representing an elf file and its attributes.
    :raises PatcherError: if the ELF file cannot be patched.
    """
    patchelf_args = []
    if elf_file.interp and elf_file.interp != self._dynamic_linker:
        patchelf_args.extend(["--set-interpreter", self._dynamic_linker])
        emit.progress(f"  Interpreter={self._dynamic_linker!r}")
    if elf_file.dependencies:
        current_rpath = self.get_current_rpath(elf_file)
        proposed_rpath = self.get_proposed_rpath(elf_file)
        emit.progress(f"  Current rpath={current_rpath}")
        emit.progress(f"  Proposed rpath={proposed_rpath}")
        # Removing the current rpath should not be necessary after patchelf 0.11,
        # see https://github.com/NixOS/patchelf/issues/94
        # Parameters:
        # --force-rpath: use RPATH instead of RUNPATH.
        # --shrink-rpath: will remove unneeded entries, with the side effect of
        #                 preferring host libraries so we simply do not use it.
        # --set-rpath: set the RPATH to the colon separated argument.
        # Don't need to patch the binary if all proposed paths are already in rpath
        if not set(proposed_rpath).issubset(set(current_rpath)):
            formatted_rpath = ":".join(proposed_rpath)
            patchelf_args.extend(["--force-rpath", "--set-rpath", formatted_rpath])
    # no patchelf_args means there is nothing to do.
    if not patchelf_args:
        return
    self._run_patchelf(patchelf_args=patchelf_args, elf_file_path=elf_file.path)