]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/global-offset-table-position-i386.s
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / global-offset-table-position-i386.s
1 // REQUIRES: x86
2 // RUN: llvm-mc -filetype=obj -triple=i386-pc-linux %s -o %t
3 // RUN: ld.lld --hash-style=sysv -shared %t -o %t2
4 // RUN: llvm-readobj -t %t2 | FileCheck %s
5
6 // The X86 _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
11
12 .globl  f
13 .type   f,@function
14 f:
15 addl    $_GLOBAL_OFFSET_TABLE_, %eax
16 movl    a@GOT(%eax), %eax
17
18 .global _start
19 .type _start,@function
20 _start:
21 addl    $_GLOBAL_OFFSET_TABLE_, %eax
22 calll   f@PLT
23
24 // CHECK:     Name: _GLOBAL_OFFSET_TABLE_ (1)
25 // CHECK-NEXT:     Value: 0x2000
26 // CHECK-NEXT:     Size: 0
27 // CHECK-NEXT:     Binding: Local (0x0)
28 // CHECK-NEXT:     Type: None (0x0)
29 // CHECK-NEXT:     Other [ (0x2)
30 // CHECK-NEXT:       STV_HIDDEN (0x2)
31 // CHECK-NEXT:     ]
32 // CHECK-NEXT:     Section: .got.plt