def METHOD_NAME(capsys, cmdargs, modl_inp_fn):
    """ Test case for ELF creation and stripping back to BIN files.
    """
    LOGGER.info("Testcase file: {:s}".format(modl_inp_fn))
    # Most files we are able to recreate with full accuracy
    expect_file_changes = 0
    # Special cases - ignoring differences for some specific files
    # Unused - no special cases required, as of now
    if (modl_inp_fn.endswith("XXX_m0100_part_sys.a9s")):
        LOGGER.warning("Expected non-identical binary due to XXX differences: {:s}".format(modl_inp_fn))
        expect_file_changes = 999999
    inp_path, inp_filename = os.path.split(modl_inp_fn)
    inp_path = pathlib.Path(inp_path)
    inp_basename, modl_fileext = os.path.splitext(inp_filename)
    if len(inp_path.parts) > 1:
        out_path = os.sep.join(["out"] + list(inp_path.parts[1:]))
    else:
        out_path = "out"
    elf_out_fn = os.sep.join([out_path, "{:s}.elf".format(inp_basename)]) # prefix for output files
    modl_out_fn = os.sep.join([out_path, "{:s}.rebin{:s}".format(inp_basename, modl_fileext)])
    # Extract the package
    command = [os.path.join(".", "amba_sys2elf.py"), "-vv", "-e", "-l", "0x6000000", "-p", modl_inp_fn, "-o", elf_out_fn]
    LOGGER.info(' '.join(command))
    with patch.object(sys, 'argv', command):
        amba_sys2elf_main()
    # Re-pack the package
    command = ["arm-none-eabi-objcopy", "-O", "binary", elf_out_fn, modl_out_fn]
    LOGGER.info(' '.join(command))
    subprocess.run(command)
    if expect_file_changes == 0:
        # Compare repackaged file and the original byte-to-byte, do not count differences
        match =  filecmp.cmp(modl_inp_fn, modl_out_fn, shallow=False)
        assert match, "Re-stripped file different: {:s}".format(modl_inp_fn)
    elif expect_file_changes == 999999:
        # Check only if repackaged file size roughly matches the original
        modl_inp_fsize = os.path.getsize(modl_inp_fn)
        modl_out_fsize = os.path.getsize(modl_out_fn)
        assert modl_out_fsize >= int(modl_inp_fsize * 0.95), "Re-stripped file too small: {:s}".format(modl_inp_fn)
        assert modl_out_fsize <= int(modl_inp_fsize * 1.05), "Re-stripped file too large: {:s}".format(modl_inp_fn)
    else:
        assert 0, "Not implemented"
    if cmdargs.rm_repacks:
        os.remove(modl_out_fn)
    pass