Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Albert ARIBAUD | 436f632 | 2013-02-25 00:58:59 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2013 Albert ARIBAUD <albert.u.boot@aribaud.net> |
Albert ARIBAUD | 436f632 | 2013-02-25 00:58:59 +0000 | [diff] [blame] | 4 | */ |
Marek Behún | 4bebdd3 | 2021-05-20 13:23:52 +0200 | [diff] [blame] | 5 | #include <linux/compiler.h> |
Albert ARIBAUD | 436f632 | 2013-02-25 00:58:59 +0000 | [diff] [blame] | 6 | |
| 7 | /** |
| 8 | * These two symbols are declared in a C file so that the linker |
| 9 | * uses R_ARM_RELATIVE relocation, rather than the R_ARM_ABS32 one |
| 10 | * it would use if the symbols were defined in the linker file. |
| 11 | * Using only R_ARM_RELATIVE relocation ensures that references to |
| 12 | * the symbols are correct after as well as before relocation. |
| 13 | * |
| 14 | * We need a 0-byte-size type for these symbols, and the compiler |
| 15 | * does not allow defining objects of C type 'void'. Using an empty |
| 16 | * struct is allowed by the compiler, but causes gcc versions 4.4 and |
| 17 | * below to complain about aliasing. Therefore we use the next best |
| 18 | * thing: zero-sized arrays, which are both 0-byte-size and exempt from |
| 19 | * aliasing warnings. |
| 20 | */ |
| 21 | |
Marek Behún | 4bebdd3 | 2021-05-20 13:23:52 +0200 | [diff] [blame] | 22 | char __secure_start[0] __section(".__secure_start"); |
| 23 | char __secure_end[0] __section(".__secure_end"); |
| 24 | char __secure_stack_start[0] __section(".__secure_stack_start"); |
| 25 | char __secure_stack_end[0] __section(".__secure_stack_end"); |
Marek Behún | 4bebdd3 | 2021-05-20 13:23:52 +0200 | [diff] [blame] | 26 | char _end[0] __section(".__end"); |