File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -591,14 +591,20 @@ let macho_header_32
591
591
(flags :file_flag list )
592
592
(loadcmds :frag array ) : frag =
593
593
let load_commands_fixup = new_fixup " load commands" in
594
+ let count_non_mark so_far elem =
595
+ match elem with
596
+ MARK -> so_far
597
+ | _ -> so_far + 1
598
+ in
594
599
let cmds = DEF (load_commands_fixup, SEQ loadcmds) in
595
600
SEQ
596
601
[|
597
602
WORD (TY_u32 , IMM mh_magic);
598
603
WORD (TY_u32 , IMM (cpu_type_code cpu));
599
604
WORD (TY_u32 , IMM (cpu_subtype_code sub));
600
605
WORD (TY_u32 , IMM (file_type_code ftype));
601
- WORD (TY_u32 , IMM (Int64. of_int (Array. length loadcmds)));
606
+ WORD (TY_u32 ,
607
+ IMM (Int64. of_int (Array. fold_left count_non_mark 0 loadcmds)));
602
608
WORD (TY_u32 , F_SZ load_commands_fixup);
603
609
WORD (TY_u32 , IMM (fold_flags file_flag_code flags));
604
610
cmds
You can’t perform that action at this time.
0 commit comments