Skip to content

Commit c64e749

Browse files
[autolink] Read autolink entries from custom section instead of data segments after rebranching
This change is required since swiftlang/llvm-project@d0f00c4
1 parent a738098 commit c64e749

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

lib/DriverTool/autolink_extract_main.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -147,30 +147,6 @@ extractLinkerFlagsFromObjectFile(const llvm::object::ObjectFile *ObjectFile,
147147
return false;
148148
}
149149

150-
/// Look inside the object file 'WasmObjectFile' and append any linker flags
151-
/// found in its ".swift1_autolink_entries" section to 'LinkerFlags'. Return
152-
/// 'true' if there was an error, and 'false' otherwise.
153-
static bool
154-
extractLinkerFlagsFromObjectFile(const llvm::object::WasmObjectFile *ObjectFile,
155-
std::vector<std::string> &LinkerFlags,
156-
CompilerInstance &Instance) {
157-
// Search for the data segment we hold autolink entries in
158-
for (const llvm::object::WasmSegment &Segment : ObjectFile->dataSegments()) {
159-
if (Segment.Data.Name == ".swift1_autolink_entries") {
160-
161-
StringRef SegmentData = llvm::toStringRef(Segment.Data.Content);
162-
// entries are null-terminated, so extract them and push them into
163-
// the set.
164-
llvm::SmallVector<llvm::StringRef, 4> SplitFlags;
165-
SegmentData.split(SplitFlags, llvm::StringRef("\0", 1), -1,
166-
/*KeepEmpty=*/false);
167-
for (const auto &Flag : SplitFlags)
168-
LinkerFlags.push_back(Flag.str());
169-
}
170-
}
171-
return false;
172-
}
173-
174150
/// Look inside the binary 'Bin' and append any linker flags found in its
175151
/// ".swift1_autolink_entries" section to 'LinkerFlags'. If 'Bin' is an archive,
176152
/// recursively look inside all children within the archive. Return 'true' if

0 commit comments

Comments
 (0)