[lld] [llvm] [lld][WebAssembly] Support for the custom-page-sizes WebAssembly proposal (PR #128942)

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 14:14:47 PST 2025


================
@@ -0,0 +1,48 @@
+# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
+# RUN: wasm-ld -no-gc-sections -o %t.wasm %t.o --page-size=1
+# RUN: obj2yaml %t.wasm | FileCheck %s
+
+    .section .data.foo,"",@
+    .globl  foo
+    .hidden  foo
+    .p2align        2
+foo:
+    .int32  0xffffffff
+    .size   foo, 4
+
+    .section .text._start,"",@
+    .globl  _start
+_start:
+    .functype _start () -> (i32)
+    i32.const __wasm_first_page_end
+    end_function
+
+    .section .data.bar,"",@
+    .globl  bar
+    .hidden  bar
+    .p2align        2
+bar:
+    .int32  0x11111111
+    .size   bar, 4
+
+
+# CHECK:  - Type:            MEMORY
+# NEXTLN:   Memories:
+# NEXTLN:   - Flags:           [  ]
+# NEXTLN:     Minimum:         0x20000
+# NEXTLN:     PageSize:        0x1
+
+# CHECK:  - Type:            CODE
+# NEXTLN:   Functions:
+# NEXTLN:     - Index:           0
+# NEXTLN:       Locals:          []
+# NEXTLN:       Body:            4181808080000B
+
+# CHECK:  - Type:            DATA
+# NEXTLN:   Segments:
+# NEXTLN:     - SectionOffset:   7
+# NEXTLN:       InitFlags:       0
+# NEXTLN:       Offset:
+# NEXTLN:         Opcode:          I32_CONST
+# NEXTLN:         Value:           1024
+# NEXTLN:       Content:         FFFFFFFF11111111
----------------
sbc100 wrote:

What is this trying to show?

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


More information about the llvm-commits mailing list