2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
4 ## Check that _DYNAMIC symbol is created when creating dynamic output,
5 ## and has hidden visibility and address equal to .dynamic section.
6 # RUN: ld.lld -shared %t.o -o %t.so
7 # RUN: llvm-readobj --sections --symbols %t.so | FileCheck %s
8 # RUN: ld.lld -pie %t.o -o %t
9 # RUN: llvm-readobj --sections --symbols %t | FileCheck %s
13 # CHECK: Name: .dynamic
14 # CHECK-NEXT: Type: SHT_DYNAMIC
16 # CHECK-NEXT: SHF_ALLOC
17 # CHECK-NEXT: SHF_WRITE
19 # CHECK-NEXT: Address: 0x[[ADDR:.*]]
22 # CHECK: Name: _DYNAMIC
23 # CHECK-NEXT: Value: 0x[[ADDR]]
25 # CHECK-NEXT: Binding: Local
26 # CHECK-NEXT: Type: None
27 # CHECK-NEXT: Other [ (0x2)
28 # CHECK-NEXT: STV_HIDDEN
30 # CHECK-NEXT: Section: .dynamic
33 # RUN: ld.lld %t.o -o %t2
34 # RUN: llvm-readobj --sections --symbols %t2 | FileCheck /dev/null --implicit-check-not=_DYNAMIC