80 lines · plain
1## Based on lld/test/ELF/shared-lazy.s2 3# RUN: rm -rf %t && split-file %s %t && cd %t4# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-emscripten a.s -o a.o5# RUN: wasm-ld a.o --experimental-pic -shared -o a.so6# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-emscripten b.s -o b.o7# RUN: wasm-ld b.o --experimental-pic -shared -o b.so8# RUN: llvm-ar rc a.a a.o9# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-emscripten ref.s -o ref.o10# RUN: wasm-ld a.a b.so ref.o --experimental-pic -shared -o 1.so11# RUN: obj2yaml 1.so | FileCheck %s12# RUN: wasm-ld a.so a.a ref.o --experimental-pic -shared -o 1.so13# RUN: obj2yaml 1.so | FileCheck %s14 15## The definitions from a.so are used and we don't extract a member from the16## archive.17 18# CHECK: - Type: IMPORT19# CHECK: - Module: GOT.mem20# CHECK-NEXT: Field: x121# CHECK-NEXT: Kind: GLOBAL22# CHECK-NEXT: GlobalType: I3223# CHECK-NEXT: GlobalMutable: true24# CHECK-NEXT: - Module: GOT.mem25# CHECK-NEXT: Field: x226# CHECK-NEXT: Kind: GLOBAL27# CHECK-NEXT: GlobalType: I3228# CHECK-NEXT: GlobalMutable: true29 30## The extracted x1 is defined as STB_GLOBAL.31# RUN: wasm-ld ref.o a.a b.so -o 2.so --experimental-pic -shared32# RUN: obj2yaml 2.so | FileCheck %s --check-prefix=CHECK233# RUN: wasm-ld a.a ref.o b.so -o 2.so --experimental-pic -shared34# RUN: obj2yaml 2.so | FileCheck %s --check-prefix=CHECK235 36# CHECK2: - Type: EXPORT37# CHECK2-NEXT: Exports:38# CHECK2-NEXT: - Name: __wasm_call_ctors39# CHECK2-NEXT: Kind: FUNCTION40# CHECK2-NEXT: Index:41# CHECK2-NEXT: - Name: x142# CHECK2-NEXT: Kind: GLOBAL43# CHECK2-NEXT: Index:44# CHECK2-NEXT: - Name: x245# CHECK2-NEXT: Kind: GLOBAL46 47#--- a.s48.section .data.x1,"",@49.global x150x1:51 .byte 052.size x1, 153 54.section .data.x2,"",@55.weak x256x2:57 .byte 058.size x2, 159#--- b.s60.section .data.x1,"",@61.globl x162x1:63 .byte 064.size x1, 165 66.section .data.x2,"",@67.globl x268x2:69 .byte 070.size x2, 171#--- ref.s72.globl x173.globl x274.globl d75.section .data.d,"",@76d:77 .int x178 .int x279.size d, 880