summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/reloc_test_syms.S
blob: e1edcefeb02d5d7086d00f2ac8ce74dfb12da546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
 * Copyright (C) 2017 Linaro, Ltd. <ard.biesheuvel@linaro.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 */

#include <linux/linkage.h>

ENTRY(absolute_data64)
	ldr	x0, 0f
	ret
0:	.quad	sym64_abs
ENDPROC(absolute_data64)

ENTRY(absolute_data32)
	ldr	w0, 0f
	ret
0:	.long	sym32_abs
ENDPROC(absolute_data32)

ENTRY(absolute_data16)
	adr	x0, 0f
	ldrh	w0, [x0]
	ret
0:	.short	sym16_abs, 0
ENDPROC(absolute_data16)

ENTRY(signed_movw)
	movz	x0, #:abs_g2_s:sym64_abs
	movk	x0, #:abs_g1_nc:sym64_abs
	movk	x0, #:abs_g0_nc:sym64_abs
	ret
ENDPROC(signed_movw)

ENTRY(unsigned_movw)
	movz	x0, #:abs_g3:sym64_abs
	movk	x0, #:abs_g2_nc:sym64_abs
	movk	x0, #:abs_g1_nc:sym64_abs
	movk	x0, #:abs_g0_nc:sym64_abs
	ret
ENDPROC(unsigned_movw)

#ifndef CONFIG_ARM64_ERRATUM_843419

ENTRY(relative_adrp)
	adrp	x0, sym64_rel
	add	x0, x0, #:lo12:sym64_rel
	ret
ENDPROC(relative_adrp)

#endif

ENTRY(relative_adr)
	adr	x0, sym64_rel
	ret
ENDPROC(relative_adr)

ENTRY(relative_data64)
	adr	x1, 0f
	ldr	x0, [x1]
	add	x0, x0, x1
	ret
0:	.quad	sym64_rel - .
ENDPROC(relative_data64)

ENTRY(relative_data32)
	adr	x1, 0f
	ldr	w0, [x1]
	add	x0, x0, x1
	ret
0:	.long	sym64_rel - .
ENDPROC(relative_data32)

ENTRY(relative_data16)
	adr	x1, 0f
	ldrsh	w0, [x1]
	add	x0, x0, x1
	ret
0:	.short	sym64_rel - ., 0
ENDPROC(relative_data16)