diff --git a/lld/docs/ReleaseNotes.rst b/lld/docs/ReleaseNotes.rst index 29db1cdf9e9c4..60db612e33956 100644 --- a/lld/docs/ReleaseNotes.rst +++ b/lld/docs/ReleaseNotes.rst @@ -52,5 +52,8 @@ MachO Improvements WebAssembly Improvements ------------------------ +* The ``--stack-first`` flag is now enabled by default. The old + behavior can be enabled using ``--no-stack-first``. + Fixes ##### diff --git a/lld/test/wasm/alias.s b/lld/test/wasm/alias.s index 0bb035b92f29c..83f40a8369921 100644 --- a/lld/test/wasm/alias.s +++ b/lld/test/wasm/alias.s @@ -24,7 +24,7 @@ _start: # CHECK-NEXT: FunctionTypes: [ 0 ] # CHECK-NEXT: - Type: MEMORY # CHECK-NEXT: Memories: -# CHECK-NEXT: - Minimum: 0x2 +# CHECK-NEXT: - Minimum: 0x1 # CHECK-NEXT: - Type: GLOBAL # CHECK-NEXT: Globals: # CHECK-NEXT: - Index: 0 @@ -32,7 +32,7 @@ _start: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66560 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Type: EXPORT # CHECK-NEXT: Exports: # CHECK-NEXT: - Name: memory diff --git a/lld/test/wasm/bss-only.s b/lld/test/wasm/bss-only.s index 1c0500f172ca4..bec7592129e7b 100644 --- a/lld/test/wasm/bss-only.s +++ b/lld/test/wasm/bss-only.s @@ -26,13 +26,13 @@ b: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 67568 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Index: 1 # CHECK-NEXT: Type: I32 # CHECK-NEXT: Mutable: false # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 2028 +# CHECK-NEXT: Value: 66540 # CHECK-NEXT: - Type: EXPORT # CHECK-NEXT: Exports: # CHECK-NEXT: - Name: memory diff --git a/lld/test/wasm/build-id.test b/lld/test/wasm/build-id.test index dd6e2237108f3..5fafd21d32240 100644 --- a/lld/test/wasm/build-id.test +++ b/lld/test/wasm/build-id.test @@ -43,12 +43,12 @@ foo: # DEFAULT: Contents of section build_id: -# DEFAULT-NEXT: 0079 10299168 1e3c845a 3c8f80ae 2f16cc22 .).h.<.Z<.../.." -# DEFAULT-NEXT: 0089 2d +# DEFAULT-NEXT: 0079 103f86e6 3bb81959 2e99ffa9 acfed331 .?..;..Y.......1 +# DEFAULT-NEXT: 0089 3a # SHA1: Contents of section build_id: -# SHA1-NEXT: 0079 145abdda 387a9bc4 e3aed3c3 3319cd37 .Z..8z......3..7 -# SHA1-NEXT: 0089 0212237c e4 ..#|. +# SHA1-NEXT: 0079 1410ade4 e75d1c9d 71023465 03b7572f .....]..q.4e..W/ +# SHA1-NEXT: 0089 c06c5ae0 74 .lZ.t # UUID: Contents of section build_id: # UUID-NEXT: 0079 10 diff --git a/lld/test/wasm/call-indirect.s b/lld/test/wasm/call-indirect.s index 7bf39a9f5aec9..64eaa593731be 100644 --- a/lld/test/wasm/call-indirect.s +++ b/lld/test/wasm/call-indirect.s @@ -82,13 +82,13 @@ indirect_func: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66576 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Index: 1 # CHECK-NEXT: Type: I32 # CHECK-NEXT: Mutable: false # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1032 +# CHECK-NEXT: Value: 65544 # CHECK-NEXT: - Type: EXPORT # CHECK-NEXT: Exports: # CHECK-NEXT: - Name: memory @@ -125,23 +125,23 @@ indirect_func: # CHECK-NEXT: Body: 42010B # CHECK-NEXT: - Index: 1 # CHECK-NEXT: Locals: -# CHECK-NEXT: Body: 410028028088808000118080808000001A410028028488808000118180808000001A0B +# CHECK-NEXT: Body: 410028028080848000118080808000001A410028028480848000118180808000001A0B # CHECK-NEXT: - Index: 2 # CHECK-NEXT: Locals: # CHECK-NEXT: Body: 41020B # CHECK-NEXT: - Index: 3 # CHECK-NEXT: Locals: -# CHECK-NEXT: Body: 410028028888808000118180808000001A0B +# CHECK-NEXT: Body: 410028028880848000118180808000001A0B # CHECK-NEXT: - Index: 4 # CHECK-NEXT: Locals: # CHECK-NEXT: Body: 42012000118280808000001A0B # CHECK-NEXT: - Type: DATA # CHECK-NEXT: Segments: -# CHECK-NEXT: - SectionOffset: 7 +# CHECK-NEXT: - SectionOffset: 8 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1024 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: Content: '010000000200000002000000' # CHECK-NEXT: - Type: CUSTOM # CHECK-NEXT: Name: name diff --git a/lld/test/wasm/comdats.ll b/lld/test/wasm/comdats.ll index 2dd687fbad1ef..1662a983698ac 100644 --- a/lld/test/wasm/comdats.ll +++ b/lld/test/wasm/comdats.ll @@ -23,13 +23,13 @@ entry: ; CHECK-NEXT: Mutable: true ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 66576 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: - Index: 1 ; CHECK-NEXT: Type: I32 ; CHECK-NEXT: Mutable: false ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1024 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: - Type: EXPORT ; CHECK-NEXT: Exports: ; CHECK-NEXT: - Name: memory @@ -69,7 +69,7 @@ entry: ; CHECK-NEXT: Body: 1080808080001082808080001A0B ; CHECK-NEXT: - Index: 2 ; CHECK-NEXT: Locals: -; CHECK-NEXT: Body: 4180888080000B +; CHECK-NEXT: Body: 4180808480000B ; CHECK-NEXT: - Index: 3 ; CHECK-NEXT: Locals: ; CHECK-NEXT: Body: 0B @@ -81,9 +81,9 @@ entry: ; CHECK-NEXT: Body: 4181808080000B ; CHECK-NEXT: - Type: DATA ; CHECK-NEXT: Segments: -; CHECK-NEXT: - SectionOffset: 7 +; CHECK-NEXT: - SectionOffset: 8 ; CHECK-NEXT: InitFlags: 0 ; CHECK-NEXT: Offset: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1024 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: Content: '616263' diff --git a/lld/test/wasm/compress-relocs.s b/lld/test/wasm/compress-relocs.s index 41d4ff567d501..37f1b3b170ff7 100644 --- a/lld/test/wasm/compress-relocs.s +++ b/lld/test/wasm/compress-relocs.s @@ -47,16 +47,16 @@ test_memory_and_indirect_call_relocs: end_function # CHECK: test_memory_and_indirect_call_relocs -# CHECK: 41 90 88 80 80 00 i32.const 1040 +# CHECK: 41 90 80 84 80 00 i32.const 65552 # CHECK: 11 80 80 80 80 00 80 80 80 80 00 call_indirect 0 -# CHECK: 28 02 94 88 80 80 00 i32.load 1044 +# CHECK: 28 02 94 80 84 80 00 i32.load 65556 # CHECK: 11 81 80 80 80 00 80 80 80 80 00 call_indirect 1 # CHECK: 41 81 80 80 80 00 i32.const 1 # CHECK: 11 80 80 80 80 00 80 80 80 80 00 call_indirect 0 # COMPRESS: test_memory_and_indirect_call_relocs -# COMPRESS: 41 90 08 i32.const 1040 +# COMPRESS: 41 90 80 04 i32.const 65552 # COMPRESS: 11 00 00 call_indirect 0 -# COMPRESS: 28 02 94 08 i32.load 1044 +# COMPRESS: 28 02 94 80 04 i32.load 65556 # COMPRESS: 11 01 00 call_indirect 1 # COMPRESS: 41 01 i32.const 1 # COMPRESS: 11 00 00 call_indirect 0 @@ -91,11 +91,11 @@ test_relative_relocs: end_function # CHECK: test_relative_relocs -# CHECK: 41 90 88 80 80 00 i32.const 1040 +# CHECK: 41 90 80 84 80 00 i32.const 65552 # CHECK: 41 81 80 80 80 00 i32.const 1 # CHECK: 41 83 80 80 80 00 i32.const 3 # COMPRESS: test_relative_relocs -# COMPRESS: 41 90 08 i32.const 1040 +# COMPRESS: 41 90 80 04 i32.const 65552 # COMPRESS: 41 01 i32.const 1 # COMPRESS: 41 03 i32.const 3 diff --git a/lld/test/wasm/compress-relocs64.s b/lld/test/wasm/compress-relocs64.s index 44e7a089275bb..f3ff646cc3b1c 100644 --- a/lld/test/wasm/compress-relocs64.s +++ b/lld/test/wasm/compress-relocs64.s @@ -36,12 +36,12 @@ test_memory_and_indirect_call_relocs: end_function # CHECK: test_memory_and_indirect_call_relocs -# CHECK: 42 90 88 80 80 80 80 80 80 80 00 i64.const 1040 -# CHECK: 29 03 98 88 80 80 80 80 80 80 80 00 i64.load 1048 +# CHECK: 42 90 80 84 80 80 80 80 80 80 00 i64.const 65552 +# CHECK: 29 03 98 80 84 80 80 80 80 80 80 00 i64.load 65560 # CHECK: 42 81 80 80 80 80 80 80 80 80 00 i64.const 1 # COMPRESS: test_memory_and_indirect_call_relocs -# COMPRESS: 42 90 08 i64.const 1040 -# COMPRESS: 29 03 98 08 i64.load 1048 +# COMPRESS: 42 90 80 04 i64.const 65552 +# COMPRESS: 29 03 98 80 04 i64.load 65560 # COMPRESS: 42 01 i64.const 1 .globl test_relative_relocs @@ -56,11 +56,11 @@ test_relative_relocs: end_function # CHECK: test_relative_relocs -# CHECK: 42 90 88 80 80 80 80 80 80 80 00 i64.const 1040 +# CHECK: 42 90 80 84 80 80 80 80 80 80 00 i64.const 65552 # CHECK: 42 81 80 80 80 80 80 80 80 80 00 i64.const 1 # CHECK: 42 83 80 80 80 80 80 80 80 80 00 i64.const 3 # COMPRESS: test_relative_relocs -# COMPRESS: 42 90 08 i64.const 1040 +# COMPRESS: 42 90 80 04 i64.const 65552 # COMPRESS: 42 01 i64.const 1 # COMPRESS: 42 03 i64.const 3 diff --git a/lld/test/wasm/custom-section-name.ll b/lld/test/wasm/custom-section-name.ll index 8799fbf36056d..89cb72fe3cf99 100644 --- a/lld/test/wasm/custom-section-name.ll +++ b/lld/test/wasm/custom-section-name.ll @@ -16,29 +16,29 @@ target triple = "wasm32-unknown-unknown" ; CHECK-LABEL: - Type: DATA ; CHECK-NEXT: Segments: -; CHECK-NEXT: - SectionOffset: 7 +; CHECK-NEXT: - SectionOffset: 8 ; CHECK-NEXT: InitFlags: 0 ; CHECK-NEXT: Offset: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1024 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: Content: '00000000' -; CHECK-NEXT: - SectionOffset: 17 +; CHECK-NEXT: - SectionOffset: 19 ; CHECK-NEXT: InitFlags: 0 ; CHECK-NEXT: Offset: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1028 +; CHECK-NEXT: Value: 65540 ; CHECK-NEXT: Content: 2A000000 -; CHECK-NEXT: - SectionOffset: 27 +; CHECK-NEXT: - SectionOffset: 30 ; CHECK-NEXT: InitFlags: 0 ; CHECK-NEXT: Offset: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1032 +; CHECK-NEXT: Value: 65544 ; CHECK-NEXT: Content: '07000000' -; BSS-NEXT: - SectionOffset: 37 +; BSS-NEXT: - SectionOffset: 41 ; BSS-NEXT: InitFlags: 0 ; BSS-NEXT: Offset: ; BSS-NEXT: Opcode: I32_CONST -; BSS-NEXT: Value: 1036 +; BSS-NEXT: Value: 65548 ; BSS-NEXT: Content: '00000000' ; NO-BSS-NOT: - SectionOffset: diff --git a/lld/test/wasm/data-layout.s b/lld/test/wasm/data-layout.s index a68bc032e4840..8df834d6ea8c4 100644 --- a/lld/test/wasm/data-layout.s +++ b/lld/test/wasm/data-layout.s @@ -63,33 +63,33 @@ local_struct_internal_ptr: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: [[PTR]]_CONST -# CHECK-NEXT: Value: 66624 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Index: 1 # CHECK-NEXT: Type: [[PTR]] # CHECK-NEXT: Mutable: false # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: [[PTR]]_CONST -# CHECK-NEXT: Value: 1080 +# CHECK-NEXT: Value: 65592 # CHECK-NEXT: - Index: 2 # CHECK-NEXT: Type: [[PTR]] # CHECK-NEXT: Mutable: false # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: [[PTR]]_CONST -# CHECK-NEXT: Value: 66624 +# CHECK-NEXT: Value: 65600 # CHECK: - Type: DATA # CHECK-NEXT: Segments: -# CHECK-NEXT: - SectionOffset: 7 +# CHECK-NEXT: - SectionOffset: 8 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: [[PTR]]_CONST -# CHECK-NEXT: Value: 1024 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: Content: 68656C6C6F0A00 -# CHECK-NEXT: - SectionOffset: 20 +# CHECK-NEXT: - SectionOffset: 22 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: [[PTR]]_CONST -# CHECK-NEXT: Value: 1040 +# CHECK-NEXT: Value: 65552 # RUN: wasm-ld -no-gc-sections --allow-undefined --no-entry \ diff --git a/lld/test/wasm/data-segment-merging.ll b/lld/test/wasm/data-segment-merging.ll index e6f3c5ee469f2..34c49e8b901f6 100644 --- a/lld/test/wasm/data-segment-merging.ll +++ b/lld/test/wasm/data-segment-merging.ll @@ -15,11 +15,11 @@ ; MERGE-LABEL: - Type: DATA ; MERGE-NEXT: Segments: -; MERGE-NEXT: - SectionOffset: 7 +; MERGE-NEXT: - SectionOffset: 8 ; MERGE-NEXT: InitFlags: 0 ; MERGE-NEXT: Offset: ; MERGE: Content: 636F6E7374616E74000000002B -; MERGE-NEXT: - SectionOffset: 26 +; MERGE-NEXT: - SectionOffset: 28 ; MERGE-NEXT: InitFlags: 0 ; MERGE-NEXT: Offset: ; MERGE: Content: 68656C6C6F00676F6F6462796500776861746576657200002A000000 @@ -41,27 +41,27 @@ ; SEPARATE-NOT: DATACOUNT ; SEPARATE-LABEL: - Type: DATA ; SEPARATE-NEXT: Segments: -; SEPARATE-NEXT: - SectionOffset: 7 +; SEPARATE-NEXT: - SectionOffset: 8 ; SEPARATE-NEXT: InitFlags: 0 ; SEPARATE-NEXT: Offset: ; SEPARATE: Content: 636F6E7374616E7400 -; SEPARATE-NEXT: - SectionOffset: 22 +; SEPARATE-NEXT: - SectionOffset: 24 ; SEPARATE-NEXT: InitFlags: 0 ; SEPARATE-NEXT: Offset: ; SEPARATE: Content: 2B -; SEPARATE-NEXT: - SectionOffset: 29 +; SEPARATE-NEXT: - SectionOffset: 32 ; SEPARATE-NEXT: InitFlags: 0 ; SEPARATE-NEXT: Offset: ; SEPARATE: Content: 68656C6C6F00 -; SEPARATE-NEXT: - SectionOffset: 41 +; SEPARATE-NEXT: - SectionOffset: 45 ; SEPARATE-NEXT: InitFlags: 0 ; SEPARATE-NEXT: Offset: ; SEPARATE: Content: 676F6F6462796500 -; SEPARATE-NEXT: - SectionOffset: 55 +; SEPARATE-NEXT: - SectionOffset: 60 ; SEPARATE-NEXT: InitFlags: 0 ; SEPARATE-NEXT: Offset: ; SEPARATE: Content: '776861746576657200' -; SEPARATE-NEXT: - SectionOffset: 70 +; SEPARATE-NEXT: - SectionOffset: 76 ; SEPARATE-NEXT: InitFlags: 0 ; SEPARATE-NEXT: Offset: ; SEPARATE: Content: 2A000000 diff --git a/lld/test/wasm/data-segments.ll b/lld/test/wasm/data-segments.ll index 6c401c4873910..237f4285e3763 100644 --- a/lld/test/wasm/data-segments.ll +++ b/lld/test/wasm/data-segments.ll @@ -61,20 +61,20 @@ ; ACTIVE-NEXT: Body: 0B ; ACTIVE-NEXT: - Type: DATA ; ACTIVE-NEXT: Segments: -; ACTIVE-NEXT: - SectionOffset: 7 +; ACTIVE-NEXT: - SectionOffset: 8 ; ACTIVE-NEXT: InitFlags: 0 ; ACTIVE-NEXT: Offset: ; ACTIVE32-NEXT: Opcode: I32_CONST ; ACTIVE64-NEXT: Opcode: I64_CONST -; ACTIVE-NEXT: Value: 1024 +; ACTIVE-NEXT: Value: 65536 ; ACTIVE-NEXT: Content: 636F6E7374616E74000000002B -; ACTIVE-NEXT: - SectionOffset: 26 +; ACTIVE-NEXT: - SectionOffset: 28 ; ACTIVE-NEXT: InitFlags: 0 ; ACTIVE-NEXT: Offset: ; ACTIVE32-NEXT: Opcode: I32_CONST ; ACTIVE64-NEXT: Opcode: I64_CONST -; ACTIVE-NEXT: Value: 1040 -; ACTIVE-NEXT: Content: 68656C6C6F00676F6F646279650000002A000000 +; ACTIVE-NEXT: Value: 65552 +; ACTIVE-NEXT: Content: 68656C6C6F00676F6F646279650000002A00000063000000 ; ACTIVE-NEXT: - Type: CUSTOM ; ACTIVE-NEXT: Name: name ; ACTIVE-NEXT: FunctionNames: @@ -201,7 +201,7 @@ ; DIS-NEXT: block ; DIS-NEXT: block -; NOPIC-DIS-NEXT: [[PTR]].const 11064 +; NOPIC-DIS-NEXT: [[PTR]].const 75576 ; PIC-DIS-NEXT: local.get 0 ; DIS-NEXT: i32.const 0 @@ -211,8 +211,8 @@ ; DIS-NEXT: # 2: down to label0 ; DIS-NEXT: end -; NOPIC-DIS-NEXT: [[PTR]].const 1024 -; NOPIC-DIS-NEXT: [[PTR]].const 1024 +; NOPIC-DIS-NEXT: [[PTR]].const 65536 +; NOPIC-DIS-NEXT: [[PTR]].const 65536 ; NOPIC-DIS-NEXT: global.set 1 ; PIC-DIS-NEXT: [[PTR]].const 0 ; PIC-DIS-NEXT: global.get 1 @@ -224,7 +224,7 @@ ; DIS-NEXT: i32.const 4 ; DIS-NEXT: memory.init 0, 0 -; NOPIC-DIS-NEXT: [[PTR]].const 1028 +; NOPIC-DIS-NEXT: [[PTR]].const 65540 ; PIC-DIS-NEXT: [[PTR]].const 4 ; PIC-DIS-NEXT: global.get 1 ; PIC-DIS-NEXT: [[PTR]].add @@ -233,7 +233,7 @@ ; DIS-NEXT: i32.const 13 ; DIS-NEXT: memory.init 1, 0 -; NOPIC-DIS-NEXT: [[PTR]].const 1044 +; NOPIC-DIS-NEXT: [[PTR]].const 65556 ; PIC-DIS-NEXT: [[PTR]].const 20 ; PIC-DIS-NEXT: global.get 1 ; PIC-DIS-NEXT: [[PTR]].add @@ -241,7 +241,7 @@ ; DIS-NEXT: i32.const 0 ; DIS-NEXT: i32.const 20 ; DIS-NEXT: memory.init 2, 0 -; NOPIC-DIS-NEXT: [[PTR]].const 1064 +; NOPIC-DIS-NEXT: [[PTR]].const 65576 ; PIC-DIS-NEXT: [[PTR]].const 40 ; PIC-DIS-NEXT: global.get 1 ; PIC-DIS-NEXT: [[PTR]].add @@ -249,13 +249,13 @@ ; DIS-NEXT: [[PTR]].const 10000 ; DIS-NEXT: memory.fill 0 -; NOPIC-DIS-NEXT: [[PTR]].const 11064 +; NOPIC-DIS-NEXT: [[PTR]].const 75576 ; PIC-DIS-NEXT: local.get 0 ; DIS-NEXT: i32.const 2 ; DIS-NEXT: i32.atomic.store 0 -; NOPIC-DIS-NEXT: [[PTR]].const 11064 +; NOPIC-DIS-NEXT: [[PTR]].const 75576 ; PIC-DIS-NEXT: local.get 0 ; DIS-NEXT: i32.const -1 @@ -264,7 +264,7 @@ ; DIS-NEXT: br 1 # 1: down to label1 ; DIS-NEXT: end -; NOPIC-DIS-NEXT: [[PTR]].const 11064 +; NOPIC-DIS-NEXT: [[PTR]].const 75576 ; PIC-DIS-NEXT: local.get 0 ; DIS-NEXT: i32.const 1 diff --git a/lld/test/wasm/debuginfo.test b/lld/test/wasm/debuginfo.test index 9cb1cc31e515a..7e6bd51cb35c9 100644 --- a/lld/test/wasm/debuginfo.test +++ b/lld/test/wasm/debuginfo.test @@ -50,7 +50,7 @@ CHECK-NEXT: DW_AT_type (0x000000ac "int[2]") CHECK-NEXT: DW_AT_external (true) CHECK-NEXT: DW_AT_decl_file ("{{.*}}hi_foo.c") CHECK-NEXT: DW_AT_decl_line (1) -CHECK: DW_AT_location (DW_OP_addr 0x400) +CHECK: DW_AT_location (DW_OP_addr 0x10000) CHECK: DW_TAG_array_type diff --git a/lld/test/wasm/dylink-non-pie.s b/lld/test/wasm/dylink-non-pie.s index 3157b8c32120f..fddfddb4df658 100755 --- a/lld/test/wasm/dylink-non-pie.s +++ b/lld/test/wasm/dylink-non-pie.s @@ -32,7 +32,7 @@ f_p: # DIS: <__wasm_apply_data_relocs>: # DIS-EMPTY: -# DIS-NEXT: i32.const 1024 +# DIS-NEXT: i32.const 65536 # DIS-NEXT: global.get 0 # DIS-NEXT: i32.store 0 # DIS-NEXT: end diff --git a/lld/test/wasm/emit-relocs.s b/lld/test/wasm/emit-relocs.s index 385344cb23321..3df345c0c7038 100644 --- a/lld/test/wasm/emit-relocs.s +++ b/lld/test/wasm/emit-relocs.s @@ -41,11 +41,11 @@ foo: # CHECK: - Type: DATA # CHECK-NEXT: Segments: -# CHECK-NEXT: - SectionOffset: 7 +# CHECK-NEXT: - SectionOffset: 8 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1024 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: Content: '00000000' # There should be a single relocation in this section (just the live symbol) @@ -75,5 +75,5 @@ foo: # CHECK-NEXT: Kind: DATA # CHECK-NEXT: Name: __stack_low # CHECK-NEXT: Flags: [ VISIBILITY_HIDDEN, ABSOLUTE ] -# CHECK-NEXT: Offset: 1040 # CHECK-NEXT: Size: 0 +# CHECK-NEXT: - Index: 3 diff --git a/lld/test/wasm/externref.s b/lld/test/wasm/externref.s index ffc63a6d3d0be..1443e5f7fda5f 100644 --- a/lld/test/wasm/externref.s +++ b/lld/test/wasm/externref.s @@ -35,7 +35,7 @@ _start: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66560 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Index: 1 # CHECK-NEXT: Type: EXTERNREF # CHECK-NEXT: Mutable: true diff --git a/lld/test/wasm/gc-sections.ll b/lld/test/wasm/gc-sections.ll index e709ab7ba2c3d..69d7ed2105cf7 100644 --- a/lld/test/wasm/gc-sections.ll +++ b/lld/test/wasm/gc-sections.ll @@ -57,7 +57,7 @@ entry: ; CHECK-NEXT: Mutable: true ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 66576 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: - Index: 1 ; CHECK-NEXT: Type: I64 ; CHECK-NEXT: Mutable: true @@ -67,11 +67,11 @@ entry: ; CHECK: - Type: DATA ; CHECK-NEXT: Segments: -; CHECK-NEXT: - SectionOffset: 7 +; CHECK-NEXT: - SectionOffset: 8 ; CHECK-NEXT: InitFlags: 0 ; CHECK-NEXT: Offset: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1024 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: Content: '02000000' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: name @@ -123,7 +123,7 @@ entry: ; NO-GC-NEXT: Mutable: true ; NO-GC-NEXT: InitExpr: ; NO-GC-NEXT: Opcode: I32_CONST -; NO-GC-NEXT: Value: 66576 +; NO-GC-NEXT: Value: 65536 ; NO-GC-NEXT: - Index: 1 ; NO-GC-NEXT: Type: I64 ; NO-GC-NEXT: Mutable: true @@ -139,11 +139,11 @@ entry: ; NO-GC: - Type: DATA ; NO-GC-NEXT: Segments: -; NO-GC-NEXT: - SectionOffset: 7 +; NO-GC-NEXT: - SectionOffset: 8 ; NO-GC-NEXT: InitFlags: 0 ; NO-GC-NEXT: Offset: ; NO-GC-NEXT: Opcode: I32_CONST -; NO-GC-NEXT: Value: 1024 +; NO-GC-NEXT: Value: 65536 ; NO-GC-NEXT: Content: '010000000000000002000000' ; NO-GC-NEXT: - Type: CUSTOM ; NO-GC-NEXT: Name: name diff --git a/lld/test/wasm/global-base.test b/lld/test/wasm/global-base.test index 0e65f0cce8f49..e84b8ec3ef9ce 100644 --- a/lld/test/wasm/global-base.test +++ b/lld/test/wasm/global-base.test @@ -19,19 +19,19 @@ CHECK-1024-NEXT: Type: I32 CHECK-1024-NEXT: Mutable: true CHECK-1024-NEXT: InitExpr: CHECK-1024-NEXT: Opcode: I32_CONST -CHECK-1024-NEXT: Value: 66560 +CHECK-1024-NEXT: Value: 65536 CHECK-1024-NEXT: - Index: 1 CHECK-1024-NEXT: Type: I32 CHECK-1024-NEXT: Mutable: false CHECK-1024-NEXT: InitExpr: CHECK-1024-NEXT: Opcode: I32_CONST -CHECK-1024-NEXT: Value: 1024 +CHECK-1024-NEXT: Value: 65536 CHECK-1024-NEXT: - Index: 2 CHECK-1024-NEXT: Type: I32 CHECK-1024-NEXT: Mutable: false CHECK-1024-NEXT: InitExpr: CHECK-1024-NEXT: Opcode: I32_CONST -CHECK-1024-NEXT: Value: 1024 +CHECK-1024-NEXT: Value: 65536 CHECK-1024: - Type: EXPORT CHECK-1024: - Name: __data_end @@ -50,7 +50,7 @@ CHECK-16777216-NEXT: Type: I32 CHECK-16777216-NEXT: Mutable: true CHECK-16777216-NEXT: InitExpr: CHECK-16777216-NEXT: Opcode: I32_CONST -CHECK-16777216-NEXT: Value: 16842752 +CHECK-16777216-NEXT: Value: 65536 CHECK-16777216-NEXT: - Index: 1 CHECK-16777216-NEXT: Type: I32 CHECK-16777216-NEXT: Mutable: false diff --git a/lld/test/wasm/globals.s b/lld/test/wasm/globals.s index 6e049e1e73f91..47d9ba82818b7 100644 --- a/lld/test/wasm/globals.s +++ b/lld/test/wasm/globals.s @@ -42,7 +42,7 @@ immutable_global: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66560 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Index: 1 # CHECK-NEXT: Type: I32 # CHECK-NEXT: Mutable: false diff --git a/lld/test/wasm/import-memory.test b/lld/test/wasm/import-memory.test index dd7066dec0059..9b8148e4d4495 100644 --- a/lld/test/wasm/import-memory.test +++ b/lld/test/wasm/import-memory.test @@ -10,7 +10,7 @@ # CHECK-NEXT: Field: memory # CHECK-NEXT: Kind: MEMORY # CHECK-NEXT: Memory: -# CHECK-NEXT: Minimum: 0x2 +# CHECK-NEXT: Minimum: 0x1 # CHECK-NEXT: - Type: diff --git a/lld/test/wasm/init-fini.ll b/lld/test/wasm/init-fini.ll index ef2f41f96e89b..7471ebb5d8147 100644 --- a/lld/test/wasm/init-fini.ll +++ b/lld/test/wasm/init-fini.ll @@ -78,7 +78,7 @@ entry: ; CHECK-NEXT: Body: 10041005100A100F1012100F10141004100C100F10161002100E0B ; CHECK: - Index: 22 ; CHECK-NEXT: Locals: -; CHECK-NEXT: Body: 02404186808080004100418088808000108080808000450D00000B0B +; CHECK-NEXT: Body: 02404186808080004100418080848000108080808000450D00000B0B ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: name ; CHECK-NEXT: FunctionNames: diff --git a/lld/test/wasm/large-memory.test b/lld/test/wasm/large-memory.test index 5b737e4154963..a2888c61702ac 100644 --- a/lld/test/wasm/large-memory.test +++ b/lld/test/wasm/large-memory.test @@ -12,7 +12,7 @@ RUN: obj2yaml %t2.wasm | FileCheck %s --check-prefixes=CHECK,CHECK-4G CHECK: - Type: MEMORY CHECK-NEXT: Memories: CHECK-NEXT: - Flags: [ HAS_MAX ] -CHECK-NEXT: Minimum: 0x2 +CHECK-NEXT: Minimum: 0x1 CHECK-2G-NEXT: Maximum: 0x8000 CHECK-4G-NEXT: Maximum: 0x10000 diff --git a/lld/test/wasm/local-symbols.ll b/lld/test/wasm/local-symbols.ll index 8faee647c44c8..6c639a83dbf51 100644 --- a/lld/test/wasm/local-symbols.ll +++ b/lld/test/wasm/local-symbols.ll @@ -45,13 +45,13 @@ entry: ; CHECK-NEXT: Mutable: true ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 66576 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: - Index: 1 ; CHECK-NEXT: Type: I32 ; CHECK-NEXT: Mutable: false ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1024 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: - Type: EXPORT ; CHECK-NEXT: Exports: ; CHECK-NEXT: - Name: memory @@ -67,17 +67,17 @@ entry: ; CHECK-NEXT: Functions: ; CHECK-NEXT: - Index: 0 ; CHECK-NEXT: Locals: -; CHECK-NEXT: Body: 4100280284888080000B +; CHECK-NEXT: Body: 4100280284808480000B ; CHECK-NEXT: - Index: 1 ; CHECK-NEXT: Locals: ; CHECK-NEXT: Body: 1080808080001A0B ; CHECK-NEXT: - Type: DATA ; CHECK-NEXT: Segments: -; CHECK-NEXT: - SectionOffset: 7 +; CHECK-NEXT: - SectionOffset: 8 ; CHECK-NEXT: InitFlags: 0 ; CHECK-NEXT: Offset: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1024 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: Content: '0100000003000000' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: name diff --git a/lld/test/wasm/locals-duplicate.test b/lld/test/wasm/locals-duplicate.test index 5c3135a424e69..88819b2707dde 100644 --- a/lld/test/wasm/locals-duplicate.test +++ b/lld/test/wasm/locals-duplicate.test @@ -26,7 +26,7 @@ ; CHECK-NEXT: Maximum: 0x7 ; CHECK-NEXT: - Type: MEMORY ; CHECK-NEXT: Memories: -; CHECK-NEXT: - Minimum: 0x2 +; CHECK-NEXT: - Minimum: 0x2 ; CHECK-NEXT: - Type: GLOBAL ; CHECK-NEXT: Globals: ; CHECK-NEXT: - Index: 0 @@ -34,19 +34,19 @@ ; CHECK-NEXT: Mutable: true ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 66592 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: - Index: 1 ; CHECK-NEXT: Type: I32 ; CHECK-NEXT: Mutable: false ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1028 +; CHECK-NEXT: Value: 65540 ; CHECK-NEXT: - Index: 2 ; CHECK-NEXT: Type: I32 ; CHECK-NEXT: Mutable: false ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1036 +; CHECK-NEXT: Value: 65548 ; CHECK-NEXT: - Type: EXPORT ; CHECK-NEXT: Exports: ; CHECK-NEXT: - Name: memory @@ -119,13 +119,13 @@ ; CHECK-NEXT: Body: 41020B ; CHECK-NEXT: - Index: 3 ; CHECK-NEXT: Locals: -; CHECK-NEXT: Body: 4180888080000B +; CHECK-NEXT: Body: 4180808480000B ; CHECK-NEXT: - Index: 4 ; CHECK-NEXT: Locals: -; CHECK-NEXT: Body: 4184888080000B +; CHECK-NEXT: Body: 4184808480000B ; CHECK-NEXT: - Index: 5 ; CHECK-NEXT: Locals: -; CHECK-NEXT: Body: 4188888080000B +; CHECK-NEXT: Body: 4188808480000B ; CHECK-NEXT: - Index: 6 ; CHECK-NEXT: Locals: ; CHECK-NEXT: Body: 4181808080000B @@ -146,13 +146,13 @@ ; CHECK-NEXT: Body: 41020B ; CHECK-NEXT: - Index: 12 ; CHECK-NEXT: Locals: -; CHECK-NEXT: Body: 418C888080000B +; CHECK-NEXT: Body: 418C808480000B ; CHECK-NEXT: - Index: 13 ; CHECK-NEXT: Locals: -; CHECK-NEXT: Body: 4190888080000B +; CHECK-NEXT: Body: 4190808480000B ; CHECK-NEXT: - Index: 14 ; CHECK-NEXT: Locals: -; CHECK-NEXT: Body: 4194888080000B +; CHECK-NEXT: Body: 4194808480000B ; CHECK-NEXT: - Index: 15 ; CHECK-NEXT: Locals: ; CHECK-NEXT: Body: 4184808080000B @@ -164,11 +164,11 @@ ; CHECK-NEXT: Body: 4186808080000B ; CHECK-NEXT: - Type: DATA ; CHECK-NEXT: Segments: -; CHECK-NEXT: - SectionOffset: 7 +; CHECK-NEXT: - SectionOffset: 8 ; CHECK-NEXT: InitFlags: 0 ; CHECK-NEXT: Offset: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1024 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: Content: '010000000100000001000000010000000100000001000000' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: name diff --git a/lld/test/wasm/lto/tls.ll b/lld/test/wasm/lto/tls.ll index b61edfba6146f..9c1642eb84535 100644 --- a/lld/test/wasm/lto/tls.ll +++ b/lld/test/wasm/lto/tls.ll @@ -30,13 +30,13 @@ attributes #0 = { noinline nounwind optnone "target-features"="+atomics,+bulk-me ; CHECK-NEXT: Mutable: true ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 66576 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: - Index: 1 ; CHECK-NEXT: Type: I32 ; CHECK-NEXT: Mutable: false ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1024 +; CHECK-NEXT: Value: 65536 ; CHECK: GlobalNames: ; CHECK-NEXT: - Index: 0 diff --git a/lld/test/wasm/lto/used.ll b/lld/test/wasm/lto/used.ll index a1851035fa247..dd36259d92e38 100644 --- a/lld/test/wasm/lto/used.ll +++ b/lld/test/wasm/lto/used.ll @@ -26,11 +26,11 @@ return: ; CHECK: - Type: DATA ; CHECK-NEXT: Segments: -; CHECK-NEXT: - SectionOffset: 7 +; CHECK-NEXT: - SectionOffset: 8 ; CHECK-NEXT: InitFlags: 0 ; CHECK-NEXT: Offset: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1024 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: Content: '01000000' ; CHECK: - Type: CUSTOM diff --git a/lld/test/wasm/map-file.s b/lld/test/wasm/map-file.s index 2757f50187ffe..380ab57ca8ee4 100644 --- a/lld/test/wasm/map-file.s +++ b/lld/test/wasm/map-file.s @@ -59,15 +59,15 @@ somezeroes: # CHECK-NEXT: - 66 b write_global # CHECK-NEXT: - 71 f {{.*}}{{/|\\}}map-file.s.tmp1.o:(_start) # CHECK-NEXT: - 71 f _start -# CHECK-NEXT: - 82 11 DATA -# CHECK-NEXT: 400 83 8 .data -# CHECK-NEXT: 400 89 8 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.data.somedata) -# CHECK-NEXT: 400 89 8 somedata -# CHECK-NEXT: 408 82 4 .bss -# CHECK-NEXT: 408 0 4 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.bss.somezeroes) -# CHECK-NEXT: 408 0 4 somezeroes -# CHECK-NEXT: - 93 12 CUSTOM(.debug_info) -# CHECK-NEXT: - a5 61 CUSTOM(name) +# CHECK-NEXT: - 82 12 DATA +# CHECK-NEXT: 10000 83 8 .data +# CHECK-NEXT: 10000 8a 8 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.data.somedata) +# CHECK-NEXT: 10000 8a 8 somedata +# CHECK-NEXT: 10008 82 4 .bss +# CHECK-NEXT: 10008 0 4 {{.*}}{{/|\\}}map-file.s.tmp1.o:(.bss.somezeroes) +# CHECK-NEXT: 10008 0 4 somezeroes +# CHECK-NEXT: - 94 12 CUSTOM(.debug_info) +# CHECK-NEXT: - a6 61 CUSTOM(name) # RUN: not wasm-ld %t1.o -o /dev/null -Map=/ 2>&1 \ # RUN: | FileCheck -check-prefix=FAIL %s diff --git a/lld/test/wasm/memory-naming.test b/lld/test/wasm/memory-naming.test index 766d9cd59050b..66143c317798c 100644 --- a/lld/test/wasm/memory-naming.test +++ b/lld/test/wasm/memory-naming.test @@ -57,7 +57,7 @@ # CHECK-IMPORT-NEXT: Field: bar # CHECK-IMPORT-NEXT: Kind: MEMORY # CHECK-IMPORT-NEXT: Memory: -# CHECK-IMPORT-NEXT: Minimum: 0x2 +# CHECK-IMPORT-NEXT: Minimum: 0x1 # CHECK-IMPORT: - Type: EXPORT # CHECK-IMPORT-NEXT: Exports: # CHECK-IMPORT-NEXT: - Name: _start @@ -77,7 +77,7 @@ # CHECK-IMPORT-DEFAULT-NEXT: Field: foo # CHECK-IMPORT-DEFAULT-NEXT: Kind: MEMORY # CHECK-IMPORT-DEFAULT-NEXT: Memory: -# CHECK-IMPORT-DEFAULT-NEXT: Minimum: 0x2 +# CHECK-IMPORT-DEFAULT-NEXT: Minimum: 0x1 # CHECK-IMPORT-DEFAULT-NEXT: - Type: # RUN:wasm-ld --import-memory=foo,bar --export-memory=qux -o %t.both.wasm %t.start.o @@ -91,7 +91,7 @@ # CHECK-BOTH-NEXT: Field: bar # CHECK-BOTH-NEXT: Kind: MEMORY # CHECK-BOTH-NEXT: Memory: -# CHECK-BOTH-NEXT: Minimum: 0x2 +# CHECK-BOTH-NEXT: Minimum: 0x1 # CHECK-BOTH: - Type: EXPORT # CHECK-BOTH-NEXT: Exports: # CHECK-BOTH-NEXT: - Name: qux diff --git a/lld/test/wasm/merge-string.s b/lld/test/wasm/merge-string.s index a4b89abfc46d7..229f3933f1d89 100644 --- a/lld/test/wasm/merge-string.s +++ b/lld/test/wasm/merge-string.s @@ -41,21 +41,21 @@ negative_addend: // COMMON-NEXT: Mutable: true // COMMON-NEXT: InitExpr: // COMMON-NEXT: Opcode: I32_CONST -// COMMON-NEXT: Value: 66576 +// COMMON-NEXT: Value: 65536 // COMMON-NEXT: - Index: 1 // COMMON-NEXT: Type: I32 // COMMON-NEXT: Mutable: false // COMMON-NEXT: InitExpr: // COMMON-NEXT: Opcode: I32_CONST -// MERGE-NEXT: Value: 1024 -// NOMERGE-NEXT: Value: 1028 +// MERGE-NEXT: Value: 65536 +// NOMERGE-NEXT: Value: 65540 // COMMON-NEXT: - Index: 2 // COMMON-NEXT: Type: I32 // COMMON-NEXT: Mutable: false // COMMON-NEXT: InitExpr: // COMMON-NEXT: Opcode: I32_CONST -// MERGE-NEXT: Value: 1025 -// NOMERGE-NEXT: Value: 1029 +// MERGE-NEXT: Value: 65537 +// NOMERGE-NEXT: Value: 65541 // COMMON-NEXT: - Type: EXPORT // COMMON-NEXT: Exports: // COMMON-NEXT: - Name: memory @@ -71,11 +71,11 @@ negative_addend: // // COMMON: - Type: DATA // COMMON-NEXT: Segments: -// COMMON-NEXT: - SectionOffset: 7 +// COMMON-NEXT: - SectionOffset: 8 // COMMON-NEXT: InitFlags: 0 // COMMON-NEXT: Offset: // COMMON-NEXT: Opcode: I32_CONST -// COMMON-NEXT: Value: 1024 +// COMMON-NEXT: Value: 65536 // MERGE-NEXT: Content: '61626300' // NOMERGE-NEXT: Content: '6162630061626300626300' diff --git a/lld/test/wasm/multi-table.s b/lld/test/wasm/multi-table.s index afe8ddac49768..31cba9ff77c2d 100644 --- a/lld/test/wasm/multi-table.s +++ b/lld/test/wasm/multi-table.s @@ -87,7 +87,7 @@ call_indirect_explicit_tables: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66576 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Type: EXPORT # CHECK-NEXT: Exports: # CHECK-NEXT: - Name: memory @@ -127,14 +127,14 @@ call_indirect_explicit_tables: # CHECK-NEXT: Body: 42010B # CHECK-NEXT: - Index: 3 # CHECK-NEXT: Locals: [] -# CHECK-NEXT: Body: 41002802808880800011818080800083808080001A41002802848880800011828080800083808080001A0B +# CHECK-NEXT: Body: 41002802808084800011818080800083808080001A41002802848084800011828080800083808080001A0B # CHECK-NEXT: - Type: DATA # CHECK-NEXT: Segments: -# CHECK-NEXT: - SectionOffset: 7 +# CHECK-NEXT: - SectionOffset: 8 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1024 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: Content: '0100000002000000' # CHECK-NEXT: - Type: CUSTOM # CHECK-NEXT: Name: name diff --git a/lld/test/wasm/no-strip-segment.s b/lld/test/wasm/no-strip-segment.s index e70acae296d1a..2b79ed625ea8a 100644 --- a/lld/test/wasm/no-strip-segment.s +++ b/lld/test/wasm/no-strip-segment.s @@ -47,16 +47,16 @@ grab_liba: # "greetings" section # CHECK: - Type: DATA # CHECK: Segments: -# CHECK: - SectionOffset: 7 +# CHECK: - SectionOffset: 8 # CHECK: InitFlags: 0 # CHECK: Offset: # CHECK: Opcode: I32_CONST -# CHECK: Value: 1024 +# CHECK: Value: 65536 # CHECK: Content: 68656C6C6F00776F726C6400 # "weahters" section. -# CHECK: - SectionOffset: 25 +# CHECK: - SectionOffset: 27 # CHECK: InitFlags: 0 # CHECK: Offset: # CHECK: Opcode: I32_CONST -# CHECK: Value: 1036 +# CHECK: Value: 65548 # CHECK: Content: 636C6F75647900 diff --git a/lld/test/wasm/no-tls.s b/lld/test/wasm/no-tls.s index c0786c83ffe70..c082c1ef2dc9f 100644 --- a/lld/test/wasm/no-tls.s +++ b/lld/test/wasm/no-tls.s @@ -28,7 +28,7 @@ _start: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66560 +# CHECK-NEXT: Value: 65536 # __tls_base # CHECK-NEXT: - Index: 1 diff --git a/lld/test/wasm/page-size.s b/lld/test/wasm/page-size.s index a2bf694936476..17850b5b17d30 100644 --- a/lld/test/wasm/page-size.s +++ b/lld/test/wasm/page-size.s @@ -19,7 +19,7 @@ foo: # CHECK-CUSTOM: - Type: MEMORY # CHECK-CUSTOM-NEXT: Memories: # CHECK-CUSTOM-NEXT: - Flags: [ HAS_PAGE_SIZE ] -# CHECK-CUSTOM-NEXT: Minimum: 0x10410 +# CHECK-CUSTOM-NEXT: Minimum: 0x10004 # CHECK-CUSTOM-NEXT: PageSize: 0x1 # RUN: llvm-objdump --disassemble-symbols=_start %t.custom.wasm | FileCheck %s --check-prefix=CHECK-CUSTOM-DIS @@ -51,7 +51,7 @@ foo: # CHECK-CUSTOM-IMPORT-NEXT: Kind: MEMORY # CHECK-CUSTOM-IMPORT-NEXT: Memory: # CHECK-CUSTOM-IMPORT-NEXT: Flags: [ HAS_PAGE_SIZE ] -# CHECK-CUSTOM-IMPORT-NEXT: Minimum: 0x10410 +# CHECK-CUSTOM-IMPORT-NEXT: Minimum: 0x10004 # CHECK-CUSTOM-IMPORT-NEXT: PageSize: 0x1 # RUN: llvm-objdump --disassemble-symbols=_start %t.custom-import.wasm | FileCheck %s --check-prefix=CHECK-CUSTOM-IMPORT-DIS diff --git a/lld/test/wasm/pic-static.ll b/lld/test/wasm/pic-static.ll index 794b7218880b8..12ac4c3a5544e 100644 --- a/lld/test/wasm/pic-static.ll +++ b/lld/test/wasm/pic-static.ll @@ -62,7 +62,7 @@ entry: ; CHECK-NEXT: Mutable: true ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 66576 +; CHECK-NEXT: Value: 65536 ; GOT.func.ret32 ; CHECK-NEXT: - Index: 1 @@ -70,7 +70,7 @@ entry: ; CHECK-NEXT: Mutable: false ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1 +; CHECK-NEXT: Value: 1 ; GOT.func.missing_function ; CHECK-NEXT: - Index: 2 @@ -102,7 +102,7 @@ entry: ; CHECK-NEXT: Mutable: false ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1024 +; CHECK-NEXT: Value: 65536 ; GOT.mem.ret32_ptr ; CHECK-NEXT: - Index: 6 @@ -110,7 +110,7 @@ entry: ; CHECK-NEXT: Mutable: false ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1032 +; CHECK-NEXT: Value: 65544 ; __memory_base ; CHECK-NEXT: - Index: 7 diff --git a/lld/test/wasm/reloc-relative.s b/lld/test/wasm/reloc-relative.s index fde1d1dd08247..5aab061c63a0b 100644 --- a/lld/test/wasm/reloc-relative.s +++ b/lld/test/wasm/reloc-relative.s @@ -50,40 +50,40 @@ far: # CHECK: - Type: DATA # CHECK-NEXT: Segments: -# CHECK-NEXT: - SectionOffset: 7 +# CHECK-NEXT: - SectionOffset: 8 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1024 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: Content: 68656C6C6F0A00 -# CHECK-NEXT: - SectionOffset: 20 +# CHECK-NEXT: - SectionOffset: 22 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1031 +# CHECK-NEXT: Value: 65543 # CHECK-NEXT: Content: 000000002A000000 -# CHECK-NEXT: - SectionOffset: 34 +# CHECK-NEXT: - SectionOffset: 37 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1039 +# CHECK-NEXT: Value: 65551 # CHECK-NEXT: Content: FCFFFFFFFCFFFFFF -# CHECK-NEXT: - SectionOffset: 48 +# CHECK-NEXT: - SectionOffset: 52 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1047 +# CHECK-NEXT: Value: 65559 # CHECK-NEXT: Content: E9FFFFFFE9FFFFFF -# CHECK-NEXT: - SectionOffset: 62 +# CHECK-NEXT: - SectionOffset: 67 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1055 +# CHECK-NEXT: Value: 65567 # CHECK-NEXT: Content: '0800000008000000' -# CHECK-NEXT: - SectionOffset: 76 +# CHECK-NEXT: - SectionOffset: 82 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1063 +# CHECK-NEXT: Value: 65575 # CHECK-NEXT: Content: '15000000' diff --git a/lld/test/wasm/shared-memory-no-atomics.yaml b/lld/test/wasm/shared-memory-no-atomics.yaml index 942c69053a4b2..62f4ac91822de 100644 --- a/lld/test/wasm/shared-memory-no-atomics.yaml +++ b/lld/test/wasm/shared-memory-no-atomics.yaml @@ -55,7 +55,7 @@ Sections: # NO-SHARED: - Type: MEMORY # NO-SHARED-NEXT: Memories: -# NO-SHARED-NEXT: - Minimum: 0x2 +# NO-SHARED-NEXT: - Minimum: 0x1 # NO-SHARED-NOT: Maximum: # SHARED: --shared-memory is disallowed by {{.*}}shared-memory-no-atomics.yaml.tmp1.o because it was not compiled with 'atomics' or 'bulk-memory' features. diff --git a/lld/test/wasm/shared-memory.yaml b/lld/test/wasm/shared-memory.yaml index 4cdbb951eab9c..b3490c8785f00 100644 --- a/lld/test/wasm/shared-memory.yaml +++ b/lld/test/wasm/shared-memory.yaml @@ -1,16 +1,16 @@ # RUN: yaml2obj %s -o %t1.o -# RUN: wasm-ld --no-entry --shared-memory --features=atomics,bulk-memory %t1.o -o - | obj2yaml | FileCheck %s --check-prefix SHARED +# RUN: wasm-ld --no-entry --no-gc-sections --shared-memory --features=atomics,bulk-memory %t1.o -o - | obj2yaml | FileCheck %s --check-prefix SHARED -# RUN: not wasm-ld --no-entry --shared-memory --max-memory=100000 %t1.o -o - 2>&1 | FileCheck %s --check-prefix SHARED-UNALIGNED +# RUN: not wasm-ld --no-entry --no-gc-sections --shared-memory --max-memory=100000 %t1.o -o - 2>&1 | FileCheck %s --check-prefix SHARED-UNALIGNED -# RUN: not wasm-ld --no-entry --shared-memory --max-memory=131072 --features=bulk-memory %t1.o -o - 2>&1 | FileCheck %s --check-prefix SHARED-NO-ATOMICS +# RUN: not wasm-ld --no-entry --no-gc-sections --shared-memory --max-memory=131072 --features=bulk-memory %t1.o -o - 2>&1 | FileCheck %s --check-prefix SHARED-NO-ATOMICS -# RUN: not wasm-ld --no-entry --shared-memory --max-memory=131072 --features=atomics %t1.o -o - 2>&1 | FileCheck %s --check-prefix SHARED-NO-BULK-MEM +# RUN: not wasm-ld --no-entry --no-gc-sections --shared-memory --max-memory=131072 --features=atomics %t1.o -o - 2>&1 | FileCheck %s --check-prefix SHARED-NO-BULK-MEM # RUN: wasm-ld --relocatable --features=atomics %t1.o -o - | obj2yaml | FileCheck %s --check-prefix ATOMICS-RELOCATABLE -# RUN: wasm-ld --no-entry --shared-memory --max-memory=131072 --features=atomics,bulk-memory %t1.o -o - | obj2yaml | FileCheck %s --check-prefix SHARED +# XUN: wasm-ld --no-entry --no-gc-sections --shared-memory --max-memory=131072 --features=atomics,bulk-memory %t1.o -o - | obj2yaml | FileCheck %s --check-prefix SHARED --- !WASM FileHeader: @@ -22,7 +22,7 @@ Sections: Field: __linear_memory Kind: MEMORY Memory: - Minimum: 0x00000001 + Minimum: 0x00000009 - Module: env Field: __indirect_function_table Kind: TABLE diff --git a/lld/test/wasm/stack-first.test b/lld/test/wasm/stack-first.test index 46e8c6ebc2381..91f06a47070a0 100644 --- a/lld/test/wasm/stack-first.test +++ b/lld/test/wasm/stack-first.test @@ -5,16 +5,18 @@ ; Also test that __heap_base is still aligned with the --stack-first option. RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/stack-first.s -o %t.o -RUN: wasm-ld -z stack-size=512 --stack-first --export=__data_end --export=__heap_base --export=someByte -o %t.wasm %t.o + +; Check that the default is `--stack-first` +RUN: wasm-ld -z stack-size=512 --export=__data_end --export=__heap_base --export=someByte -o %t.wasm %t.o RUN: obj2yaml %t.wasm | FileCheck %s ; Check `--no-stack-first` -RUN: wasm-ld -z stack-size=512 --stack-first --no-stack-first --export=__data_end --export=__heap_base --export=someByte -o %t.wasm %t.o +RUN: wasm-ld -z stack-size=512 --no-stack-first --export=__data_end --export=__heap_base --export=someByte -o %t.wasm %t.o RUN: obj2yaml %t.wasm | FileCheck %s --check-prefix=NOT-FIRST -; Check that the default is no-stack-first -RUN: wasm-ld -z stack-size=512 --export=__data_end --export=__heap_base --export=someByte -o %t.wasm %t.o -RUN: obj2yaml %t.wasm | FileCheck %s --check-prefix=NOT-FIRST +; Check `--stack-first` +RUN: wasm-ld -z stack-size=512 --no-stack-first --stack-first --export=__data_end --export=__heap_base --export=someByte -o %t.wasm %t.o +RUN: obj2yaml %t.wasm | FileCheck %s CHECK: - Type: GLOBAL diff --git a/lld/test/wasm/startstop.ll b/lld/test/wasm/startstop.ll index e7a5c80f91f28..c22956f2759e4 100644 --- a/lld/test/wasm/startstop.ll +++ b/lld/test/wasm/startstop.ll @@ -27,19 +27,19 @@ entry: ; CHECK: - Type: DATA ; CHECK-NEXT: Segments: -; CHECK-NEXT: - SectionOffset: 7 +; CHECK-NEXT: - SectionOffset: 8 ; CHECK-NEXT: InitFlags: 0 ; CHECK-NEXT: Offset: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 1024 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: Content: 03000000040000002A0000002B000000 -; ASM: 0000006e : +; ASM: 00000070 : ; ASM-EMPTY: -; ASM-NEXT: 70: i32.const 1024 -; ASM-NEXT: 76: end +; ASM-NEXT: 72: i32.const 65536 +; ASM-NEXT: 78: end -; ASM: 00000077 : +; ASM: 00000079 : ; ASM-EMPTY: -; ASM-NEXT: 79: i32.const 1040 -; ASM-NEXT: 7f: end +; ASM-NEXT: 7b: i32.const 65552 +; ASM-NEXT: 81: end diff --git a/lld/test/wasm/table-base.s b/lld/test/wasm/table-base.s index 56fff414fd31d..92156c49cd538 100644 --- a/lld/test/wasm/table-base.s +++ b/lld/test/wasm/table-base.s @@ -29,7 +29,7 @@ _start: # CHECK-DEFAULT-NEXT: Mutable: true # CHECK-DEFAULT-NEXT: InitExpr: # CHECK-DEFAULT-NEXT: Opcode: I32_CONST -# CHECK-DEFAULT-NEXT: Value: 66560 +# CHECK-DEFAULT-NEXT: Value: 65536 # CHECK-DEFAULT-NEXT: - Index: 1 # CHECK-DEFAULT-NEXT: Type: I32 # CHECK-DEFAULT-NEXT: Mutable: false @@ -58,7 +58,7 @@ _start: # CHECK-100-NEXT: Mutable: true # CHECK-100-NEXT: InitExpr: # CHECK-100-NEXT: Opcode: I32_CONST -# CHECK-100-NEXT: Value: 66560 +# CHECK-100-NEXT: Value: 65536 # CHECK-100-NEXT: - Index: 1 # CHECK-100-NEXT: Type: I32 # CHECK-100-NEXT: Mutable: false diff --git a/lld/test/wasm/tls-align.s b/lld/test/wasm/tls-align.s index 4fd296e1ef7fd..3b51165aea30e 100644 --- a/lld/test/wasm/tls-align.s +++ b/lld/test/wasm/tls-align.s @@ -65,7 +65,7 @@ tls2: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66592 +# CHECK-NEXT: Value: 65536 # __tls_base # CHECK-NEXT: - Index: 1 diff --git a/lld/test/wasm/tls-non-shared-memory-basic.s b/lld/test/wasm/tls-non-shared-memory-basic.s index 8ef0173ba72d7..66ccf8f4f945c 100644 --- a/lld/test/wasm/tls-non-shared-memory-basic.s +++ b/lld/test/wasm/tls-non-shared-memory-basic.s @@ -27,11 +27,11 @@ tls1: # CHECK: - Type: DATA # CHECK-NEXT: Segments: -# CHECK-NEXT: - SectionOffset: 7 +# CHECK-NEXT: - SectionOffset: 8 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1024 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: Content: 2B000000 # CHECK-NEXT: - Type: CUSTOM # CHECK-NOT: - Type: IMPORT diff --git a/lld/test/wasm/tls-non-shared-memory.s b/lld/test/wasm/tls-non-shared-memory.s index 04fbb62228a7e..0d73acb429b18 100644 --- a/lld/test/wasm/tls-non-shared-memory.s +++ b/lld/test/wasm/tls-non-shared-memory.s @@ -63,38 +63,38 @@ tls1: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66576 +# CHECK-NEXT: Value: 65536 # __tls_base # CHECK-NEXT: - Index: 1 # CHECK-NEXT: Type: I32 # CHECK-NEXT: Mutable: false # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1024 +# CHECK-NEXT: Value: 65536 # GOT.data.internal.tls1 # CHECK-NEXT: - Index: 2 # CHECK-NEXT: Type: I32 # CHECK-NEXT: Mutable: false # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1024 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Type: EXPORT # CHECK: - Type: DATA # .data # CHECK-NEXT: Segments: -# CHECK-NEXT: - SectionOffset: 7 +# CHECK-NEXT: - SectionOffset: 8 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1024 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: Content: 2B000000 # .tdata -# CHECK-NEXT: - SectionOffset: 17 +# CHECK-NEXT: - SectionOffset: 19 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1028 +# CHECK-NEXT: Value: 65540 # CHECK-NEXT: Content: 2A000000 # CHECK-NEXT: - Type: CUSTOM diff --git a/lld/test/wasm/tls.s b/lld/test/wasm/tls.s index b1f47f6769927..21f25f5ee7d18 100644 --- a/lld/test/wasm/tls.s +++ b/lld/test/wasm/tls.s @@ -98,7 +98,7 @@ tls3: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66592 +# CHECK-NEXT: Value: 65536 # __tls_base # CHECK-NEXT: - Index: 1 diff --git a/lld/test/wasm/undefined-weak-call.s b/lld/test/wasm/undefined-weak-call.s index 7490104afe516..47775c86f28ea 100644 --- a/lld/test/wasm/undefined-weak-call.s +++ b/lld/test/wasm/undefined-weak-call.s @@ -61,7 +61,7 @@ callWeakFuncs: # CHECK-NEXT: Maximum: 0x1 # CHECK-NEXT: - Type: MEMORY # CHECK-NEXT: Memories: -# CHECK-NEXT: - Minimum: 0x2 +# CHECK-NEXT: - Minimum: 0x1 # CHECK-NEXT: - Type: GLOBAL # CHECK-NEXT: Globals: # CHECK-NEXT: - Index: 0 @@ -69,7 +69,7 @@ callWeakFuncs: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66560 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Type: EXPORT # CHECK-NEXT: Exports: # CHECK-NEXT: - Name: memory diff --git a/lld/test/wasm/weak-alias-overide.ll b/lld/test/wasm/weak-alias-overide.ll index ca6f4bf4230a2..30bf7cf3f9dff 100644 --- a/lld/test/wasm/weak-alias-overide.ll +++ b/lld/test/wasm/weak-alias-overide.ll @@ -44,7 +44,7 @@ entry: ; CHECK-NEXT: Maximum: 0x3 ; CHECK-NEXT: - Type: MEMORY ; CHECK-NEXT: Memories: -; CHECK-NEXT: - Minimum: 0x2 +; CHECK-NEXT: - Minimum: 0x1 ; CHECK-NEXT: - Type: GLOBAL ; CHECK-NEXT: Globals: ; CHECK-NEXT: - Index: 0 @@ -52,7 +52,7 @@ entry: ; CHECK-NEXT: Mutable: true ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 66560 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: - Type: EXPORT ; CHECK-NEXT: Exports: ; CHECK-NEXT: - Name: memory diff --git a/lld/test/wasm/weak-alias.ll b/lld/test/wasm/weak-alias.ll index 1768b8fd5b385..86e42a788b492 100644 --- a/lld/test/wasm/weak-alias.ll +++ b/lld/test/wasm/weak-alias.ll @@ -41,7 +41,7 @@ entry: ; CHECK-NEXT: Maximum: 0x2 ; CHECK-NEXT: - Type: MEMORY ; CHECK-NEXT: Memories: -; CHECK-NEXT: - Minimum: 0x2 +; CHECK-NEXT: - Minimum: 0x1 ; CHECK-NEXT: - Type: GLOBAL ; CHECK-NEXT: Globals: ; CHECK-NEXT: - Index: 0 @@ -49,7 +49,7 @@ entry: ; CHECK-NEXT: Mutable: true ; CHECK-NEXT: InitExpr: ; CHECK-NEXT: Opcode: I32_CONST -; CHECK-NEXT: Value: 66560 +; CHECK-NEXT: Value: 65536 ; CHECK-NEXT: - Type: EXPORT ; CHECK-NEXT: Exports: ; CHECK-NEXT: - Name: memory diff --git a/lld/test/wasm/weak-symbols.s b/lld/test/wasm/weak-symbols.s index 165ec174aaa50..ed85851729b95 100644 --- a/lld/test/wasm/weak-symbols.s +++ b/lld/test/wasm/weak-symbols.s @@ -48,13 +48,13 @@ _start: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66576 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Index: 1 # CHECK-NEXT: Type: I32 # CHECK-NEXT: Mutable: false # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1024 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Type: EXPORT # CHECK-NEXT: Exports: # CHECK-NEXT: - Name: memory @@ -97,11 +97,11 @@ _start: # CHECK-NEXT: Body: 4181808080000B # CHECK-NEXT: - Type: DATA # CHECK-NEXT: Segments: -# CHECK-NEXT: - SectionOffset: 7 +# CHECK-NEXT: - SectionOffset: 8 # CHECK-NEXT: InitFlags: 0 # CHECK-NEXT: Offset: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 1024 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: Content: '01000000' # CHECK-NEXT: - Type: CUSTOM # CHECK-NEXT: Name: name diff --git a/lld/test/wasm/weak-undefined-pic.s b/lld/test/wasm/weak-undefined-pic.s index 5937380ee4e96..1a3a1715b4bb9 100644 --- a/lld/test/wasm/weak-undefined-pic.s +++ b/lld/test/wasm/weak-undefined-pic.s @@ -45,7 +45,7 @@ _start: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66560 +# CHECK-NEXT: Value: 65536 # Global 'undefined_weak:foo' representing the GOT entry for foo # Unlike other internal GOT entries that need to be mutable this one # is immutable and not updated by `__wasm_apply_global_relocs` diff --git a/lld/test/wasm/weak-undefined.s b/lld/test/wasm/weak-undefined.s index e1f551d6d30b6..558cac527d702 100644 --- a/lld/test/wasm/weak-undefined.s +++ b/lld/test/wasm/weak-undefined.s @@ -67,7 +67,7 @@ _start: # CHECK-NEXT: Maximum: 0x1 # CHECK-NEXT: - Type: MEMORY # CHECK-NEXT: Memories: -# CHECK-NEXT: - Minimum: 0x2 +# CHECK-NEXT: - Minimum: 0x1 # CHECK-NEXT: - Type: GLOBAL # CHECK-NEXT: Globals: # CHECK-NEXT: - Index: 0 @@ -75,7 +75,7 @@ _start: # CHECK-NEXT: Mutable: true # CHECK-NEXT: InitExpr: # CHECK-NEXT: Opcode: I32_CONST -# CHECK-NEXT: Value: 66560 +# CHECK-NEXT: Value: 65536 # CHECK-NEXT: - Type: EXPORT # CHECK-NEXT: Exports: # CHECK-NEXT: - Name: memory diff --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp index aad8095881bba..fac166587cb9b 100644 --- a/lld/wasm/Driver.cpp +++ b/lld/wasm/Driver.cpp @@ -595,7 +595,7 @@ static void readConfigs(opt::InputArgList &args) { ctx.arg.shlibSigCheck = !args.hasArg(OPT_no_shlib_sigcheck); ctx.arg.stripAll = args.hasArg(OPT_strip_all); ctx.arg.stripDebug = args.hasArg(OPT_strip_debug); - ctx.arg.stackFirst = args.hasFlag(OPT_stack_first, OPT_no_stack_first, false); + ctx.arg.stackFirst = args.hasFlag(OPT_stack_first, OPT_no_stack_first, true); ctx.arg.trace = args.hasArg(OPT_trace); ctx.arg.thinLTOCacheDir = args.getLastArgValue(OPT_thinlto_cache_dir); ctx.arg.thinLTOCachePolicy = CHECK( diff --git a/lld/wasm/Options.td b/lld/wasm/Options.td index 0ed69258d99aa..33ecf03176d36 100644 --- a/lld/wasm/Options.td +++ b/lld/wasm/Options.td @@ -251,8 +251,8 @@ def no_shlib_sigcheck: FF<"no-shlib-sigcheck">, HelpText<"Do not check signatures of functions defined in shared libraries.">; defm stack_first: B<"stack-first", - "Place stack at start of linear memory", - "Place the stack after static data refion (default)">; + "Place stack at start of linear memory (default)", + "Place the stack after static data region">; def table_base: JJ<"table-base=">, HelpText<"Table offset at which to place address taken functions (Defaults to 1)">;