Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / global-offset-table-position.s
blobbbb517e09f8c67dc1e098482f801497334898834
1 // REQUIRES: x86
2 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
3 // RUN: ld.lld -shared %t -o %t2
4 // RUN: llvm-readobj -S --symbols %t2 | FileCheck %s
6 // The X86_64 _GLOBAL_OFFSET_TABLE_ is defined at the start of the .got.plt
7 // section.
8 .globl a
9 .type a,@object
10 .comm a,4,4
12 .globl f
13 .type f,@function
15 movq a@GOTPCREL(%rip), %rax
17 .global _start
18 .type _start,@function
19 _start:
20 callq f@PLT
21 .data
22 .long _GLOBAL_OFFSET_TABLE_ - .
24 // CHECK: Name: .got.plt
25 // CHECK: Address: [[ADDR:.*]]
26 // CHECK: Name: _GLOBAL_OFFSET_TABLE_
27 // CHECK-NEXT: Value: [[ADDR]]
28 // CHECK-NEXT: Size: 0
29 // CHECK-NEXT: Binding: Local
30 // CHECK-NEXT: Type: None (0x0)
31 // CHECK-NEXT: Other [
32 // CHECK-NEXT: STV_HIDDEN
33 // CHECK-NEXT: ]
34 // CHECK-NEXT: Section: .got.plt