fn add_section(exe_path: &Path, sec_data_path: &Path) {
        let mut out_path = PathBuf::from(exe_path);
        out_path.set_extension("with_labels");
        Command::new("objcopy")
            .args(&[
                "--add-section",
                &format!("{}={}", ykpack::YKLABELS_SECTION, sec_data_path.to_str().unwrap()),
                "--set-section-flags",
                &format!("{}=contents,alloc,readonly", ykpack::YKLABELS_SECTION),
                exe_path.to_str().unwrap(),
                out_path.to_str().unwrap(),
            ])
            .output()
            .expect("failed to insert labels section");
        std::fs::rename(out_path, exe_path).unwrap();
    }
/// Copies the bytes in `sec_data_path` into a new Yorick label section of an executable.
Copies the bytes in `sec_data_path` into a new Yorick label section of an executable.
Copies the bytes in ` sec_data_path ` into a new Yorick label section of an executable .
fn add_section(exe_path: &Path, sec_data_path: &Path) {
        let mut out_path = PathBuf::from(exe_path);
        out_path.set_extension("with_labels");
        Command::new("objcopy")
            .args(&[
                "--add-section",
                &format!("{}={}", ykpack::YKLABELS_SECTION, sec_data_path.to_str().unwrap()),
                "--set-section-flags",
                &format!("{}=contents,alloc,readonly", ykpack::YKLABELS_SECTION),
                exe_path.to_str().unwrap(),
                out_path.to_str().unwrap(),
            ])
            .output()
            .expect("failed to insert labels section");
        std::fs::rename(out_path, exe_path).unwrap();
    }
fn add_section ( exe_path : & Path , sec_data_path : & Path ) { let mut out_path = PathBuf :: from ( exe_path ) ; out_path . set_extension ( " " ) ; Command :: new ( " " ) . args ( & [ " " , & format ! ( " " ykpack YKLABELS_SECTION sec_data_path to_str ( ) unwrap ( ) ) , " " , & format ! ( " " ykpack YKLABELS_SECTION ) , exe_path . to_str ( ) . unwrap ( ) , out_path . to_str ( ) . unwrap ( ) , ] ) . output ( ) . expect ( " " ) ; std :: fs :: rename ( out_path , exe_path ) . unwrap ( ) ; }
Copies the bytes in `sec_data_path` into a new Yorick label section of an executable.
Copies the bytes in ` sec_data_path ` into a new Yorick label section of an executable .
exe_path
&Path
sec_data_path
&Path