43 lines · plain
1# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s2 3## A GNU version script is accepted on wasm. Symbol versioning is collapsed on4## wasm, so the version *tags* are ignored, but the global:/local: export5## visibility is honored: `local:`-matched symbols are hidden (not exported),6## `global:`-matched symbols keep their default export visibility.7 8# RUN: echo 'GLIBC_2.43 { global: foo; local: *; };' > %t.script9 10## Baseline: with -shared and default visibility, both foo and bar are exported.11# RUN: wasm-ld -shared --experimental-pic -o %t.base.wasm %t.o12# RUN: obj2yaml %t.base.wasm | FileCheck %s --check-prefix=BASE13# BASE-DAG: Name: foo14# BASE-DAG: Name: bar15 16## With the version script, foo (global:) is exported and bar (local: *;) is17## hidden -- a genuine, observable filtering flip.18# RUN: wasm-ld -shared --experimental-pic --version-script=%t.script -o %t.wasm %t.o19# RUN: obj2yaml %t.wasm | FileCheck %s --check-prefix=FILTER20# FILTER: Exports:21# FILTER: Name: foo22# FILTER-NOT: Name: bar23 24## The separate-argument form is also accepted.25# RUN: wasm-ld -shared --experimental-pic --version-script %t.script -o %t2.wasm %t.o26 27## -z relro and -z defs are accepted without an "unknown -z value" warning.28# RUN: wasm-ld -shared --experimental-pic -z relro -z defs \29# RUN: --version-script=%t.script -o %t3.wasm %t.o 2>&1 \30# RUN: | FileCheck %s --check-prefix=ZFLAGS --allow-empty31# ZFLAGS-NOT: unknown -z value32 33.globl foo34.globl bar35 36foo:37 .functype foo () -> ()38 end_function39 40bar:41 .functype bar () -> ()42 end_function43