25 "--validate-goto-model",
82 "--major-image-version",
84 "--major-subsystem-version",
85 "--minor-image-version",
87 "--minor-subsystem-version",
89 "--retain-symbols-file",
92 "--section-alignment",
94 "--spare-dynamic-tags",
103 "--unresolved-symbols",
104 "--version-exports-section",
111 "--macosx_version_min",
124 "--no-export-dynamic",
147 "--no-strip-discarded",
164 "--accept-unknown-input-arch",
165 "--no-accept-unknown-input-arch",
178 "--Bsymbolic-functions",
180 "--no-check-sections",
181 "--copy-dt-needed-entries",
182 "--no-copy-dt-needed-entries",
187 "--no-fatal-warnings",
188 "--force-exe-suffix",
191 "--print-gc-sections",
192 "--no-print-gc-sections",
194 "--no-define-common",
198 "--allow-shlib-undefined",
199 "--no-allow-shlib-undefined",
200 "--allow-multiple-definition",
201 "--no-undefined-version",
203 "--default-imported-symver",
204 "--no-warn-mismatch",
205 "--no-warn-search-mismatch",
206 "--no-whole-archive",
210 "--print-output-format",
212 "--reduce-memory-overheads",
225 "--traditional-format",
229 "--dynamic-list-data",
230 "--dynamic-list-cpp-new",
231 "--dynamic-list-cpp-typeinfo",
233 "--warn-constructors",
234 "--warn-multiple-gp",
236 "--warn-section-align",
237 "--warn-shared-textrel",
238 "--warn-alternate-em",
239 "--warn-unresolved-symbols",
240 "--error-unresolved-symbols",
244 "--enable-new-dtags",
260 for(
int i=1; i<argc; i++)
262 std::string argv_i=argv[i];
281 *o!=
nullptr && !found;
288 (os.size()>=3 && os[0]==
'-' && os[1]==
'-' &&
"-"+argv_i==os))
298 std::cerr <<
"Warning: missing argument for " << argv_i <<
'\n';
302 else if(os.size()>2 &&
has_prefix(argv_i, os+
"="))
305 set(os, argv[i]+os.size()+1);
323 (os.size()>=3 && os[0]==
'-' && os[1]==
'-' &&
"-"+argv_i==os))
341 (os.size()>=3 && os[0]==
'-' && os[1]==
'-' &&
"-"+argv_i==os))
352 std::cerr <<
"Warning: missing argument for " << argv_i <<
'\n';
356 else if(os.size()==2 &&
has_prefix(argv_i, os))
359 set(os, argv[i]+os.size());
361 else if(os.size()>2 &&
has_prefix(argv_i, os+
"="))
364 set(os, argv[i]+os.size()+1);
367 else if(os.size()>2 &&
has_prefix(
"-"+argv_i, os+
"="))
370 set(os, argv[i]+os.size()+1-1);
377 std::cerr <<
"Warning: uninterpreted ld option '" << argv_i
void set(const std::string &opt, const char *value) override
Set option option to value.
void add_infile_arg(const std::string &arg)
virtual bool parse(int argc, const char **argv, const char *optstring)
Parses a commandline according to a specification given in optstring.
void add_arg(const std::string &arg)
bool has_prefix(const std::string &s, const std::string &prefix)
const char * ld_options_with_argument[]
const char * ld_options_without_argument[]
const char * goto_ld_options_with_argument[]
A special command line object for the ld-like options.
#define PRECONDITION(CONDITION)