Skip to content

Commit 87d41a4

Browse files
authored
Merge pull request #41454 from augusto2112/add-dwarf-segment
Make ObjectFile aware that the DWARF segment may contain Swift metadata
2 parents d03a03e + 49275a9 commit 87d41a4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/swift/ABI/ObjectFile.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ class SwiftObjectFileFormat {
2828
virtual llvm::Optional<llvm::StringRef> getSegmentName() {
2929
return {};
3030
}
31+
/// Get the name of the segment in the symbol rich binary that may contain
32+
/// Swift meteadata.
33+
virtual llvm::Optional<llvm::StringRef> getSymbolRichSegmentName() {
34+
return {};
35+
}
3136
/// Predicate to identify if the named section can contain reflection data.
3237
virtual bool sectionContainsReflectionData(llvm::StringRef sectionName) = 0;
3338
};
@@ -45,10 +50,15 @@ class SwiftObjectFileFormatMachO : public SwiftObjectFileFormat {
4550
}
4651
llvm_unreachable("Section type not found.");
4752
}
53+
4854
llvm::Optional<llvm::StringRef> getSegmentName() override {
4955
return {"__TEXT"};
5056
}
5157

58+
llvm::Optional<llvm::StringRef> getSymbolRichSegmentName() override {
59+
return {"__DWARF"};
60+
}
61+
5262
bool sectionContainsReflectionData(llvm::StringRef sectionName) override {
5363
return sectionName.startswith("__swift5_") || sectionName == "__const";
5464
}

0 commit comments

Comments
 (0)