Lines Matching defs:args

75 static void setConfigs(opt::InputArgList &args);
76 static void readConfigs(opt::InputArgList &args);
78 bool link(ArrayRef<const char *> args, bool canExitEarly, raw_ostream &stdoutOS,
83 errorHandler().logName = args::getFilenameWithoutExe(args[0]);
109 config->progName = args[0];
111 driver->main(args);
360 static const char *getReproduceOption(opt::InputArgList &args) {
361 if (auto *arg = args.getLastArg(OPT_reproduce))
366 static bool hasZOption(opt::InputArgList &args, StringRef key) {
367 for (auto *arg : args.filtered(OPT_z))
373 static bool getZFlag(opt::InputArgList &args, StringRef k1, StringRef k2,
375 for (auto *arg : args.filtered_reverse(OPT_z)) {
384 static SeparateSegmentKind getZSeparate(opt::InputArgList &args) {
385 for (auto *arg : args.filtered_reverse(OPT_z)) {
397 static GnuStackKind getZGnuStack(opt::InputArgList &args) {
398 for (auto *arg : args.filtered_reverse(OPT_z)) {
429 static void checkZOptions(opt::InputArgList &args) {
430 for (auto *arg : args.filtered(OPT_z))
437 opt::InputArgList args = parser.parse(argsArr.slice(1));
440 errorHandler().errorLimit = args::getInteger(args, OPT_error_limit, 20);
441 checkZOptions(args);
444 if (args.hasArg(OPT_help)) {
464 if (args.hasArg(OPT_v) || args.hasArg(OPT_version))
467 if (const char *path = getReproduceOption(args)) {
474 tar->append("response.txt", createResponseFile(args));
481 readConfigs(args);
485 if (args.hasArg(OPT_v) && !args.hasArg(OPT_INPUT))
487 if (args.hasArg(OPT_version))
491 createFiles(args);
496 setConfigs(args);
508 link<ELF32LE>(args);
511 link<ELF32BE>(args);
514 link<ELF64LE>(args);
517 link<ELF64BE>(args);
524 static std::string getRpath(opt::InputArgList &args) {
525 std::vector<StringRef> v = args::getStrings(args, OPT_rpath);
531 static UnresolvedPolicy getUnresolvedSymbolPolicy(opt::InputArgList &args) {
532 UnresolvedPolicy errorOrWarn = args.hasFlag(OPT_error_unresolved_symbols,
538 for (auto *arg : llvm::reverse(args)) {
567 static Target2Policy getTarget2(opt::InputArgList &args) {
568 StringRef s = args.getLastArgValue(OPT_target2, "got-rel");
579 static bool isOutputFormatBinary(opt::InputArgList &args) {
580 StringRef s = args.getLastArgValue(OPT_oformat, "elf");
588 static DiscardPolicy getDiscard(opt::InputArgList &args) {
589 if (args.hasArg(OPT_relocatable))
593 args.getLastArg(OPT_discard_all, OPT_discard_locals, OPT_discard_none);
603 static StringRef getDynamicLinker(opt::InputArgList &args) {
604 auto *arg = args.getLastArg(OPT_dynamic_linker, OPT_no_dynamic_linker);
615 static ICFLevel getICF(opt::InputArgList &args) {
616 auto *arg = args.getLastArg(OPT_icf_none, OPT_icf_safe, OPT_icf_all);
624 static StripPolicy getStrip(opt::InputArgList &args) {
625 if (args.hasArg(OPT_relocatable))
628 auto *arg = args.getLastArg(OPT_strip_all, OPT_strip_debug);
636 static uint64_t parseSectionAddress(StringRef s, opt::InputArgList &args,
642 error("invalid argument: " + arg.getAsString(args));
646 static StringMap<uint64_t> getSectionStartMap(opt::InputArgList &args) {
648 for (auto *arg : args.filtered(OPT_section_start)) {
652 ret[name] = parseSectionAddress(addr, args, *arg);
655 if (auto *arg = args.getLastArg(OPT_Ttext))
656 ret[".text"] = parseSectionAddress(arg->getValue(), args, *arg);
657 if (auto *arg = args.getLastArg(OPT_Tdata))
658 ret[".data"] = parseSectionAddress(arg->getValue(), args, *arg);
659 if (auto *arg = args.getLastArg(OPT_Tbss))
660 ret[".bss"] = parseSectionAddress(arg->getValue(), args, *arg);
664 static SortSectionPolicy getSortSection(opt::InputArgList &args) {
665 StringRef s = args.getLastArgValue(OPT_sort_section);
675 static OrphanHandlingPolicy getOrphanHandling(opt::InputArgList &args) {
676 StringRef s = args.getLastArgValue(OPT_orphan_handling, "place");
690 getBuildId(opt::InputArgList &args) {
691 auto *arg = args.getLastArg(OPT_build_id, OPT_build_id_eq);
715 static std::pair<bool, bool> getPackDynRelocs(opt::InputArgList &args) {
716 StringRef s = args.getLastArgValue(OPT_pack_dyn_relocs, "none");
750 for (StringRef line : args::getLines(mb)) {
784 static bool getCompressDebugSections(opt::InputArgList &args) {
785 StringRef s = args.getLastArgValue(OPT_compress_debug_sections, "none");
801 static std::pair<StringRef, StringRef> getOldNewOptions(opt::InputArgList &args,
803 auto *arg = args.getLastArg(id);
817 for (StringRef s : args::getLines(mb))
836 static void readConfigs(opt::InputArgList &args) {
837 errorHandler().verbose = args.hasArg(OPT_verbose);
839 args.hasFlag(OPT_fatal_warnings, OPT_no_fatal_warnings, false);
841 args.hasArg(OPT_visual_studio_diagnostics_format, false);
842 threadsEnabled = args.hasFlag(OPT_threads, OPT_no_threads, true);
845 args.hasFlag(OPT_allow_multiple_definition,
847 hasZOption(args, "muldefs");
849 args.hasFlag(OPT_allow_shlib_undefined, OPT_no_allow_shlib_undefined,
850 args.hasArg(OPT_shared));
851 config->auxiliaryList = args::getStrings(args, OPT_auxiliary);
852 config->bsymbolic = args.hasArg(OPT_Bsymbolic);
853 config->bsymbolicFunctions = args.hasArg(OPT_Bsymbolic_functions);
855 args.hasFlag(OPT_check_sections, OPT_no_check_sections, true);
856 config->chroot = args.getLastArgValue(OPT_chroot);
857 config->compressDebugSections = getCompressDebugSections(args);
858 config->cref = args.hasFlag(OPT_cref, OPT_no_cref, false);
859 config->defineCommon = args.hasFlag(OPT_define_common, OPT_no_define_common,
860 !args.hasArg(OPT_relocatable));
861 config->demangle = args.hasFlag(OPT_demangle, OPT_no_demangle, true);
862 config->dependentLibraries = args.hasFlag(OPT_dependent_libraries, OPT_no_dependent_libraries, true);
863 config->disableVerify = args.hasArg(OPT_disable_verify);
864 config->discard = getDiscard(args);
865 config->dwoDir = args.getLastArgValue(OPT_plugin_opt_dwo_dir_eq);
866 config->dynamicLinker = getDynamicLinker(args);
868 args.hasFlag(OPT_eh_frame_hdr, OPT_no_eh_frame_hdr, false);
869 config->emitLLVM = args.hasArg(OPT_plugin_opt_emit_llvm, false);
870 config->emitRelocs = args.hasArg(OPT_emit_relocs);
871 config->callGraphProfileSort = args.hasFlag(
874 args.hasFlag(OPT_enable_new_dtags, OPT_disable_new_dtags, true);
875 config->entry = args.getLastArgValue(OPT_entry);
877 args.hasFlag(OPT_execute_only, OPT_no_execute_only, false);
879 args.hasFlag(OPT_export_dynamic, OPT_no_export_dynamic, false);
880 config->filterList = args::getStrings(args, OPT_filter);
881 config->fini = args.getLastArgValue(OPT_fini, "_fini");
882 config->fixCortexA53Errata843419 = args.hasArg(OPT_fix_cortex_a53_843419);
883 config->fixCortexA8 = args.hasArg(OPT_fix_cortex_a8);
884 config->forceBTI = hasZOption(args, "force-bti");
885 config->gcSections = args.hasFlag(OPT_gc_sections, OPT_no_gc_sections, false);
886 config->gnuUnique = args.hasFlag(OPT_gnu_unique, OPT_no_gnu_unique, true);
887 config->gdbIndex = args.hasFlag(OPT_gdb_index, OPT_no_gdb_index, false);
888 config->icf = getICF(args);
890 args.hasArg(OPT_ignore_data_address_equality);
892 args.hasArg(OPT_ignore_function_address_equality);
893 config->init = args.getLastArgValue(OPT_init, "_init");
894 config->ltoAAPipeline = args.getLastArgValue(OPT_lto_aa_pipeline);
895 config->ltoCSProfileGenerate = args.hasArg(OPT_lto_cs_profile_generate);
896 config->ltoCSProfileFile = args.getLastArgValue(OPT_lto_cs_profile_file);
897 config->ltoDebugPassManager = args.hasArg(OPT_lto_debug_pass_manager);
898 config->ltoNewPassManager = args.hasArg(OPT_lto_new_pass_manager);
899 config->ltoNewPmPasses = args.getLastArgValue(OPT_lto_newpm_passes);
900 config->ltoo = args::getInteger(args, OPT_lto_O, 2);
901 config->ltoObjPath = args.getLastArgValue(OPT_lto_obj_path_eq);
902 config->ltoPartitions = args::getInteger(args, OPT_lto_partitions, 1);
903 config->ltoSampleProfile = args.getLastArgValue(OPT_lto_sample_profile);
904 config->mapFile = args.getLastArgValue(OPT_Map);
905 config->mipsGotSize = args::getInteger(args, OPT_mips_got_size, 0xfff0);
907 args.hasFlag(OPT_merge_exidx_entries, OPT_no_merge_exidx_entries, true);
909 args.hasFlag(OPT_mmap_output_file, OPT_no_mmap_output_file, true);
910 config->nmagic = args.hasFlag(OPT_nmagic, OPT_no_nmagic, false);
911 config->noinhibitExec = args.hasArg(OPT_noinhibit_exec);
912 config->nostdlib = args.hasArg(OPT_nostdlib);
913 config->oFormatBinary = isOutputFormatBinary(args);
914 config->omagic = args.hasFlag(OPT_omagic, OPT_no_omagic, false);
915 config->optRemarksFilename = args.getLastArgValue(OPT_opt_remarks_filename);
916 config->optRemarksPasses = args.getLastArgValue(OPT_opt_remarks_passes);
917 config->optRemarksWithHotness = args.hasArg(OPT_opt_remarks_with_hotness);
918 config->optRemarksFormat = args.getLastArgValue(OPT_opt_remarks_format);
919 config->optimize = args::getInteger(args, OPT_O, 1);
920 config->orphanHandling = getOrphanHandling(args);
921 config->outputFile = args.getLastArgValue(OPT_o);
922 config->pacPlt = hasZOption(args, "pac-plt");
923 config->pie = args.hasFlag(OPT_pie, OPT_no_pie, false);
925 args.hasFlag(OPT_print_icf_sections, OPT_no_print_icf_sections, false);
927 args.hasFlag(OPT_print_gc_sections, OPT_no_print_gc_sections, false);
929 args.getLastArgValue(OPT_print_symbol_order);
930 config->rpath = getRpath(args);
931 config->relocatable = args.hasArg(OPT_relocatable);
932 config->saveTemps = args.hasArg(OPT_save_temps);
933 config->searchPaths = args::getStrings(args, OPT_library_path);
934 config->sectionStartMap = getSectionStartMap(args);
935 config->shared = args.hasArg(OPT_shared);
936 config->singleRoRx = args.hasArg(OPT_no_rosegment);
937 config->soName = args.getLastArgValue(OPT_soname);
938 config->sortSection = getSortSection(args);
939 config->splitStackAdjustSize = args::getInteger(args, OPT_split_stack_adjust_size, 16384);
940 config->strip = getStrip(args);
941 config->sysroot = args.getLastArgValue(OPT_sysroot);
942 config->target1Rel = args.hasFlag(OPT_target1_rel, OPT_target1_abs, false);
943 config->target2 = getTarget2(args);
944 config->thinLTOCacheDir = args.getLastArgValue(OPT_thinlto_cache_dir);
946 parseCachePruningPolicy(args.getLastArgValue(OPT_thinlto_cache_policy)),
948 config->thinLTOEmitImportsFiles = args.hasArg(OPT_thinlto_emit_imports_files);
949 config->thinLTOIndexOnly = args.hasArg(OPT_thinlto_index_only) ||
950 args.hasArg(OPT_thinlto_index_only_eq);
951 config->thinLTOIndexOnlyArg = args.getLastArgValue(OPT_thinlto_index_only_eq);
952 config->thinLTOJobs = args::getInteger(args, OPT_thinlto_jobs, -1u);
954 getOldNewOptions(args, OPT_thinlto_object_suffix_replace_eq);
956 getOldNewOptions(args, OPT_thinlto_prefix_replace_eq);
957 config->trace = args.hasArg(OPT_trace);
958 config->undefined = args::getStrings(args, OPT_undefined);
960 args.hasFlag(OPT_undefined_version, OPT_no_undefined_version, true);
961 config->useAndroidRelrTags = args.hasFlag(
963 config->unresolvedSymbols = getUnresolvedSymbolPolicy(args);
965 args.hasFlag(OPT_warn_backrefs, OPT_no_warn_backrefs, false);
966 config->warnCommon = args.hasFlag(OPT_warn_common, OPT_no_warn_common, false);
968 args.hasFlag(OPT_warn_ifunc_textrel, OPT_no_warn_ifunc_textrel, false);
970 args.hasFlag(OPT_warn_symbol_ordering, OPT_no_warn_symbol_ordering, true);
971 config->zCombreloc = getZFlag(args, "combreloc", "nocombreloc", true);
972 config->zCopyreloc = getZFlag(args, "copyreloc", "nocopyreloc", true);
973 config->zForceIbt = hasZOption(args, "force-ibt");
974 config->zGlobal = hasZOption(args, "global");
975 config->zGnustack = getZGnuStack(args);
976 config->zHazardplt = hasZOption(args, "hazardplt");
977 config->zIfuncNoplt = hasZOption(args, "ifunc-noplt");
978 config->zInitfirst = hasZOption(args, "initfirst");
979 config->zInterpose = hasZOption(args, "interpose");
981 args, "keep-text-section-prefix", "nokeep-text-section-prefix", false);
982 config->zNodefaultlib = hasZOption(args, "nodefaultlib");
983 config->zNodelete = hasZOption(args, "nodelete");
984 config->zNodlopen = hasZOption(args, "nodlopen");
985 config->zNow = getZFlag(args, "now", "lazy", false);
986 config->zOrigin = hasZOption(args, "origin");
987 config->zRelro = getZFlag(args, "relro", "norelro", true);
988 config->zRetpolineplt = hasZOption(args, "retpolineplt");
989 config->zRodynamic = hasZOption(args, "rodynamic");
990 config->zSeparate = getZSeparate(args);
991 config->zShstk = hasZOption(args, "shstk");
992 config->zStackSize = args::getZOptionValue(args, OPT_z, "stack-size", 0);
993 config->zText = getZFlag(args, "text", "notext", true);
994 config->zWxneeded = hasZOption(args, "wxneeded");
997 if (auto *arg = args.getLastArg(OPT_plugin_opt_mcpu_eq))
1001 for (auto *arg : args.filtered(OPT_plugin_opt))
1005 for (auto *arg : args.filtered(OPT_mllvm))
1022 if (args.hasArg(OPT_Ttext_segment))
1027 if (auto *arg = args.getLastArg(OPT_m)) {
1037 if (auto *arg = args.getLastArg(OPT_hash_style)) {
1049 if (args.hasArg(OPT_print_map))
1058 std::tie(config->buildId, config->buildIdVector) = getBuildId(args);
1061 getPackDynRelocs(args);
1063 if (auto *arg = args.getLastArg(OPT_symbol_ordering_file)){
1064 if (args.hasArg(OPT_call_graph_ordering_file))
1082 if (auto *arg = args.getLastArg(OPT_retain_symbols_file)) {
1086 for (StringRef s : args::getLines(*buffer))
1095 for (auto *arg : args.filtered(OPT_dynamic_list))
1099 for (auto *arg : args.filtered(OPT_export_dynamic_symbol))
1108 for (auto *arg : args.filtered(OPT_export_dynamic_symbol))
1111 for (auto *arg : args.filtered(OPT_version_script))
1124 static void setConfigs(opt::InputArgList &args) {
1134 config->picThunk = args.hasArg(OPT_pic_veneer, config->isPic);
1159 config->writeAddends = args.hasFlag(OPT_apply_dynamic_relocs,
1164 args.hasFlag(OPT_toc_optimize, OPT_no_toc_optimize, m == EM_PPC64);
1178 void LinkerDriver::createFiles(opt::InputArgList &args) {
1183 for (auto *arg : args) {
1301 static uint64_t getMaxPageSize(opt::InputArgList &args) {
1302 uint64_t val = args::getZOptionValue(args, OPT_z, "max-page-size",
1316 static uint64_t getCommonPageSize(opt::InputArgList &args) {
1317 uint64_t val = args::getZOptionValue(args, OPT_z, "common-page-size",
1333 static Optional<uint64_t> getImageBase(opt::InputArgList &args) {
1336 auto *arg = args.getLastArg(OPT_image_base);
1353 static DenseSet<StringRef> getExcludeLibs(opt::InputArgList &args) {
1355 for (auto *arg : args.filtered(OPT_exclude_libs)) {
1375 static void excludeLibs(opt::InputArgList &args) {
1376 DenseSet<StringRef> libs = getExcludeLibs(args);
1492 static void findKeepUniqueSections(opt::InputArgList &args) {
1493 for (auto *arg : args.filtered(OPT_keep_unique)) {
1636 static std::vector<WrappedSymbol> addWrappedSymbols(opt::InputArgList &args) {
1640 for (auto *arg : args.filtered(OPT_wrap)) {
1731 template <class ELFT> void LinkerDriver::link(opt::InputArgList &args) {
1734 if (!args.hasArg(OPT_hash_style)) {
1764 for (auto *arg : args.filtered(OPT_trace_symbol))
1798 for (StringRef pat : args::getStrings(args, OPT_undefined_glob))
1842 if (args.hasArg(OPT_exclude_libs))
1843 excludeLibs(args);
1851 std::vector<WrappedSymbol> wrapped = addWrappedSymbols(args);
1940 config->maxPageSize = getMaxPageSize(args);
1946 config->commonPageSize = getCommonPageSize(args);
1948 config->imageBase = getImageBase(args);
2008 findKeepUniqueSections<ELFT>(args);
2014 if (auto *arg = args.getLastArg(OPT_call_graph_ordering_file))