def METHOD_NAME(obj_files, prefix, sysroot):
    res = {}
    for f in obj_files:
        path = join(prefix, f)
        # ldd quite often fails on foreign architectures.
        ldd_failed = False
        # Detect the filetype to emulate what the system-native tool does.
        klass = codefile_class(path)
        if klass == machofile:
            resolve_filenames = False
            recurse = False
        else:
            resolve_filenames = True
            recurse = True
        try:
            if sys.platform.startswith("linux"):
                res[f] = ldd(path)
            elif sys.platform.startswith("darwin"):
                links = otool(path)
                res[f] = [(basename(line["name"]), line["name"]) for line in links]
        except:
            ldd_failed = True
        finally:
            res_py = inspect_linkages(
                path,
                resolve_filenames=resolve_filenames,
                sysroot=sysroot,
                recurse=recurse,
            )
            res_py = [(basename(lp), lp) for lp in res_py]
            if ldd_failed:
                res[f] = res_py
            else:
                if set(res[f]) != set(res_py):
                    print(
                        "WARNING: pyldd disagrees with ldd/otool. This will not cause any"
                    )
                    print("WARNING: problems for this build, but please file a bug at:")
                    print("WARNING: https://github.com/conda/conda-build")
                    print(f"WARNING: and (if possible) attach file {path}")
                    print(
                        "WARNING: \nldd/otool gives:\n{}\npyldd gives:\n{}\n".format(
                            "\n".join(str(e) for e in res[f]),
                            "\n".join(str(e) for e in res_py),
                        )
                    )
                    print(f"Diffs\n{set(res[f]) - set(res_py)}")
                    print(f"Diffs\n{set(res_py) - set(res[f])}")
    return res