]>
Commit | Line | Data |
---|---|---|
d696c285 | 1 | /* -*- mode: C++; c-basic-offset: 4; tab-width: 4 -*- |
6e880c60 | 2 | * |
a645023d | 3 | * Copyright (c) 2005-2010 Apple Inc. All rights reserved. |
c2646906 A |
4 | * |
5 | * @APPLE_LICENSE_HEADER_START@ | |
d696c285 | 6 | * |
c2646906 A |
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. | |
d696c285 | 13 | * |
c2646906 A |
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. | |
d696c285 | 21 | * |
c2646906 A |
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 | ||
c2646906 A |
32 | #include <vector> |
33 | #include <ext/hash_set> | |
55e3d2f6 | 34 | #include <ext/hash_map> |
c2646906 | 35 | |
a645023d | 36 | #include "ld.hpp" |
c2646906 | 37 | |
fb24a050 A |
38 | extern void throwf (const char* format, ...) __attribute__ ((noreturn,format(printf, 1, 2))); |
39 | extern void warning(const char* format, ...) __attribute__((format(printf, 1, 2))); | |
c2646906 | 40 | |
55e3d2f6 | 41 | class LibraryOptions |
c2646906 A |
42 | { |
43 | public: | |
a645023d A |
44 | LibraryOptions() : fWeakImport(false), fReExport(false), fBundleLoader(false), |
45 | fLazyLoad(false), fUpward(false), fForceLoad(false) {} | |
55e3d2f6 | 46 | // for dynamic libraries |
c2646906 A |
47 | bool fWeakImport; |
48 | bool fReExport; | |
69a49097 | 49 | bool fBundleLoader; |
2f2f92e4 | 50 | bool fLazyLoad; |
a645023d | 51 | bool fUpward; |
55e3d2f6 A |
52 | // for static libraries |
53 | bool fForceLoad; | |
c2646906 A |
54 | }; |
55 | ||
55e3d2f6 A |
56 | |
57 | ||
d696c285 A |
58 | // |
59 | // The public interface to the Options class is the abstract representation of what work the linker | |
60 | // should do. | |
61 | // | |
62 | // This abstraction layer will make it easier to support a future where the linker is a shared library | |
63 | // invoked directly from Xcode. The target settings in Xcode would be used to directly construct an Options | |
64 | // object (without building a command line which is then parsed). | |
65 | // | |
66 | // | |
c2646906 A |
67 | class Options |
68 | { | |
69 | public: | |
d696c285 A |
70 | Options(int argc, const char* argv[]); |
71 | ~Options(); | |
c2646906 | 72 | |
55e3d2f6 | 73 | enum OutputKind { kDynamicExecutable, kStaticExecutable, kDynamicLibrary, kDynamicBundle, kObjectFile, kDyld, kPreload, kKextBundle }; |
c2646906 | 74 | enum NameSpace { kTwoLevelNameSpace, kFlatNameSpace, kForceFlatNameSpace }; |
d696c285 A |
75 | // Standard treatment for many options. |
76 | enum Treatment { kError, kWarning, kSuppress, kNULL, kInvalid }; | |
c2646906 | 77 | enum UndefinedTreatment { kUndefinedError, kUndefinedWarning, kUndefinedSuppress, kUndefinedDynamicLookup }; |
d696c285 A |
78 | enum WeakReferenceMismatchTreatment { kWeakReferenceMismatchError, kWeakReferenceMismatchWeak, |
79 | kWeakReferenceMismatchNonWeak }; | |
c2646906 | 80 | enum CommonsMode { kCommonsIgnoreDylibs, kCommonsOverriddenByDylibs, kCommonsConflictsDylibsError }; |
a61fdf0a A |
81 | enum UUIDMode { kUUIDNone, kUUIDRandom, kUUIDContent }; |
82 | enum LocalSymbolHandling { kLocalSymbolsAll, kLocalSymbolsNone, kLocalSymbolsSelectiveInclude, kLocalSymbolsSelectiveExclude }; | |
a645023d | 83 | enum DebugInfoStripping { kDebugInfoNone, kDebugInfoMinimal, kDebugInfoFull }; |
c2646906 A |
84 | |
85 | struct FileInfo { | |
86 | const char* path; | |
87 | uint64_t fileLen; | |
d696c285 | 88 | time_t modTime; |
55e3d2f6 | 89 | LibraryOptions options; |
c2646906 | 90 | }; |
d696c285 | 91 | |
c2646906 A |
92 | struct ExtraSection { |
93 | const char* segmentName; | |
94 | const char* sectionName; | |
95 | const char* path; | |
96 | const uint8_t* data; | |
97 | uint64_t dataLen; | |
a645023d A |
98 | typedef ExtraSection* iterator; |
99 | typedef const ExtraSection* const_iterator; | |
c2646906 | 100 | }; |
d696c285 | 101 | |
c2646906 A |
102 | struct SectionAlignment { |
103 | const char* segmentName; | |
104 | const char* sectionName; | |
105 | uint8_t alignment; | |
106 | }; | |
107 | ||
a61fdf0a A |
108 | struct OrderedSymbol { |
109 | const char* symbolName; | |
110 | const char* objectFileName; | |
111 | }; | |
a645023d | 112 | typedef const OrderedSymbol* OrderedSymbolsIterator; |
a61fdf0a A |
113 | |
114 | struct SegmentStart { | |
115 | const char* name; | |
116 | uint64_t address; | |
117 | }; | |
118 | ||
55e3d2f6 A |
119 | struct SegmentSize { |
120 | const char* name; | |
121 | uint64_t size; | |
122 | }; | |
123 | ||
a61fdf0a A |
124 | struct SegmentProtect { |
125 | const char* name; | |
126 | uint32_t max; | |
127 | uint32_t init; | |
128 | }; | |
129 | ||
130 | struct DylibOverride { | |
131 | const char* installName; | |
132 | const char* useInstead; | |
133 | }; | |
134 | ||
a645023d A |
135 | struct AliasPair { |
136 | const char* realName; | |
137 | const char* alias; | |
138 | }; | |
139 | ||
140 | typedef const char* const* UndefinesIterator; | |
a61fdf0a | 141 | |
a645023d A |
142 | // const ObjectFile::ReaderOptions& readerOptions(); |
143 | const char* outputFilePath() const { return fOutputFile; } | |
144 | const std::vector<FileInfo>& getInputFiles() const { return fInputFiles; } | |
d696c285 | 145 | |
a645023d A |
146 | cpu_type_t architecture() const { return fArchitecture; } |
147 | bool preferSubArchitecture() const { return fHasPreferredSubType; } | |
148 | cpu_subtype_t subArchitecture() const { return fSubArchitecture; } | |
149 | bool allowSubArchitectureMismatches() const { return fAllowCpuSubtypeMismatches; } | |
150 | bool forceCpuSubtypeAll() const { return fForceSubtypeAll; } | |
151 | const char* architectureName() const { return fArchitectureName; } | |
152 | void setArchitecture(cpu_type_t, cpu_subtype_t subtype); | |
153 | OutputKind outputKind() const { return fOutputKind; } | |
154 | bool prebind() const { return fPrebind; } | |
155 | bool bindAtLoad() const { return fBindAtLoad; } | |
156 | NameSpace nameSpace() const { return fNameSpace; } | |
157 | const char* installPath() const; // only for kDynamicLibrary | |
158 | uint32_t currentVersion() const { return fDylibCurrentVersion; } // only for kDynamicLibrary | |
159 | uint32_t compatibilityVersion() const { return fDylibCompatVersion; } // only for kDynamicLibrary | |
160 | const char* entryName() const { return fEntryName; } // only for kDynamicExecutable or kStaticExecutable | |
d696c285 | 161 | const char* executablePath(); |
a645023d A |
162 | uint64_t baseAddress() const { return fBaseAddress; } |
163 | uint64_t maxAddress() const { return fMaxAddress; } | |
164 | bool keepPrivateExterns() const { return fKeepPrivateExterns; } // only for kObjectFile | |
165 | bool needsModuleTable() const { return fNeedsModuleTable; } // only for kDynamicLibrary | |
166 | bool interposable(const char* name) const; | |
167 | bool hasExportRestrictList() const { return (fExportMode != kExportDefault); } // -exported_symbol or -unexported_symbol | |
168 | bool hasExportMaskList() const { return (fExportMode == kExportSome); } // just -exported_symbol | |
169 | bool hasWildCardExportRestrictList() const; | |
170 | bool hasReExportList() const { return ! fReExportSymbols.empty(); } | |
171 | bool wasRemovedExport(const char* sym) const { return ( fRemovedExports.find(sym) != fRemovedExports.end() ); } | |
172 | bool allGlobalsAreDeadStripRoots() const; | |
173 | bool shouldExport(const char*) const; | |
174 | bool shouldReExport(const char*) const; | |
175 | bool ignoreOtherArchInputFiles() const { return fIgnoreOtherArchFiles; } | |
176 | bool traceDylibs() const { return fTraceDylibs; } | |
177 | bool traceArchives() const { return fTraceArchives; } | |
178 | bool deadCodeStrip() const { return fDeadStrip; } | |
179 | UndefinedTreatment undefinedTreatment() const { return fUndefinedTreatment; } | |
180 | ld::MacVersionMin macosxVersionMin() const { return fMacVersionMin; } | |
181 | ld::IPhoneVersionMin iphoneOSVersionMin() const { return fIPhoneVersionMin; } | |
182 | bool minOS(ld::MacVersionMin mac, ld::IPhoneVersionMin iPhoneOS); | |
c2646906 | 183 | bool messagesPrefixedWithArchitecture(); |
d696c285 | 184 | Treatment picTreatment(); |
a645023d A |
185 | WeakReferenceMismatchTreatment weakReferenceMismatchTreatment() const { return fWeakReferenceMismatchTreatment; } |
186 | const char* umbrellaName() const { return fUmbrellaName; } | |
187 | const std::vector<const char*>& allowableClients() const { return fAllowableClients; } | |
188 | const char* clientName() const { return fClientName; } | |
189 | const char* initFunctionName() const { return fInitFunctionName; } // only for kDynamicLibrary | |
d696c285 | 190 | const char* dotOutputFile(); |
a645023d A |
191 | uint64_t pageZeroSize() const { return fZeroPageSize; } |
192 | bool hasCustomStack() const { return (fStackSize != 0); } | |
193 | uint64_t customStackSize() const { return fStackSize; } | |
194 | uint64_t customStackAddr() const { return fStackAddr; } | |
195 | bool hasExecutableStack() const { return fExecutableStack; } | |
196 | bool hasNonExecutableHeap() const { return fNonExecutableHeap; } | |
197 | UndefinesIterator initialUndefinesBegin() const { return &fInitialUndefines[0]; } | |
198 | UndefinesIterator initialUndefinesEnd() const { return &fInitialUndefines[fInitialUndefines.size()]; } | |
199 | bool printWhyLive(const char* name) const; | |
200 | uint32_t minimumHeaderPad() const { return fMinimumHeaderPad; } | |
201 | bool maxMminimumHeaderPad() const { return fMaxMinimumHeaderPad; } | |
202 | ExtraSection::const_iterator extraSectionsBegin() const { return &fExtraSections[0]; } | |
203 | ExtraSection::const_iterator extraSectionsEnd() const { return &fExtraSections[fExtraSections.size()]; } | |
204 | CommonsMode commonsMode() const { return fCommonsMode; } | |
205 | bool warnCommons() const { return fWarnCommons; } | |
d696c285 | 206 | bool keepRelocations(); |
a645023d A |
207 | FileInfo findFile(const char* path) const; |
208 | UUIDMode UUIDMode() const { return fUUIDMode; } | |
d696c285 A |
209 | bool warnStabs(); |
210 | bool pauseAtEnd() { return fPause; } | |
a645023d A |
211 | bool printStatistics() const { return fStatistics; } |
212 | bool printArchPrefix() const { return fMessagesPrefixedWithArchitecture; } | |
a61fdf0a | 213 | void gotoClassicLinker(int argc, const char* argv[]); |
a645023d A |
214 | bool sharedRegionEligible() const { return fSharedRegionEligible; } |
215 | bool printOrderFileStatistics() const { return fPrintOrderFileStatistics; } | |
a61fdf0a A |
216 | const char* dTraceScriptName() { return fDtraceScriptName; } |
217 | bool dTrace() { return (fDtraceScriptName != NULL); } | |
a645023d A |
218 | unsigned long orderedSymbolsCount() const { return fOrderedSymbols.size(); } |
219 | OrderedSymbolsIterator orderedSymbolsBegin() const { return &fOrderedSymbols[0]; } | |
220 | OrderedSymbolsIterator orderedSymbolsEnd() const { return &fOrderedSymbols[fOrderedSymbols.size()]; } | |
221 | bool splitSeg() const { return fSplitSegs; } | |
a61fdf0a | 222 | uint64_t baseWritableAddress() { return fBaseWritableAddress; } |
a645023d A |
223 | uint64_t segmentAlignment() const { return fSegmentAlignment; } |
224 | uint64_t segPageSize(const char* segName) const; | |
225 | uint64_t customSegmentAddress(const char* segName) const; | |
226 | bool hasCustomSegmentAddress(const char* segName) const; | |
227 | bool hasCustomSectionAlignment(const char* segName, const char* sectName) const; | |
228 | uint8_t customSectionAlignment(const char* segName, const char* sectName) const; | |
229 | uint32_t initialSegProtection(const char*) const; | |
230 | uint32_t maxSegProtection(const char*) const; | |
231 | bool saveTempFiles() const { return fSaveTempFiles; } | |
232 | const std::vector<const char*>& rpaths() const { return fRPaths; } | |
a61fdf0a | 233 | bool readOnlyx86Stubs() { return fReadOnlyx86Stubs; } |
a645023d A |
234 | const std::vector<DylibOverride>& dylibOverrides() const { return fDylibOverrides; } |
235 | const char* generatedMapPath() const { return fMapPath; } | |
236 | bool positionIndependentExecutable() const { return fPositionIndependentExecutable; } | |
237 | Options::FileInfo findFileUsingPaths(const char* path) const; | |
238 | bool deadStripDylibs() const { return fDeadStripDylibs; } | |
239 | bool allowedUndefined(const char* name) const { return ( fAllowedUndefined.find(name) != fAllowedUndefined.end() ); } | |
240 | bool someAllowedUndefines() const { return (fAllowedUndefined.size() != 0); } | |
a61fdf0a | 241 | LocalSymbolHandling localSymbolHandling() { return fLocalSymbolHandling; } |
a645023d A |
242 | bool keepLocalSymbol(const char* symbolName) const; |
243 | bool allowTextRelocs() const { return fAllowTextRelocs; } | |
244 | bool warnAboutTextRelocs() const { return fWarnTextRelocs; } | |
245 | bool usingLazyDylibLinking() const { return fUsingLazyDylibLinking; } | |
246 | bool verbose() const { return fVerbose; } | |
247 | bool makeEncryptable() const { return fEncryptable; } | |
248 | bool needsUnwindInfoSection() const { return fAddCompactUnwindEncoding; } | |
249 | const std::vector<const char*>& llvmOptions() const{ return fLLVMOptions; } | |
250 | const std::vector<const char*>& dyldEnvironExtras() const{ return fDyldEnvironExtras; } | |
251 | bool makeCompressedDyldInfo() const { return fMakeCompressedDyldInfo; } | |
55e3d2f6 | 252 | bool hasExportedSymbolOrder(); |
a645023d | 253 | bool exportedSymbolOrder(const char* sym, unsigned int* order) const; |
55e3d2f6 | 254 | bool orderData() { return fOrderData; } |
a645023d A |
255 | bool errorOnOtherArchFiles() const { return fErrorOnOtherArchFiles; } |
256 | bool markAutoDeadStripDylib() const { return fMarkDeadStrippableDylib; } | |
257 | bool removeEHLabels() const { return fNoEHLabels; } | |
258 | bool useSimplifiedDylibReExports() const { return fUseSimplifiedDylibReExports; } | |
259 | bool objCABIVersion2POverride() const { return fObjCABIVersion2Override; } | |
260 | bool useUpwardDylibs() const { return fCanUseUpwardDylib; } | |
261 | bool fullyLoadArchives() const { return fFullyLoadArchives; } | |
262 | bool loadAllObjcObjectsFromArchives() const { return fLoadAllObjcObjectsFromArchives; } | |
263 | bool autoOrderInitializers() const { return fAutoOrderInitializers; } | |
264 | bool optimizeZeroFill() const { return fOptimizeZeroFill; } | |
265 | bool logAllFiles() const { return fLogAllFiles; } | |
266 | DebugInfoStripping debugInfoStripping() const { return fDebugInfoStripping; } | |
267 | bool flatNamespace() const { return fFlatNamespace; } | |
268 | bool linkingMainExecutable() const { return fLinkingMainExecutable; } | |
269 | bool implicitlyLinkIndirectPublicDylibs() const { return fImplicitlyLinkPublicDylibs; } | |
270 | bool whyLoad() const { return fWhyLoad; } | |
271 | const char* traceOutputFile() const { return fTraceOutputFile; } | |
272 | bool outputSlidable() const { return fOutputSlidable; } | |
273 | bool haveCmdLineAliases() const { return (fAliases.size() != 0); } | |
274 | const std::vector<AliasPair>& cmdLineAliases() const { return fAliases; } | |
275 | bool makeTentativeDefinitionsReal() const { return fMakeTentativeDefinitionsReal; } | |
276 | const char* dyldInstallPath() const { return fDyldInstallPath; } | |
277 | bool warnWeakExports() const { return fWarnWeakExports; } | |
278 | bool objcGcCompaction() const { return fObjcGcCompaction; } | |
279 | bool objcGc() const { return fObjCGc; } | |
280 | bool objcGcOnly() const { return fObjCGcOnly; } | |
281 | bool canUseThreadLocalVariables() const { return fTLVSupport; } | |
282 | bool demangleSymbols() const { return fDemangle; } | |
283 | bool addVersionLoadCommand() const { return fVersionLoadCommand; } | |
284 | bool addFunctionStarts() const { return fFunctionStartsLoadCommand; } | |
285 | bool canReExportSymbols() const { return fCanReExportSymbols; } | |
286 | const char* tempLtoObjectPath() const { return fTempLtoObjectPath; } | |
287 | bool objcCategoryMerging() const { return fObjcCategoryMerging; } | |
288 | bool hasWeakBitTweaks() const; | |
289 | bool forceWeak(const char* symbolName) const; | |
290 | bool forceNotWeak(const char* symbolName) const; | |
291 | bool forceWeakNonWildCard(const char* symbolName) const; | |
292 | bool forceNotWeakNonWildcard(const char* symbolName) const; | |
9d2e0767 | 293 | |
c2646906 A |
294 | private: |
295 | class CStringEquals | |
296 | { | |
297 | public: | |
298 | bool operator()(const char* left, const char* right) const { return (strcmp(left, right) == 0); } | |
299 | }; | |
55e3d2f6 | 300 | typedef __gnu_cxx::hash_map<const char*, unsigned int, __gnu_cxx::hash<const char*>, CStringEquals> NameToOrder; |
c2646906 A |
301 | typedef __gnu_cxx::hash_set<const char*, __gnu_cxx::hash<const char*>, CStringEquals> NameSet; |
302 | enum ExportMode { kExportDefault, kExportSome, kDontExportSome }; | |
303 | enum LibrarySearchMode { kSearchDylibAndArchiveInEachDir, kSearchAllDirsForDylibsThenAllDirsForArchives }; | |
2f2f92e4 | 304 | enum InterposeMode { kInterposeNone, kInterposeAllExternal, kInterposeSome }; |
c2646906 | 305 | |
a61fdf0a A |
306 | class SetWithWildcards { |
307 | public: | |
308 | void insert(const char*); | |
a645023d A |
309 | bool contains(const char*) const; |
310 | bool containsNonWildcard(const char*) const; | |
311 | bool empty() const { return fRegular.empty() && fWildCard.empty(); } | |
312 | bool hasWildCards() const { return !fWildCard.empty(); } | |
313 | NameSet::iterator regularBegin() const { return fRegular.begin(); } | |
314 | NameSet::iterator regularEnd() const { return fRegular.end(); } | |
315 | void remove(const NameSet&); | |
a61fdf0a | 316 | private: |
2f2f92e4 | 317 | static bool hasWildCards(const char*); |
a645023d A |
318 | bool wildCardMatch(const char* pattern, const char* candidate) const; |
319 | bool inCharRange(const char*& range, unsigned char c) const; | |
a61fdf0a A |
320 | |
321 | NameSet fRegular; | |
322 | std::vector<const char*> fWildCard; | |
323 | }; | |
324 | ||
325 | ||
c2646906 A |
326 | void parse(int argc, const char* argv[]); |
327 | void checkIllegalOptionCombinations(); | |
328 | void buildSearchPaths(int argc, const char* argv[]); | |
329 | void parseArch(const char* architecture); | |
2f2f92e4 | 330 | FileInfo findLibrary(const char* rootName, bool dylibsOnly=false); |
74cfe461 A |
331 | FileInfo findFramework(const char* frameworkName); |
332 | FileInfo findFramework(const char* rootName, const char* suffix); | |
d696c285 | 333 | bool checkForFile(const char* format, const char* dir, const char* rootName, |
a645023d | 334 | FileInfo& result) const; |
c2646906 A |
335 | uint32_t parseVersionNumber(const char*); |
336 | void parseSectionOrderFile(const char* segment, const char* section, const char* path); | |
a61fdf0a | 337 | void parseOrderFile(const char* path, bool cstring); |
c2646906 A |
338 | void addSection(const char* segment, const char* section, const char* path); |
339 | void addSubLibrary(const char* name); | |
340 | void loadFileList(const char* fileOfPaths); | |
341 | uint64_t parseAddress(const char* addr); | |
a61fdf0a A |
342 | void loadExportFile(const char* fileOfExports, const char* option, SetWithWildcards& set); |
343 | void parseAliasFile(const char* fileOfAliases); | |
c2646906 A |
344 | void parsePreCommandLineEnvironmentSettings(); |
345 | void parsePostCommandLineEnvironmentSettings(); | |
346 | void setUndefinedTreatment(const char* treatment); | |
2f2f92e4 A |
347 | void setMacOSXVersionMin(const char* version); |
348 | void setIPhoneVersionMin(const char* version); | |
c2646906 | 349 | void setWeakReferenceMismatchTreatment(const char* treatment); |
a61fdf0a | 350 | void addDylibOverride(const char* paths); |
c2646906 A |
351 | void addSectionAlignment(const char* segment, const char* section, const char* alignment); |
352 | CommonsMode parseCommonsTreatment(const char* mode); | |
d696c285 | 353 | Treatment parseTreatment(const char* treatment); |
69a49097 | 354 | void reconfigureDefaults(); |
a61fdf0a A |
355 | void checkForClassic(int argc, const char* argv[]); |
356 | void parseSegAddrTable(const char* segAddrPath, const char* installPath); | |
357 | void addLibrary(const FileInfo& info); | |
358 | void warnObsolete(const char* arg); | |
359 | uint32_t parseProtection(const char* prot); | |
55e3d2f6 | 360 | void loadSymbolOrderFile(const char* fileOfExports, NameToOrder& orderMapping); |
d696c285 A |
361 | |
362 | ||
a645023d A |
363 | |
364 | // ObjectFile::ReaderOptions fReaderOptions; | |
c2646906 A |
365 | const char* fOutputFile; |
366 | std::vector<Options::FileInfo> fInputFiles; | |
367 | cpu_type_t fArchitecture; | |
2f2f92e4 | 368 | cpu_subtype_t fSubArchitecture; |
a645023d | 369 | const char* fArchitectureName; |
c2646906 | 370 | OutputKind fOutputKind; |
2f2f92e4 | 371 | bool fHasPreferredSubType; |
d696c285 | 372 | bool fPrebind; |
c2646906 | 373 | bool fBindAtLoad; |
c2646906 | 374 | bool fKeepPrivateExterns; |
a61fdf0a | 375 | bool fNeedsModuleTable; |
c2646906 | 376 | bool fIgnoreOtherArchFiles; |
55e3d2f6 | 377 | bool fErrorOnOtherArchFiles; |
c2646906 | 378 | bool fForceSubtypeAll; |
2f2f92e4 | 379 | InterposeMode fInterposeMode; |
a645023d | 380 | bool fDeadStrip; |
c2646906 A |
381 | NameSpace fNameSpace; |
382 | uint32_t fDylibCompatVersion; | |
383 | uint32_t fDylibCurrentVersion; | |
384 | const char* fDylibInstallName; | |
a61fdf0a | 385 | const char* fFinalName; |
c2646906 A |
386 | const char* fEntryName; |
387 | uint64_t fBaseAddress; | |
a645023d | 388 | uint64_t fMaxAddress; |
a61fdf0a A |
389 | uint64_t fBaseWritableAddress; |
390 | bool fSplitSegs; | |
391 | SetWithWildcards fExportSymbols; | |
392 | SetWithWildcards fDontExportSymbols; | |
2f2f92e4 | 393 | SetWithWildcards fInterposeList; |
a645023d A |
394 | SetWithWildcards fForceWeakSymbols; |
395 | SetWithWildcards fForceNotWeakSymbols; | |
396 | SetWithWildcards fReExportSymbols; | |
397 | NameSet fRemovedExports; | |
55e3d2f6 | 398 | NameToOrder fExportSymbolsOrder; |
c2646906 A |
399 | ExportMode fExportMode; |
400 | LibrarySearchMode fLibrarySearchMode; | |
401 | UndefinedTreatment fUndefinedTreatment; | |
402 | bool fMessagesPrefixedWithArchitecture; | |
c2646906 A |
403 | WeakReferenceMismatchTreatment fWeakReferenceMismatchTreatment; |
404 | std::vector<const char*> fSubUmbellas; | |
405 | std::vector<const char*> fSubLibraries; | |
d696c285 | 406 | std::vector<const char*> fAllowableClients; |
a61fdf0a | 407 | std::vector<const char*> fRPaths; |
d696c285 | 408 | const char* fClientName; |
c2646906 A |
409 | const char* fUmbrellaName; |
410 | const char* fInitFunctionName; | |
d696c285 A |
411 | const char* fDotOutputFile; |
412 | const char* fExecutablePath; | |
69a49097 | 413 | const char* fBundleLoader; |
a61fdf0a A |
414 | const char* fDtraceScriptName; |
415 | const char* fSegAddrTablePath; | |
416 | const char* fMapPath; | |
a645023d A |
417 | const char* fDyldInstallPath; |
418 | const char* fTempLtoObjectPath; | |
c2646906 A |
419 | uint64_t fZeroPageSize; |
420 | uint64_t fStackSize; | |
421 | uint64_t fStackAddr; | |
d696c285 | 422 | bool fExecutableStack; |
a645023d A |
423 | bool fNonExecutableHeap; |
424 | bool fDisableNonExecutableHeap; | |
c2646906 | 425 | uint32_t fMinimumHeaderPad; |
55e3d2f6 | 426 | uint64_t fSegmentAlignment; |
c2646906 | 427 | CommonsMode fCommonsMode; |
a645023d | 428 | enum UUIDMode fUUIDMode; |
a61fdf0a A |
429 | SetWithWildcards fLocalSymbolsIncluded; |
430 | SetWithWildcards fLocalSymbolsExcluded; | |
431 | LocalSymbolHandling fLocalSymbolHandling; | |
c2646906 | 432 | bool fWarnCommons; |
6e880c60 | 433 | bool fVerbose; |
d696c285 | 434 | bool fKeepRelocations; |
d696c285 A |
435 | bool fWarnStabs; |
436 | bool fTraceDylibSearching; | |
437 | bool fPause; | |
438 | bool fStatistics; | |
439 | bool fPrintOptions; | |
a61fdf0a A |
440 | bool fSharedRegionEligible; |
441 | bool fPrintOrderFileStatistics; | |
442 | bool fReadOnlyx86Stubs; | |
443 | bool fPositionIndependentExecutable; | |
a645023d | 444 | bool fPIEOnCommandLine; |
d9246299 | 445 | bool fDisablePositionIndependentExecutable; |
a61fdf0a A |
446 | bool fMaxMinimumHeaderPad; |
447 | bool fDeadStripDylibs; | |
2f2f92e4 A |
448 | bool fAllowTextRelocs; |
449 | bool fWarnTextRelocs; | |
450 | bool fUsingLazyDylibLinking; | |
451 | bool fEncryptable; | |
55e3d2f6 A |
452 | bool fOrderData; |
453 | bool fMarkDeadStrippableDylib; | |
55e3d2f6 | 454 | bool fMakeCompressedDyldInfo; |
a645023d | 455 | bool fMakeCompressedDyldInfoForceOff; |
55e3d2f6 A |
456 | bool fNoEHLabels; |
457 | bool fAllowCpuSubtypeMismatches; | |
fb24a050 | 458 | bool fUseSimplifiedDylibReExports; |
a645023d A |
459 | bool fObjCABIVersion2Override; |
460 | bool fObjCABIVersion1Override; | |
461 | bool fCanUseUpwardDylib; | |
462 | bool fFullyLoadArchives; | |
463 | bool fLoadAllObjcObjectsFromArchives; | |
464 | bool fFlatNamespace; | |
465 | bool fLinkingMainExecutable; | |
466 | bool fForFinalLinkedImage; | |
467 | bool fForStatic; | |
468 | bool fForDyld; | |
469 | bool fMakeTentativeDefinitionsReal; | |
470 | bool fWhyLoad; | |
471 | bool fRootSafe; | |
472 | bool fSetuidSafe; | |
473 | bool fImplicitlyLinkPublicDylibs; | |
474 | bool fAddCompactUnwindEncoding; | |
475 | bool fWarnCompactUnwind; | |
476 | bool fRemoveDwarfUnwindIfCompactExists; | |
477 | bool fAutoOrderInitializers; | |
478 | bool fOptimizeZeroFill; | |
479 | bool fLogObjectFiles; | |
480 | bool fLogAllFiles; | |
481 | bool fTraceDylibs; | |
482 | bool fTraceIndirectDylibs; | |
483 | bool fTraceArchives; | |
484 | bool fOutputSlidable; | |
485 | bool fWarnWeakExports; | |
486 | bool fObjcGcCompaction; | |
487 | bool fObjCGc; | |
488 | bool fObjCGcOnly; | |
489 | bool fDemangle; | |
490 | bool fTLVSupport; | |
491 | bool fVersionLoadCommand; | |
492 | bool fFunctionStartsLoadCommand; | |
493 | bool fCanReExportSymbols; | |
494 | bool fObjcCategoryMerging; | |
495 | DebugInfoStripping fDebugInfoStripping; | |
496 | const char* fTraceOutputFile; | |
497 | ld::MacVersionMin fMacVersionMin; | |
498 | ld::IPhoneVersionMin fIPhoneVersionMin; | |
499 | std::vector<AliasPair> fAliases; | |
c2646906 | 500 | std::vector<const char*> fInitialUndefines; |
a61fdf0a | 501 | NameSet fAllowedUndefined; |
69a49097 | 502 | NameSet fWhyLive; |
c2646906 A |
503 | std::vector<ExtraSection> fExtraSections; |
504 | std::vector<SectionAlignment> fSectionAlignments; | |
a61fdf0a A |
505 | std::vector<OrderedSymbol> fOrderedSymbols; |
506 | std::vector<SegmentStart> fCustomSegmentAddresses; | |
55e3d2f6 | 507 | std::vector<SegmentSize> fCustomSegmentSizes; |
a61fdf0a A |
508 | std::vector<SegmentProtect> fCustomSegmentProtections; |
509 | std::vector<DylibOverride> fDylibOverrides; | |
55e3d2f6 | 510 | std::vector<const char*> fLLVMOptions; |
c2646906 A |
511 | std::vector<const char*> fLibrarySearchPaths; |
512 | std::vector<const char*> fFrameworkSearchPaths; | |
6e880c60 | 513 | std::vector<const char*> fSDKPaths; |
a645023d | 514 | std::vector<const char*> fDyldEnvironExtras; |
a61fdf0a | 515 | bool fSaveTempFiles; |
c2646906 A |
516 | }; |
517 | ||
518 | ||
519 | ||
c2646906 | 520 | #endif // __OPTIONS__ |