[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / weak-undef-lib.s
blob19b59fddaa72313c9a293c4ec2c636edcfeb1cf4
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
3 # RUN: echo -e '.globl foo\nfoo: ret' | \
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux - -o %t2.o
6 # RUN: ld.lld -shared -o %t.so %t1.o --start-lib %t2.o
7 # RUN: llvm-readobj --dyn-syms %t.so | FileCheck %s
9 # RUN: ld.lld -pie -o %t %t1.o --start-lib %t2.o
10 # RUN: llvm-readobj --dyn-syms %t | FileCheck %s
12 # CHECK: Name: foo
13 # CHECK-NEXT: Value: 0x0
14 # CHECK-NEXT: Size: 0
15 # CHECK-NEXT: Binding: Weak
16 # CHECK-NEXT: Type: None
17 # CHECK-NEXT: Other: 0
18 # CHECK-NEXT: Section: Undefined
20 ## -u specifies a STB_DEFAULT undefined symbol, so the definition from %t2.o is
21 ## fetched.
22 # RUN: ld.lld -u foo %t1.o --start-lib %t2.o -o %t1
23 # RUN: llvm-readobj --syms %t1 | FileCheck %s --check-prefix=CHECK-U
25 # CHECK-U: Name: foo
26 # CHECK-U: Binding:
27 # CHECK-U-SAME: Global
28 # CHECK-U: Section:
29 # CHECK-U-SAME: .text
31 .weak foo
32 call foo@PLT
34 .data
35 .quad foo