+ else if ( strcmp(argv[i], "-dependency_info") == 0 ) {
+ ++i;
+ // previously handled by buildSearchPaths()
+ }
+ else if ( strcmp(arg, "-export_dynamic") == 0 ) {
+ fExportDynamic = true;
+ }
+ else if ( strcmp(arg, "-force_symbols_coalesce_list") == 0 ) {
+ snapshotFileArgIndex = 1;
+ loadExportFile(argv[++i], "-force_symbols_coalesce_list", fForceCoalesceSymbols);
+ }
+ else if ( strcmp(arg, "-add_linker_option") == 0 ) {
+ // ex: -add_linker_option '-framework Foundation'
+ const char* optString = argv[++i];
+ if ( optString == NULL )
+ throw "-add_linker_option missing <option>";
+ // break up into list of tokens at whitespace
+ std::vector<const char*> opts;
+ char* buffer = strdup(optString);
+ char* start = buffer;
+ for (char* s = buffer; ; ++s) {
+ if ( isspace(*s) ) {
+ *s = '\0';
+ opts.push_back(start);
+ start = s+1;
+ }
+ else if ( *s == '\0' ) {
+ opts.push_back(start);
+ break;
+ }
+ }
+ fLinkerOptions.push_back(opts);
+ }
+ else if ( strcmp(arg, "-allow_simulator_linking_to_macosx_dylibs") == 0 ) {
+ fAllowSimulatorToLinkWithMacOSX = true;
+ }
+ else if ( strcmp(arg, "-keep_dwarf_unwind") == 0 ) {
+ fKeepDwarfUnwindForcedOn = true;
+ fKeepDwarfUnwindForcedOff = false;
+ }
+ else if ( strcmp(arg, "-no_keep_dwarf_unwind") == 0 ) {
+ fKeepDwarfUnwindForcedOn = false;
+ fKeepDwarfUnwindForcedOff = true;
+ }
+ else if ( strcmp(arg, "-verbose_optimization_hints") == 0 ) {
+ fVerboseOptimizationHints = true;
+ }
+ else if ( strcmp(arg, "-ignore_optimization_hints") == 0 ) {
+ fIgnoreOptimizationHints = true;
+ }
+ else if ( strcmp(arg, "-no_dtrace_dof") == 0 ) {
+ fGenerateDtraceDOF = false;
+ }
+ else if ( strcmp(arg, "-rename_section") == 0 ) {
+ if ( (argv[i+1]==NULL) || (argv[i+2]==NULL) || (argv[i+3]==NULL) || (argv[i+4]==NULL) )
+ throw "-rename_section missing <segment> <section> <segment> <section>";
+ addSectionRename(argv[i+1], argv[i+2], argv[i+3], argv[i+4]);
+ i += 4;
+ }
+ else if ( strcmp(arg, "-no_branch_islands") == 0 ) {
+ fAllowBranchIslands = false;
+ }
+ // put this last so that it does not interfer with other options starting with 'i'
+ else if ( strncmp(arg, "-i", 2) == 0 ) {
+ const char* colon = strchr(arg, ':');
+ if ( colon == NULL )
+ throwf("unknown option: %s", arg);
+ Options::AliasPair pair;
+ char* temp = new char[colon-arg];
+ strlcpy(temp, &arg[2], colon-arg-1);
+ pair.realName = &colon[1];
+ pair.alias = temp;
+ fAliases.push_back(pair);
+ }