[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / export-symbols.s
blob93c93c9678519bdfbecedd4c9cbff6e44e38e865
1 # REQUIRES: x86
2 ## Verify that the arguments --export-dynamic and --dynamic-list
3 ## put the correct symbols in the dynamic symbol table.
5 # RUN: echo "{ *; };" > %t.list
7 # RUN: echo ".globl shared" > %t.s ; echo "shared = 0xDEADBEEF" >> %t.s
9 # RUN: llvm-mc -filetype=obj -triple=x86_64 %t.s -o %t-shared.o
10 # RUN: ld.lld --shared %t-shared.o -o %t.so
12 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
13 ## Use --fatal-warnings to confirm no diagnostics are emitted.
14 # RUN: ld.lld --fatal-warnings --defsym=defsym=_start %t.so %t.o -o %t.out
15 # RUN: ld.lld --fatal-warnings --defsym=defsym=_start %t.so %t.o -o %texport.out --export-dynamic
16 # RUN: ld.lld --fatal-warnings --defsym=defsym=_start %t.so %t.o -o %tlist.out --dynamic-list %t.list
18 # RUN: llvm-readelf --dyn-syms %t.out | FileCheck %s --check-prefix=NO-EXPORT
19 # RUN: llvm-readelf --dyn-syms %texport.out | FileCheck %s --check-prefix=EXPORT
20 # RUN: llvm-readelf --dyn-syms %tlist.out | FileCheck %s --check-prefix=EXPORT
22 # NO-EXPORT: Symbol table '.dynsym' contains 3 entries:
23 # NO-EXPORT: GLOBAL DEFAULT {{.*}} shared
24 # NO-EXPORT-NEXT: WEAK DEFAULT {{.*}} undef_weak
26 # EXPORT: Symbol table '.dynsym' contains 8 entries:
27 # EXPORT: GLOBAL DEFAULT {{.*}} shared
28 # EXPORT-NEXT: WEAK DEFAULT {{.*}} undef_weak
29 # EXPORT-NEXT: WEAK DEFAULT {{.*}} weak_default
30 # EXPORT-NEXT: GLOBAL DEFAULT {{.*}} common
31 # EXPORT-NEXT: GLOBAL DEFAULT ABS abs
32 # EXPORT-NEXT: GLOBAL PROTECTED {{.*}} _start
33 # EXPORT-NEXT: GLOBAL DEFAULT {{.*}} defsym
35 ## --no-export-dynamic can cancel previous --export-dynamic.
36 # RUN: ld.lld --fatal-warnings --defsym=defsym=_start %t.so %t.o -o - --export-dynamic --no-export-dynamic | cmp %t.out -
38 .weak undef_weak
40 .weak weak_default
41 weak_default:
43 .weak weak_internal
44 .internal weak_internal
45 weak_internal:
47 .weak weak_hidden
48 .internal weak_hidden
49 weak_hidden:
51 .weak weak_protected
52 .internal weak_protected
53 weak_protected:
55 .globl shared
57 .local local
58 local:
60 .comm common, 10
62 .globl abs
63 abs = 0xDEADBEEF
65 .globl hidden
66 .hidden hidden
67 hidden:
69 .globl _start
70 .protected _start
71 _start: