File tree Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -71,9 +71,6 @@ class MCAssembler {
71
71
72
72
SmallVector<const MCSymbol *, 0 > Symbols;
73
73
74
- // / The list of linker options to propagate into the object file.
75
- std::vector<std::vector<std::string>> LinkerOptions;
76
-
77
74
MCDwarfLineTableParams LTParams;
78
75
79
76
// / The set of function symbols for which a .thumb_func directive has
@@ -236,10 +233,6 @@ class MCAssembler {
236
233
return make_pointee_range (Symbols);
237
234
}
238
235
239
- std::vector<std::vector<std::string>> &getLinkerOptions () {
240
- return LinkerOptions;
241
- }
242
-
243
236
bool registerSection (MCSection &Section);
244
237
bool registerSymbol (const MCSymbol &Symbol);
245
238
Original file line number Diff line number Diff line change @@ -164,6 +164,9 @@ class MachObjectWriter : public MCObjectWriter {
164
164
VersionInfoType VersionInfo{};
165
165
VersionInfoType TargetVariantVersionInfo{};
166
166
167
+ // The list of linker options for LC_LINKER_OPTION.
168
+ std::vector<std::vector<std::string>> LinkerOptions;
169
+
167
170
MachSymbolData *findSymbolData (const MCSymbol &Sym);
168
171
169
172
void writeWithPadding (StringRef Str, uint64_t Size);
@@ -249,6 +252,10 @@ class MachObjectWriter : public MCObjectWriter {
249
252
TargetVariantVersionInfo.SDKVersion = SDKVersion;
250
253
}
251
254
255
+ std::vector<std::vector<std::string>> &getLinkerOptions () {
256
+ return LinkerOptions;
257
+ }
258
+
252
259
// / @}
253
260
254
261
// / \name Target Writer Proxy Accessors
Original file line number Diff line number Diff line change @@ -93,7 +93,6 @@ void MCAssembler::reset() {
93
93
SubsectionsViaSymbols = false ;
94
94
Sections.clear ();
95
95
Symbols.clear ();
96
- LinkerOptions.clear ();
97
96
ThumbFuncs.clear ();
98
97
BundleAlignSize = 0 ;
99
98
Original file line number Diff line number Diff line change @@ -226,7 +226,7 @@ void MCMachOStreamer::emitAssemblerFlag(MCAssemblerFlag Flag) {
226
226
}
227
227
228
228
void MCMachOStreamer::emitLinkerOptions (ArrayRef<std::string> Options) {
229
- getAssembler ().getLinkerOptions ().push_back (Options);
229
+ getWriter ().getLinkerOptions ().push_back (Options);
230
230
}
231
231
232
232
void MCMachOStreamer::emitDataRegion (MCDataRegionType Kind) {
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ void MachObjectWriter::reset() {
60
60
VersionInfo.SDKVersion = VersionTuple ();
61
61
TargetVariantVersionInfo.Major = 0 ;
62
62
TargetVariantVersionInfo.SDKVersion = VersionTuple ();
63
+ LinkerOptions.clear ();
63
64
MCObjectWriter::reset ();
64
65
}
65
66
@@ -857,7 +858,7 @@ uint64_t MachObjectWriter::writeObject(MCAssembler &Asm) {
857
858
}
858
859
859
860
// Add the linker option load commands sizes.
860
- for (const auto &Option : Asm. getLinkerOptions () ) {
861
+ for (const auto &Option : LinkerOptions ) {
861
862
++NumLoadCommands;
862
863
LoadCommandsSize += ComputeLinkerOptionsLoadCommandSize (Option, is64Bit ());
863
864
}
@@ -1016,7 +1017,7 @@ uint64_t MachObjectWriter::writeObject(MCAssembler &Asm) {
1016
1017
}
1017
1018
1018
1019
// Write the linker options load commands.
1019
- for (const auto &Option : Asm. getLinkerOptions () )
1020
+ for (const auto &Option : LinkerOptions )
1020
1021
writeLinkerOptionsLoadCommand (Option);
1021
1022
1022
1023
// Write the actual section data.
You can’t perform that action at this time.
0 commit comments