blob: 25a2a9b479c2f052174f9af5b26bb213ff35fac0 [file] [log] [blame]
Kees Cook90776dd2019-08-13 16:04:50 -07001/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Linker script variables to be set after section resolution, as
4 * ld.lld does not like variables assigned before SECTIONS is processed.
5 */
6#ifndef __ARM64_KERNEL_IMAGE_VARS_H
7#define __ARM64_KERNEL_IMAGE_VARS_H
8
9#ifndef LINKER_SCRIPT
10#error This file should only be included in vmlinux.lds.S
11#endif
12
13#ifdef CONFIG_EFI
14
15__efistub_stext_offset = stext - _text;
16
17/*
18 * The EFI stub has its own symbol namespace prefixed by __efistub_, to
19 * isolate it from the kernel proper. The following symbols are legally
20 * accessed by the stub, so provide some aliases to make them accessible.
21 * Only include data symbols here, or text symbols of functions that are
22 * guaranteed to be safe when executed at another offset than they were
23 * linked at. The routines below are all implemented in assembler in a
24 * position independent manner
25 */
26__efistub_memcmp = __pi_memcmp;
27__efistub_memchr = __pi_memchr;
28__efistub_memcpy = __pi_memcpy;
29__efistub_memmove = __pi_memmove;
30__efistub_memset = __pi_memset;
31__efistub_strlen = __pi_strlen;
32__efistub_strnlen = __pi_strnlen;
33__efistub_strcmp = __pi_strcmp;
34__efistub_strncmp = __pi_strncmp;
35__efistub_strrchr = __pi_strrchr;
36__efistub___flush_dcache_area = __pi___flush_dcache_area;
37
38#ifdef CONFIG_KASAN
39__efistub___memcpy = __pi_memcpy;
40__efistub___memmove = __pi_memmove;
41__efistub___memset = __pi_memset;
42#endif
43
44__efistub__text = _text;
45__efistub__end = _end;
46__efistub__edata = _edata;
47__efistub_screen_info = screen_info;
48
49#endif
50
51#endif /* __ARM64_KERNEL_IMAGE_VARS_H */