Files
clang-p2996/lld/test/wasm/emit-relocs-fpic.s
Sam Clegg 04febd30a8 [lld][WebAssembly] Error on import/export of mutable global without mutable-globals feature
Also add the +mutable-globals features in clang when
building with `-fPIC` since the linker will generate mutable
globals imports and exports in that case.

Differential Revision: https://reviews.llvm.org/D87537
2020-09-12 14:28:14 -07:00

21 lines
806 B
ArmAsm

# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %s -o %t.o
# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/ret32.s -o %t.ret32.o
# RUN: wasm-ld -pie --export-all --no-check-features --no-gc-sections --no-entry --emit-relocs -o %t.wasm %t.o %t.ret32.o
# RUN: obj2yaml %t.wasm | FileCheck %s
load_hidden_data:
.functype load_hidden_data () -> (i32)
i32.const .L.hidden_data@MBREL
end_function
.section .rodata.hidden_data,"",@
.L.hidden_data:
.int8 100
.size .L.hidden_data, 1
# We just want to make sure that processing this relocation doesn't
# cause corrupt output. We get most of the way there, by just checking
# that obj2yaml doesn't fail. Here we just make sure that the relocation
# survived the trip.
# CHECK: R_WASM_MEMORY_ADDR_REL_SLEB