@@ -48,6 +48,7 @@ bool option_tactic_T2 = true;
4848bool option_tactic_T3 = true ;
4949bool option_tactic_backward_T3 = true ;
5050bool option_OCFR = false ;
51+ bool option_OCFR_hacks = false ;
5152unsigned option_Oepilogue = 0 ;
5253unsigned option_Oepilogue_size = 64 ;
5354bool option_Oorder = false ;
@@ -238,6 +239,11 @@ static void usage(FILE *stream, const char *progname)
238239 " \t\t bugs if the built-in CRF analysis is inaccurate.\n "
239240 " \t\t Default: false (disabled)\n "
240241 " \n "
242+ " \t -OCFR-hacks[=false]\n "
243+ " \t\t Makes -OCFR even more conservative. This may help some\n "
244+ " \t\t binaries that use non-standard relocations.\n "
245+ " \t\t Default: false (disabled)\n "
246+ " \n "
241247 " \t -Oepilogue=N\n "
242248 " \t\t Append a epilogue of up to N instructions to the end of each\n "
243249 " \t\t trampoline. This may enhance -Opeephole.\n "
@@ -401,6 +407,7 @@ enum Option
401407 OPTION_MEM_REBASE,
402408 OPTION_MEM_UB,
403409 OPTION_OCFR,
410+ OPTION_OCFR_HACKS,
404411 OPTION_OEPILOGUE,
405412 OPTION_OEPILOGUE_SIZE,
406413 OPTION_OORDER,
@@ -435,6 +442,7 @@ void parseOptions(char * const argv[], bool api)
435442 static const struct option long_options[] =
436443 {
437444 {" OCFR" , opt_arg, nullptr , OPTION_OCFR},
445+ {" OCFR-hacks" , opt_arg, nullptr , OPTION_OCFR_HACKS},
438446 {" Oepilogue" , req_arg, nullptr , OPTION_OEPILOGUE},
439447 {" Oepilogue-size" , req_arg, nullptr , OPTION_OEPILOGUE_SIZE},
440448 {" Oorder" , opt_arg, nullptr , OPTION_OORDER},
@@ -506,7 +514,10 @@ void parseOptions(char * const argv[], bool api)
506514 option_input = optarg;
507515 break ;
508516 case OPTION_OCFR:
509- option_OCFR = (unsigned )parseBoolOptArg (" -OCFR" , optarg);
517+ option_OCFR = parseBoolOptArg (" -OCFR" , optarg);
518+ break ;
519+ case OPTION_OCFR_HACKS:
520+ option_OCFR_hacks = parseBoolOptArg (" -OCFR-hacks" , optarg);
510521 break ;
511522 case OPTION_OEPILOGUE:
512523 option_Oepilogue =
0 commit comments