1/* tls.s Test file for AArch64 TLS relocations.
2
3   Copyright (C) 2011-2016 Free Software Foundation, Inc.
4   Contributed by ARM Ltd.
5
6   This file is part of GAS.
7
8   GAS is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 3 of the license, or
11   (at your option) any later version.
12
13   GAS is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18   You should have received a copy of the GNU General Public License
19   along with this program; see the file COPYING3. If not,
20   see <http://www.gnu.org/licenses/>.  */
21
22func:
23
24	// R_AARCH64_TLSDESC_ADR_PAGE21  var
25	adrp  x0, :tlsdesc:var
26	// R_AARCH64_TLSDESC_LD64_LO12 var
27	ldr   x1, [x0, #:tlsdesc_lo12:var]
28	// R_AARCH64_TLSDESC_ADD_LO12  var
29	add   x0, x0, #:tlsdesc_lo12:var
30	// R_AARCH64_TLSDESC_CALL      var
31	.tlsdesccall var
32	blr   x1
33
34	// R_AARCH64_TLSGD_ADR_PAGE21         var
35	adrp x0, :tlsgd:var
36	// R_AARCH64_TLSGD_ADD_LO12_NC        var
37	add  x0, x0, #:tlsgd_lo12:var
38	// R_AARCH64_CALL26
39	bl   __tls_get_addr
40
41	// R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 var
42	adrp x0, :gottprel:var
43	// R_AARCH64_TLSUE_GOTTPREL_LO12_NC    var
44	ldr  x0, [x0, #:gottprel_lo12:var]
45
46	// R_AARCH64_TLSLE_ADD_TPREL_LO12       var
47	add  x0, x1, #:tprel_lo12:var
48	// R_AARCH64_TLSLE_ADD_TPREL_HI12       var
49	add  x0, x1, #:tprel_hi12:var
50	// R_AARCH64_TLSLE_ADD_TPREL_HI12       var
51	add  x0, x1, #:tprel_hi12:var, lsl #12
52	// R_AARCH64_TLSLE_ADD_TPREL_LO12_NC    var
53	add  x0, x1, #:tprel_lo12_nc:var
54
55	movz x0, #:tprel_g1:var
56	movk x0, #:tprel_g0_nc:var
57