1 # Tests that the dynamic variables created by the linker are set to the right
4 #RUN: yaml2obj --format elf -docnum 1 %s -o %t.o
5 #RUN: lld -flavor gnu -target x86_64 -e main %t.o -o %t1 --noinhibit-exec
6 #RUN: llvm-readobj -sections -symbols %t1 | FileCheck -check-prefix CHECKSYMS %s
9 #CHECKSYMS: Name: .dynamic
10 #CHECKSYMS: Type: SHT_DYNAMIC
11 #CHECKSYMS: Address: [[TARGETA:[0xa-fA-f0-9]+]]
12 #CHECKSYMS: Name: .got.plt
13 #CHECKSYMS: Type: SHT_PROGBITS
14 #CHECKSYMS: Address: [[TARGETB:[0xa-fA-f0-9]+]]
15 #CHECKSYMS: Name: _DYNAMIC
16 #CHECKSYMS: Value: [[TARGETA]]
17 #CHECKSYMS: Section: .dynamic
18 #CHECKSYMS: Name: _GLOBAL_OFFSET_TABLE_
19 #CHECKSYMS: Value: [[TARGETB]]
20 #CHECKSYMS: Section: .got.plt
32 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
33 AddressAlign: 0x0000000000000010
34 Content: 554889E54883EC10488B0500000000C745FC00000000C7000A000000E80000000031C98945F889C84883C4105DC36690554889E531C05DC3
38 AddressAlign: 0x0000000000000008
41 - Offset: 0x000000000000000B
43 Type: R_X86_64_GOTPCREL
45 - Offset: 0x000000000000001D
51 Flags: [ SHF_WRITE, SHF_ALLOC ]
52 AddressAlign: 0x0000000000000004
56 Flags: [ SHF_WRITE, SHF_ALLOC ]
57 AddressAlign: 0x0000000000000004
61 Flags: [ SHF_MERGE, SHF_STRINGS ]
62 AddressAlign: 0x0000000000000001
63 Content: 00636C616E672076657273696F6E20332E362E302000
64 - Name: .note.GNU-stack
66 AddressAlign: 0x0000000000000001
71 AddressAlign: 0x0000000000000008
72 Content: 1400000000000000037A5200017810011B0C070890010000180000001C000000000000002E00000000410E108602430D060000001800000038000000000000000800000000410E108602430D06000000
73 - Name: .rela.eh_frame
76 AddressAlign: 0x0000000000000008
79 - Offset: 0x0000000000000020
83 - Offset: 0x000000000000003C
103 - Name: .note.GNU-stack
105 Section: .note.GNU-stack
112 Value: 0x0000000000000004
113 Size: 0x0000000000000004
117 Value: 0x0000000000000030
118 Size: 0x0000000000000008
122 Size: 0x000000000000002E
123 - Name: _GLOBAL_OFFSET_TABLE_