]> git.saurik.com Git - apple/ld64.git/blob - src/ld/Options.h
d3e8d3fb7223f2b15bd165d576be75c37f878bf0
[apple/ld64.git] / src / ld / Options.h
1 /* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*-
2 *
3 * Copyright (c) 2005-2010 Apple Inc. All rights reserved.
4 *
5 * @APPLE_LICENSE_HEADER_START@
6 *
7 * This file contains Original Code and/or Modifications of Original Code
8 * as defined in and that are subject to the Apple Public Source License
9 * Version 2.0 (the 'License'). You may not use this file except in
10 * compliance with the License. Please obtain a copy of the License at
11 * http://www.opensource.apple.com/apsl/ and read it before using this
12 * file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
19 * Please see the License for the specific language governing rights and
20 * limitations under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24
25 #ifndef __OPTIONS__
26 #define __OPTIONS__
27
28
29 #include <stdint.h>
30 #include <mach/machine.h>
31
32 #include <vector>
33 #include <unordered_set>
34 #include <unordered_map>
35
36 #include "ld.hpp"
37 #include "Snapshot.h"
38
39 extern void throwf (const char* format, ...) __attribute__ ((noreturn,format(printf, 1, 2)));
40 extern void warning(const char* format, ...) __attribute__((format(printf, 1, 2)));
41
42 class Snapshot;
43
44 class LibraryOptions
45 {
46 public:
47 LibraryOptions() : fWeakImport(false), fReExport(false), fBundleLoader(false),
48 fLazyLoad(false), fUpward(false), fIndirectDylib(false),
49 fForceLoad(false) {}
50 // for dynamic libraries
51 bool fWeakImport;
52 bool fReExport;
53 bool fBundleLoader;
54 bool fLazyLoad;
55 bool fUpward;
56 bool fIndirectDylib;
57 // for static libraries
58 bool fForceLoad;
59 };
60
61
62
63 //
64 // The public interface to the Options class is the abstract representation of what work the linker
65 // should do.
66 //
67 // This abstraction layer will make it easier to support a future where the linker is a shared library
68 // invoked directly from Xcode. The target settings in Xcode would be used to directly construct an Options
69 // object (without building a command line which is then parsed).
70 //
71 //
72 class Options
73 {
74 public:
75 Options(int argc, const char* argv[]);
76 ~Options();
77
78 enum OutputKind { kDynamicExecutable, kStaticExecutable, kDynamicLibrary, kDynamicBundle, kObjectFile, kDyld, kPreload, kKextBundle };
79 enum NameSpace { kTwoLevelNameSpace, kFlatNameSpace, kForceFlatNameSpace };
80 // Standard treatment for many options.
81 enum Treatment { kError, kWarning, kSuppress, kNULL, kInvalid };
82 enum UndefinedTreatment { kUndefinedError, kUndefinedWarning, kUndefinedSuppress, kUndefinedDynamicLookup };
83 enum WeakReferenceMismatchTreatment { kWeakReferenceMismatchError, kWeakReferenceMismatchWeak,
84 kWeakReferenceMismatchNonWeak };
85 enum CommonsMode { kCommonsIgnoreDylibs, kCommonsOverriddenByDylibs, kCommonsConflictsDylibsError };
86 enum UUIDMode { kUUIDNone, kUUIDRandom, kUUIDContent };
87 enum LocalSymbolHandling { kLocalSymbolsAll, kLocalSymbolsNone, kLocalSymbolsSelectiveInclude, kLocalSymbolsSelectiveExclude };
88 enum DebugInfoStripping { kDebugInfoNone, kDebugInfoMinimal, kDebugInfoFull };
89
90 class FileInfo {
91 public:
92 const char* path;
93 uint64_t fileLen;
94 time_t modTime;
95 LibraryOptions options;
96 ld::File::Ordinal ordinal;
97 bool fromFileList;
98
99 // These are used by the threaded input file parsing engine.
100 mutable int inputFileSlot; // The input file "slot" assigned to this particular file
101 bool readyToParse;
102
103 // The use pattern for FileInfo is to create one on the stack in a leaf function and return
104 // it to the calling frame by copy. Therefore the copy constructor steals the path string from
105 // the source, which dies with the stack frame.
106 FileInfo(FileInfo const &other) : path(other.path), fileLen(other.fileLen), modTime(other.modTime), options(other.options), ordinal(other.ordinal), fromFileList(other.fromFileList), inputFileSlot(-1) { ((FileInfo&)other).path = NULL; };
107
108 // Create an empty FileInfo. The path can be set implicitly by checkFileExists().
109 FileInfo() : path(NULL), fileLen(0), modTime(0), options(), fromFileList(false) {};
110
111 // Create a FileInfo for a specific path, but does not stat the file.
112 FileInfo(const char *_path) : path(strdup(_path)), fileLen(0), modTime(0), options(), fromFileList(false) {};
113
114 ~FileInfo() { if (path) ::free((void*)path); }
115
116 // Stat the file and update fileLen and modTime.
117 // If the object already has a path the p must be NULL.
118 // If the object does not have a path then p can be any candidate path, and if the file exists the object permanently remembers the path.
119 // Returns true if the file exists, false if not.
120 bool checkFileExists(const Options& options, const char *p=NULL);
121
122 // Returns true if a previous call to checkFileExists() succeeded.
123 // Returns false if the file does not exist of checkFileExists() has never been called.
124 bool missing() const { return modTime==0; }
125 };
126
127 struct ExtraSection {
128 const char* segmentName;
129 const char* sectionName;
130 const char* path;
131 const uint8_t* data;
132 uint64_t dataLen;
133 typedef ExtraSection* iterator;
134 typedef const ExtraSection* const_iterator;
135 };
136
137 struct SectionAlignment {
138 const char* segmentName;
139 const char* sectionName;
140 uint8_t alignment;
141 };
142
143 struct OrderedSymbol {
144 const char* symbolName;
145 const char* objectFileName;
146 };
147 typedef const OrderedSymbol* OrderedSymbolsIterator;
148
149 struct SegmentStart {
150 const char* name;
151 uint64_t address;
152 };
153
154 struct SegmentSize {
155 const char* name;
156 uint64_t size;
157 };
158
159 struct SegmentProtect {
160 const char* name;
161 uint32_t max;
162 uint32_t init;
163 };
164
165 struct DylibOverride {
166 const char* installName;
167 const char* useInstead;
168 };
169
170 struct AliasPair {
171 const char* realName;
172 const char* alias;
173 };
174
175 enum { depLinkerVersion=0x00, depObjectFile=0x10, depDirectDylib=0x10, depIndirectDylib=0x10,
176 depUpwardDirectDylib=0x10, depUpwardIndirectDylib=0x10, depArchive=0x10,
177 depFileList=0x10, depSection=0x10, depBundleLoader=0x10, depMisc=0x10, depNotFound=0x11,
178 depOutputFile = 0x40 };
179
180 void dumpDependency(uint8_t, const char* path) const;
181
182 typedef const char* const* UndefinesIterator;
183
184 // const ObjectFile::ReaderOptions& readerOptions();
185 const char* outputFilePath() const { return fOutputFile; }
186 const std::vector<FileInfo>& getInputFiles() const { return fInputFiles; }
187
188 cpu_type_t architecture() const { return fArchitecture; }
189 bool preferSubArchitecture() const { return fHasPreferredSubType; }
190 cpu_subtype_t subArchitecture() const { return fSubArchitecture; }
191 bool allowSubArchitectureMismatches() const { return fAllowCpuSubtypeMismatches; }
192 bool forceCpuSubtypeAll() const { return fForceSubtypeAll; }
193 const char* architectureName() const { return fArchitectureName; }
194 void setArchitecture(cpu_type_t, cpu_subtype_t subtype);
195 bool archSupportsThumb2() const { return fArchSupportsThumb2; }
196 OutputKind outputKind() const { return fOutputKind; }
197 bool prebind() const { return fPrebind; }
198 bool bindAtLoad() const { return fBindAtLoad; }
199 NameSpace nameSpace() const { return fNameSpace; }
200 const char* installPath() const; // only for kDynamicLibrary
201 uint64_t currentVersion() const { return fDylibCurrentVersion; } // only for kDynamicLibrary
202 uint32_t currentVersion32() const; // only for kDynamicLibrary
203 uint32_t compatibilityVersion() const { return fDylibCompatVersion; } // only for kDynamicLibrary
204 const char* entryName() const { return fEntryName; } // only for kDynamicExecutable or kStaticExecutable
205 const char* executablePath();
206 uint64_t baseAddress() const { return fBaseAddress; }
207 uint64_t maxAddress() const { return fMaxAddress; }
208 bool keepPrivateExterns() const { return fKeepPrivateExterns; } // only for kObjectFile
209 bool needsModuleTable() const { return fNeedsModuleTable; } // only for kDynamicLibrary
210 bool interposable(const char* name) const;
211 bool hasExportRestrictList() const { return (fExportMode != kExportDefault); } // -exported_symbol or -unexported_symbol
212 bool hasExportMaskList() const { return (fExportMode == kExportSome); } // just -exported_symbol
213 bool hasWildCardExportRestrictList() const;
214 bool hasReExportList() const { return ! fReExportSymbols.empty(); }
215 bool wasRemovedExport(const char* sym) const { return ( fRemovedExports.find(sym) != fRemovedExports.end() ); }
216 bool allGlobalsAreDeadStripRoots() const;
217 bool shouldExport(const char*) const;
218 bool shouldReExport(const char*) const;
219 bool ignoreOtherArchInputFiles() const { return fIgnoreOtherArchFiles; }
220 bool traceDylibs() const { return fTraceDylibs; }
221 bool traceArchives() const { return fTraceArchives; }
222 bool deadCodeStrip() const { return fDeadStrip; }
223 UndefinedTreatment undefinedTreatment() const { return fUndefinedTreatment; }
224 ld::MacVersionMin macosxVersionMin() const { return fMacVersionMin; }
225 ld::IOSVersionMin iOSVersionMin() const { return fIOSVersionMin; }
226 bool minOS(ld::MacVersionMin mac, ld::IOSVersionMin iPhoneOS);
227 bool messagesPrefixedWithArchitecture();
228 Treatment picTreatment();
229 WeakReferenceMismatchTreatment weakReferenceMismatchTreatment() const { return fWeakReferenceMismatchTreatment; }
230 const char* umbrellaName() const { return fUmbrellaName; }
231 const std::vector<const char*>& allowableClients() const { return fAllowableClients; }
232 const char* clientName() const { return fClientName; }
233 const char* initFunctionName() const { return fInitFunctionName; } // only for kDynamicLibrary
234 const char* dotOutputFile();
235 uint64_t pageZeroSize() const { return fZeroPageSize; }
236 bool hasCustomStack() const { return (fStackSize != 0); }
237 uint64_t customStackSize() const { return fStackSize; }
238 uint64_t customStackAddr() const { return fStackAddr; }
239 bool hasExecutableStack() const { return fExecutableStack; }
240 bool hasNonExecutableHeap() const { return fNonExecutableHeap; }
241 UndefinesIterator initialUndefinesBegin() const { return &fInitialUndefines[0]; }
242 UndefinesIterator initialUndefinesEnd() const { return &fInitialUndefines[fInitialUndefines.size()]; }
243 bool printWhyLive(const char* name) const;
244 uint32_t minimumHeaderPad() const { return fMinimumHeaderPad; }
245 bool maxMminimumHeaderPad() const { return fMaxMinimumHeaderPad; }
246 ExtraSection::const_iterator extraSectionsBegin() const { return &fExtraSections[0]; }
247 ExtraSection::const_iterator extraSectionsEnd() const { return &fExtraSections[fExtraSections.size()]; }
248 CommonsMode commonsMode() const { return fCommonsMode; }
249 bool warnCommons() const { return fWarnCommons; }
250 bool keepRelocations();
251 FileInfo findFile(const char* path) const;
252 UUIDMode UUIDMode() const { return fUUIDMode; }
253 bool warnStabs();
254 bool pauseAtEnd() { return fPause; }
255 bool printStatistics() const { return fStatistics; }
256 bool printArchPrefix() const { return fMessagesPrefixedWithArchitecture; }
257 void gotoClassicLinker(int argc, const char* argv[]);
258 bool sharedRegionEligible() const { return fSharedRegionEligible; }
259 bool printOrderFileStatistics() const { return fPrintOrderFileStatistics; }
260 const char* dTraceScriptName() { return fDtraceScriptName; }
261 bool dTrace() { return (fDtraceScriptName != NULL); }
262 unsigned long orderedSymbolsCount() const { return fOrderedSymbols.size(); }
263 OrderedSymbolsIterator orderedSymbolsBegin() const { return &fOrderedSymbols[0]; }
264 OrderedSymbolsIterator orderedSymbolsEnd() const { return &fOrderedSymbols[fOrderedSymbols.size()]; }
265 bool splitSeg() const { return fSplitSegs; }
266 uint64_t baseWritableAddress() { return fBaseWritableAddress; }
267 uint64_t segmentAlignment() const { return fSegmentAlignment; }
268 uint64_t segPageSize(const char* segName) const;
269 uint64_t customSegmentAddress(const char* segName) const;
270 bool hasCustomSegmentAddress(const char* segName) const;
271 bool hasCustomSectionAlignment(const char* segName, const char* sectName) const;
272 uint8_t customSectionAlignment(const char* segName, const char* sectName) const;
273 uint32_t initialSegProtection(const char*) const;
274 uint32_t maxSegProtection(const char*) const;
275 bool saveTempFiles() const { return fSaveTempFiles; }
276 const std::vector<const char*>& rpaths() const { return fRPaths; }
277 bool readOnlyx86Stubs() { return fReadOnlyx86Stubs; }
278 const std::vector<DylibOverride>& dylibOverrides() const { return fDylibOverrides; }
279 const char* generatedMapPath() const { return fMapPath; }
280 bool positionIndependentExecutable() const { return fPositionIndependentExecutable; }
281 Options::FileInfo findFileUsingPaths(const char* path) const;
282 bool deadStripDylibs() const { return fDeadStripDylibs; }
283 bool allowedUndefined(const char* name) const { return ( fAllowedUndefined.find(name) != fAllowedUndefined.end() ); }
284 bool someAllowedUndefines() const { return (fAllowedUndefined.size() != 0); }
285 LocalSymbolHandling localSymbolHandling() { return fLocalSymbolHandling; }
286 bool keepLocalSymbol(const char* symbolName) const;
287 bool allowTextRelocs() const { return fAllowTextRelocs; }
288 bool warnAboutTextRelocs() const { return fWarnTextRelocs; }
289 bool kextsUseStubs() const { return fKextsUseStubs; }
290 bool usingLazyDylibLinking() const { return fUsingLazyDylibLinking; }
291 bool verbose() const { return fVerbose; }
292 bool makeEncryptable() const { return fEncryptable; }
293 bool needsUnwindInfoSection() const { return fAddCompactUnwindEncoding; }
294 const std::vector<const char*>& llvmOptions() const{ return fLLVMOptions; }
295 const std::vector<const char*>& dyldEnvironExtras() const{ return fDyldEnvironExtras; }
296 bool makeCompressedDyldInfo() const { return fMakeCompressedDyldInfo; }
297 bool hasExportedSymbolOrder();
298 bool exportedSymbolOrder(const char* sym, unsigned int* order) const;
299 bool orderData() { return fOrderData; }
300 bool errorOnOtherArchFiles() const { return fErrorOnOtherArchFiles; }
301 bool markAutoDeadStripDylib() const { return fMarkDeadStrippableDylib; }
302 bool removeEHLabels() const { return fNoEHLabels; }
303 bool useSimplifiedDylibReExports() const { return fUseSimplifiedDylibReExports; }
304 bool objCABIVersion2POverride() const { return fObjCABIVersion2Override; }
305 bool useUpwardDylibs() const { return fCanUseUpwardDylib; }
306 bool fullyLoadArchives() const { return fFullyLoadArchives; }
307 bool loadAllObjcObjectsFromArchives() const { return fLoadAllObjcObjectsFromArchives; }
308 bool autoOrderInitializers() const { return fAutoOrderInitializers; }
309 bool optimizeZeroFill() const { return fOptimizeZeroFill; }
310 bool mergeZeroFill() const { return fMergeZeroFill; }
311 bool logAllFiles() const { return fLogAllFiles; }
312 DebugInfoStripping debugInfoStripping() const { return fDebugInfoStripping; }
313 bool flatNamespace() const { return fFlatNamespace; }
314 bool linkingMainExecutable() const { return fLinkingMainExecutable; }
315 bool implicitlyLinkIndirectPublicDylibs() const { return fImplicitlyLinkPublicDylibs; }
316 bool whyLoad() const { return fWhyLoad; }
317 const char* traceOutputFile() const { return fTraceOutputFile; }
318 bool outputSlidable() const { return fOutputSlidable; }
319 bool haveCmdLineAliases() const { return (fAliases.size() != 0); }
320 const std::vector<AliasPair>& cmdLineAliases() const { return fAliases; }
321 bool makeTentativeDefinitionsReal() const { return fMakeTentativeDefinitionsReal; }
322 const char* dyldInstallPath() const { return fDyldInstallPath; }
323 bool warnWeakExports() const { return fWarnWeakExports; }
324 bool objcGcCompaction() const { return fObjcGcCompaction; }
325 bool objcGc() const { return fObjCGc; }
326 bool objcGcOnly() const { return fObjCGcOnly; }
327 bool canUseThreadLocalVariables() const { return fTLVSupport; }
328 bool addVersionLoadCommand() const { return fVersionLoadCommand; }
329 bool addFunctionStarts() const { return fFunctionStartsLoadCommand; }
330 bool addDataInCodeInfo() const { return fDataInCodeInfoLoadCommand; }
331 bool canReExportSymbols() const { return fCanReExportSymbols; }
332 const char* tempLtoObjectPath() const { return fTempLtoObjectPath; }
333 const char* overridePathlibLTO() const { return fOverridePathlibLTO; }
334 const char* mcpuLTO() const { return fLtoCpu; }
335 bool objcCategoryMerging() const { return fObjcCategoryMerging; }
336 bool pageAlignDataAtoms() const { return fPageAlignDataAtoms; }
337 bool keepDwarfUnwind() const { return fKeepDwarfUnwind; }
338 bool generateDtraceDOF() const { return fGenerateDtraceDOF; }
339 bool hasWeakBitTweaks() const;
340 bool forceWeak(const char* symbolName) const;
341 bool forceNotWeak(const char* symbolName) const;
342 bool forceWeakNonWildCard(const char* symbolName) const;
343 bool forceNotWeakNonWildcard(const char* symbolName) const;
344 bool forceCoalesce(const char* symbolName) const;
345 Snapshot& snapshot() const { return fLinkSnapshot; }
346 bool errorBecauseOfWarnings() const;
347 bool needsThreadLoadCommand() const { return fNeedsThreadLoadCommand; }
348 bool needsEntryPointLoadCommand() const { return fEntryPointLoadCommand; }
349 bool needsSourceVersionLoadCommand() const { return fSourceVersionLoadCommand; }
350 bool needsDependentDRInfo() const { return fDependentDRInfo; }
351 bool canUseAbsoluteSymbols() const { return fAbsoluteSymbols; }
352 bool allowSimulatorToLinkWithMacOSX() const { return fAllowSimulatorToLinkWithMacOSX; }
353 uint64_t sourceVersion() const { return fSourceVersion; }
354 uint32_t sdkVersion() const { return fSDKVersion; }
355 const char* demangleSymbol(const char* sym) const;
356 bool pipelineEnabled() const { return fPipelineFifo != NULL; }
357 const char* pipelineFifo() const { return fPipelineFifo; }
358 bool dumpDependencyInfo() const { return (fDependencyInfoPath != NULL); }
359 const char* dependencyInfoPath() const { return fDependencyInfoPath; }
360 bool targetIOSSimulator() const { return fTargetIOSSimulator; }
361 ld::relocatable::File::LinkerOptionsList&
362 linkerOptions() const { return fLinkerOptions; }
363 FileInfo findFramework(const char* frameworkName) const;
364 FileInfo findLibrary(const char* rootName, bool dylibsOnly=false) const;
365
366 private:
367 typedef std::unordered_map<const char*, unsigned int, ld::CStringHash, ld::CStringEquals> NameToOrder;
368 typedef std::unordered_set<const char*, ld::CStringHash, ld::CStringEquals> NameSet;
369 enum ExportMode { kExportDefault, kExportSome, kDontExportSome };
370 enum LibrarySearchMode { kSearchDylibAndArchiveInEachDir, kSearchAllDirsForDylibsThenAllDirsForArchives };
371 enum InterposeMode { kInterposeNone, kInterposeAllExternal, kInterposeSome };
372
373 class SetWithWildcards {
374 public:
375 void insert(const char*);
376 bool contains(const char*) const;
377 bool containsNonWildcard(const char*) const;
378 bool empty() const { return fRegular.empty() && fWildCard.empty(); }
379 bool hasWildCards() const { return !fWildCard.empty(); }
380 NameSet::iterator regularBegin() const { return fRegular.begin(); }
381 NameSet::iterator regularEnd() const { return fRegular.end(); }
382 void remove(const NameSet&);
383 private:
384 static bool hasWildCards(const char*);
385 bool wildCardMatch(const char* pattern, const char* candidate) const;
386 bool inCharRange(const char*& range, unsigned char c) const;
387
388 NameSet fRegular;
389 std::vector<const char*> fWildCard;
390 };
391
392
393 void parse(int argc, const char* argv[]);
394 void checkIllegalOptionCombinations();
395 void buildSearchPaths(int argc, const char* argv[]);
396 void parseArch(const char* architecture);
397 FileInfo findFramework(const char* rootName, const char* suffix) const;
398 bool checkForFile(const char* format, const char* dir, const char* rootName,
399 FileInfo& result) const;
400 uint64_t parseVersionNumber64(const char*);
401 uint32_t parseVersionNumber32(const char*);
402 void parseSectionOrderFile(const char* segment, const char* section, const char* path);
403 void parseOrderFile(const char* path, bool cstring);
404 void addSection(const char* segment, const char* section, const char* path);
405 void addSubLibrary(const char* name);
406 void loadFileList(const char* fileOfPaths, ld::File::Ordinal baseOrdinal);
407 uint64_t parseAddress(const char* addr);
408 void loadExportFile(const char* fileOfExports, const char* option, SetWithWildcards& set);
409 void parseAliasFile(const char* fileOfAliases);
410 void parsePreCommandLineEnvironmentSettings();
411 void parsePostCommandLineEnvironmentSettings();
412 void setUndefinedTreatment(const char* treatment);
413 void setMacOSXVersionMin(const char* version);
414 void setIOSVersionMin(const char* version);
415 void setWeakReferenceMismatchTreatment(const char* treatment);
416 void addDylibOverride(const char* paths);
417 void addSectionAlignment(const char* segment, const char* section, const char* alignment);
418 CommonsMode parseCommonsTreatment(const char* mode);
419 Treatment parseTreatment(const char* treatment);
420 void reconfigureDefaults();
421 void checkForClassic(int argc, const char* argv[]);
422 void parseSegAddrTable(const char* segAddrPath, const char* installPath);
423 void addLibrary(const FileInfo& info);
424 void warnObsolete(const char* arg);
425 uint32_t parseProtection(const char* prot);
426 void loadSymbolOrderFile(const char* fileOfExports, NameToOrder& orderMapping);
427
428
429
430 // ObjectFile::ReaderOptions fReaderOptions;
431 const char* fOutputFile;
432 std::vector<Options::FileInfo> fInputFiles;
433 cpu_type_t fArchitecture;
434 cpu_subtype_t fSubArchitecture;
435 const char* fArchitectureName;
436 OutputKind fOutputKind;
437 bool fHasPreferredSubType;
438 bool fArchSupportsThumb2;
439 bool fPrebind;
440 bool fBindAtLoad;
441 bool fKeepPrivateExterns;
442 bool fNeedsModuleTable;
443 bool fIgnoreOtherArchFiles;
444 bool fErrorOnOtherArchFiles;
445 bool fForceSubtypeAll;
446 InterposeMode fInterposeMode;
447 bool fDeadStrip;
448 NameSpace fNameSpace;
449 uint32_t fDylibCompatVersion;
450 uint64_t fDylibCurrentVersion;
451 const char* fDylibInstallName;
452 const char* fFinalName;
453 const char* fEntryName;
454 uint64_t fBaseAddress;
455 uint64_t fMaxAddress;
456 uint64_t fBaseWritableAddress;
457 bool fSplitSegs;
458 SetWithWildcards fExportSymbols;
459 SetWithWildcards fDontExportSymbols;
460 SetWithWildcards fInterposeList;
461 SetWithWildcards fForceWeakSymbols;
462 SetWithWildcards fForceNotWeakSymbols;
463 SetWithWildcards fReExportSymbols;
464 SetWithWildcards fForceCoalesceSymbols;
465 NameSet fRemovedExports;
466 NameToOrder fExportSymbolsOrder;
467 ExportMode fExportMode;
468 LibrarySearchMode fLibrarySearchMode;
469 UndefinedTreatment fUndefinedTreatment;
470 bool fMessagesPrefixedWithArchitecture;
471 WeakReferenceMismatchTreatment fWeakReferenceMismatchTreatment;
472 std::vector<const char*> fSubUmbellas;
473 std::vector<const char*> fSubLibraries;
474 std::vector<const char*> fAllowableClients;
475 std::vector<const char*> fRPaths;
476 const char* fClientName;
477 const char* fUmbrellaName;
478 const char* fInitFunctionName;
479 const char* fDotOutputFile;
480 const char* fExecutablePath;
481 const char* fBundleLoader;
482 const char* fDtraceScriptName;
483 const char* fSegAddrTablePath;
484 const char* fMapPath;
485 const char* fDyldInstallPath;
486 const char* fTempLtoObjectPath;
487 const char* fOverridePathlibLTO;
488 const char* fLtoCpu;
489 uint64_t fZeroPageSize;
490 uint64_t fStackSize;
491 uint64_t fStackAddr;
492 uint64_t fSourceVersion;
493 uint32_t fSDKVersion;
494 bool fExecutableStack;
495 bool fNonExecutableHeap;
496 bool fDisableNonExecutableHeap;
497 uint32_t fMinimumHeaderPad;
498 uint64_t fSegmentAlignment;
499 CommonsMode fCommonsMode;
500 enum UUIDMode fUUIDMode;
501 SetWithWildcards fLocalSymbolsIncluded;
502 SetWithWildcards fLocalSymbolsExcluded;
503 LocalSymbolHandling fLocalSymbolHandling;
504 bool fWarnCommons;
505 bool fVerbose;
506 bool fKeepRelocations;
507 bool fWarnStabs;
508 bool fTraceDylibSearching;
509 bool fPause;
510 bool fStatistics;
511 bool fPrintOptions;
512 bool fSharedRegionEligible;
513 bool fPrintOrderFileStatistics;
514 bool fReadOnlyx86Stubs;
515 bool fPositionIndependentExecutable;
516 bool fPIEOnCommandLine;
517 bool fDisablePositionIndependentExecutable;
518 bool fMaxMinimumHeaderPad;
519 bool fDeadStripDylibs;
520 bool fAllowTextRelocs;
521 bool fWarnTextRelocs;
522 bool fKextsUseStubs;
523 bool fUsingLazyDylibLinking;
524 bool fEncryptable;
525 bool fOrderData;
526 bool fMarkDeadStrippableDylib;
527 bool fMakeCompressedDyldInfo;
528 bool fMakeCompressedDyldInfoForceOff;
529 bool fNoEHLabels;
530 bool fAllowCpuSubtypeMismatches;
531 bool fUseSimplifiedDylibReExports;
532 bool fObjCABIVersion2Override;
533 bool fObjCABIVersion1Override;
534 bool fCanUseUpwardDylib;
535 bool fFullyLoadArchives;
536 bool fLoadAllObjcObjectsFromArchives;
537 bool fFlatNamespace;
538 bool fLinkingMainExecutable;
539 bool fForFinalLinkedImage;
540 bool fForStatic;
541 bool fForDyld;
542 bool fMakeTentativeDefinitionsReal;
543 bool fWhyLoad;
544 bool fRootSafe;
545 bool fSetuidSafe;
546 bool fImplicitlyLinkPublicDylibs;
547 bool fAddCompactUnwindEncoding;
548 bool fWarnCompactUnwind;
549 bool fRemoveDwarfUnwindIfCompactExists;
550 bool fAutoOrderInitializers;
551 bool fOptimizeZeroFill;
552 bool fMergeZeroFill;
553 bool fLogObjectFiles;
554 bool fLogAllFiles;
555 bool fTraceDylibs;
556 bool fTraceIndirectDylibs;
557 bool fTraceArchives;
558 bool fOutputSlidable;
559 bool fWarnWeakExports;
560 bool fObjcGcCompaction;
561 bool fObjCGc;
562 bool fObjCGcOnly;
563 bool fDemangle;
564 bool fTLVSupport;
565 bool fVersionLoadCommand;
566 bool fVersionLoadCommandForcedOn;
567 bool fVersionLoadCommandForcedOff;
568 bool fFunctionStartsLoadCommand;
569 bool fFunctionStartsForcedOn;
570 bool fFunctionStartsForcedOff;
571 bool fDataInCodeInfoLoadCommand;
572 bool fDataInCodeInfoLoadCommandForcedOn;
573 bool fDataInCodeInfoLoadCommandForcedOff;
574 bool fCanReExportSymbols;
575 bool fObjcCategoryMerging;
576 bool fPageAlignDataAtoms;
577 bool fNeedsThreadLoadCommand;
578 bool fEntryPointLoadCommand;
579 bool fEntryPointLoadCommandForceOn;
580 bool fEntryPointLoadCommandForceOff;
581 bool fSourceVersionLoadCommand;
582 bool fSourceVersionLoadCommandForceOn;
583 bool fSourceVersionLoadCommandForceOff;
584 bool fDependentDRInfo;
585 bool fDependentDRInfoForcedOn;
586 bool fDependentDRInfoForcedOff;
587 bool fTargetIOSSimulator;
588 bool fExportDynamic;
589 bool fAbsoluteSymbols;
590 bool fAllowSimulatorToLinkWithMacOSX;
591 bool fKeepDwarfUnwind;
592 bool fKeepDwarfUnwindForcedOn;
593 bool fKeepDwarfUnwindForcedOff;
594 bool fGenerateDtraceDOF;
595 DebugInfoStripping fDebugInfoStripping;
596 const char* fTraceOutputFile;
597 ld::MacVersionMin fMacVersionMin;
598 ld::IOSVersionMin fIOSVersionMin;
599 std::vector<AliasPair> fAliases;
600 std::vector<const char*> fInitialUndefines;
601 NameSet fAllowedUndefined;
602 NameSet fWhyLive;
603 std::vector<ExtraSection> fExtraSections;
604 std::vector<SectionAlignment> fSectionAlignments;
605 std::vector<OrderedSymbol> fOrderedSymbols;
606 std::vector<SegmentStart> fCustomSegmentAddresses;
607 std::vector<SegmentSize> fCustomSegmentSizes;
608 std::vector<SegmentProtect> fCustomSegmentProtections;
609 std::vector<DylibOverride> fDylibOverrides;
610 std::vector<const char*> fLLVMOptions;
611 std::vector<const char*> fLibrarySearchPaths;
612 std::vector<const char*> fFrameworkSearchPaths;
613 std::vector<const char*> fSDKPaths;
614 std::vector<const char*> fDyldEnvironExtras;
615 std::vector< std::vector<const char*> > fLinkerOptions;
616 bool fSaveTempFiles;
617 mutable Snapshot fLinkSnapshot;
618 bool fSnapshotRequested;
619 const char* fPipelineFifo;
620 const char* fDependencyInfoPath;
621 mutable int fDependencyFileDescriptor;
622 };
623
624
625
626 #endif // __OPTIONS__