[llvm] [Object] Beginnings of SFrame parser and dumper (PR #147294)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 16 01:31:12 PDT 2025
================
@@ -6428,6 +6432,62 @@ template <typename ELFT> void ELFDumper<ELFT>::printMemtag() {
printMemtag(DynamicEntries, AndroidNoteDesc, GlobalDescriptors);
}
+template <typename ELFT>
+void ELFDumper<ELFT>::printSectionsAsSFrame(ArrayRef<std::string> Sections) {
+ constexpr endianness E = ELFT::Endianness;
+ for (object::SectionRef Section :
+ getSectionRefsByNameOrIndex(ObjF, Sections)) {
+ StringRef SectionName;
+ if (Error Err = Section.getName().moveInto(SectionName)) {
+ SectionName = "<error>";
+ reportWarning(std::move(Err), FileName);
+ }
+
+ DictScope SectionScope(W,
+ formatv("SFrame section '{0}'", SectionName).str());
+
+ StringRef SectionContent;
+ if (Error Err = Section.getContents().moveInto(SectionContent)) {
+ reportWarning(std::move(Err), FileName);
----------------
jh7370 wrote:
Test case?
https://github.com/llvm/llvm-project/pull/147294
More information about the llvm-commits
mailing list