[llvm] [Object] Parsing and dumping of SFrame FDEs (PR #149828)

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 25 05:10:23 PDT 2025


================
@@ -0,0 +1,232 @@
+## Check parsing and dumping of SFrame Function Descriptor Entries.
+# RUN: yaml2obj --docnum=1 %s -o %t.1
+# RUN: llvm-readobj --sframe=.sframe_short --sframe=.sframe_section_relative \
+# RUN:   --sframe=.sframe_fde_relative %t.1 2>&1 | \
+# RUN:   FileCheck %s --strict-whitespace --match-full-lines \
+# RUN:   -DFILE=%t.1 --check-prefix=CASE1
+
+## Check big-endian support.
+# RUN: yaml2obj --docnum=2 %s -o %t.2
+# RUN: llvm-readobj --sframe %t.2 2>&1 | \
+# RUN:   FileCheck %s --strict-whitespace --match-full-lines \
+# RUN:   -DFILE=%t.2 --check-prefix=CASE2
+
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:    ELFDATA2LSB
+  Type:    ET_EXEC
+Sections:
+  - Name:  .sframe_short
+    Type:  SHT_GNU_SFRAME
+    Flags: [ SHF_ALLOC ]
+    ContentArray: [
+      0xe2, 0xde, 0x02, 0x00,  # Preamble (magic, version, flags)
----------------
labath wrote:

If it existed, I'd use it, but I don't think it makes sense to introduce it just for this. It also doesn't feel like an very good match for ContentArray, as that there will be an *array* of bytes and it relies on YAML parser to parse the individual bytes. In a way, the regular `Content` field feels like a better match since it already doesn't use the 0x prefix. "All" that's needed is the ability to ignore comments/whitespace (I don't know how well that fits into the yaml syntax).

https://github.com/llvm/llvm-project/pull/149828


More information about the llvm-commits mailing list