def METHOD_NAME(pkg, f, relf):
    if not pkg.rparent.options["debug"] or not pkg.rparent.build_dbg:
        return
    cfile = pkg.chroot_destdir / "usr/lib/debug" / relf
    try:
        pkg.rparent.do(
            pkg.rparent.get_tool("OBJCOPY"),
            f"--add-gnu-debuglink={cfile}",
            pkg.chroot_destdir / relf,
        )
    except Exception:
        pkg.error(f"failed to attach debug link to {relf}")