annotate lld/test/ELF/weak-undef-shared.s @ 192:d7606dcf6fce

Added tag llvm10 for changeset 0572611fdcc8
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 14 Dec 2020 18:01:34 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 # REQUIRES: x86
anatofuz
parents:
diff changeset
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
anatofuz
parents:
diff changeset
3 # RUN: ld.lld -shared %t.o -o %t.so
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 # RUN: echo '.data; .weak foo; .quad foo' | llvm-mc -filetype=obj -triple=x86_64 - -o %t1.o
anatofuz
parents:
diff changeset
6 # RUN: echo '.data; .quad foo' | llvm-mc -filetype=obj -triple=x86_64 - -o %t2.o
anatofuz
parents:
diff changeset
7 # RUN: ld.lld -shared %t2.o -o %t2.so
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 ## If the first undefined reference is weak, the binding changes to
anatofuz
parents:
diff changeset
10 ## STB_WEAK.
anatofuz
parents:
diff changeset
11 # RUN: ld.lld %t1.o %t.so -o %t
anatofuz
parents:
diff changeset
12 # RUN: llvm-readelf --dyn-syms %t | FileCheck --check-prefix=WEAK %s
anatofuz
parents:
diff changeset
13 # RUN: ld.lld %t.so %t1.o -o %t
anatofuz
parents:
diff changeset
14 # RUN: llvm-readelf --dyn-syms %t | FileCheck --check-prefix=WEAK %s
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 ## The binding remains STB_WEAK if there is no STB_GLOBAL undefined reference.
anatofuz
parents:
diff changeset
17 # RUN: ld.lld %t1.o %t.so %t1.o -o %t
anatofuz
parents:
diff changeset
18 # RUN: llvm-readelf --dyn-syms %t | FileCheck --check-prefix=WEAK %s
anatofuz
parents:
diff changeset
19 # RUN: ld.lld %t.so %t1.o %t1.o -o %t
anatofuz
parents:
diff changeset
20 # RUN: llvm-readelf --dyn-syms %t | FileCheck --check-prefix=WEAK %s
anatofuz
parents:
diff changeset
21
anatofuz
parents:
diff changeset
22 ## The binding changes back to STB_GLOBAL if there is a STB_GLOBAL undefined reference.
anatofuz
parents:
diff changeset
23 # RUN: ld.lld %t1.o %t.so %t2.o -o %t
anatofuz
parents:
diff changeset
24 # RUN: llvm-readelf --dyn-syms %t | FileCheck --check-prefix=GLOBAL %s
anatofuz
parents:
diff changeset
25 # RUN: ld.lld %t2.o %t.so %t1.o -o %t
anatofuz
parents:
diff changeset
26 # RUN: llvm-readelf --dyn-syms %t | FileCheck --check-prefix=GLOBAL %s
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 ## Check the binding (weak) is not affected by the STB_GLOBAL undefined
anatofuz
parents:
diff changeset
29 ## reference in %t2.so
anatofuz
parents:
diff changeset
30 # RUN: ld.lld %t1.o %t2.so -o %t
anatofuz
parents:
diff changeset
31 # RUN: llvm-readelf --dyn-syms %t | FileCheck --check-prefix=WEAK %s
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 # RUN: ld.lld %t2.so %t1.o -o %t
anatofuz
parents:
diff changeset
34 # RUN: llvm-readelf --dyn-syms %t | FileCheck --check-prefix=WEAK %s
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 # WEAK: NOTYPE WEAK DEFAULT UND foo
anatofuz
parents:
diff changeset
37 # GLOBAL: NOTYPE GLOBAL DEFAULT UND foo
anatofuz
parents:
diff changeset
38
anatofuz
parents:
diff changeset
39 .globl foo
anatofuz
parents:
diff changeset
40 foo: