[llvm] [RISCV] Basic Objdump Mapping Symbol Support (PR #151452)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 4 01:50:06 PDT 2025


================
@@ -0,0 +1,88 @@
+# RUN: yaml2obj -o - %s \
+# RUN:     | llvm-objdump -d - | FileCheck %s
+
+## This CHECKs objdump's handling of wide instruction encodings, and how it
+## groups the instruction bytes when disassembling.
+##
+## This is written in YAML because using `.byte` emits the wrong mapping
+## symbols.
+
+--- !ELF
+FileHeader:
+  Class:           ELFCLASS32
+  Data:            ELFDATA2LSB
+  Type:            ET_REL
+  Machine:         EM_RISCV
+  SectionHeaderStringTable: .strtab
+Sections:
+  - Name:            .text.six_byte
+    Type:            SHT_PROGBITS
+    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
+    AddressAlign:    0x1
+    Content:         1F0123456789
----------------
jh7370 wrote:

You might want to consider `ContentArray` instead, but I suspect it's down to personal preference with no real advantages either way in this case.

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


More information about the llvm-commits mailing list