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 | */ |
| 5 | |
| 6 | /** |
| 7 | * These two symbols are declared in a C file so that the linker |
| 8 | * uses R_ARM_RELATIVE relocation, rather than the R_ARM_ABS32 one |
| 9 | * it would use if the symbols were defined in the linker file. |
| 10 | * Using only R_ARM_RELATIVE relocation ensures that references to |
| 11 | * the symbols are correct after as well as before relocation. |
| 12 | * |
| 13 | * We need a 0-byte-size type for these symbols, and the compiler |
| 14 | * does not allow defining objects of C type 'void'. Using an empty |
| 15 | * struct is allowed by the compiler, but causes gcc versions 4.4 and |
| 16 | * below to complain about aliasing. Therefore we use the next best |
| 17 | * thing: zero-sized arrays, which are both 0-byte-size and exempt from |
| 18 | * aliasing warnings. |
| 19 | */ |
| 20 | |
Albert ARIBAUD | 800ea3e | 2013-06-11 14:17:32 +0200 | [diff] [blame] | 21 | char __bss_start[0] __attribute__((section(".__bss_start"))); |
| 22 | char __bss_end[0] __attribute__((section(".__bss_end"))); |
Albert ARIBAUD | c53687e | 2013-06-11 14:17:33 +0200 | [diff] [blame] | 23 | char __image_copy_start[0] __attribute__((section(".__image_copy_start"))); |
| 24 | char __image_copy_end[0] __attribute__((section(".__image_copy_end"))); |
Albert ARIBAUD | af3ff16 | 2013-06-11 14:17:34 +0200 | [diff] [blame] | 25 | char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start"))); |
| 26 | char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end"))); |
Marc Zyngier | c0451ec | 2014-07-12 14:24:02 +0100 | [diff] [blame] | 27 | char __secure_start[0] __attribute__((section(".__secure_start"))); |
| 28 | char __secure_end[0] __attribute__((section(".__secure_end"))); |
Chen-Yu Tsai | a00f85d | 2016-06-19 12:38:36 +0800 | [diff] [blame] | 29 | char __secure_stack_start[0] __attribute__((section(".__secure_stack_start"))); |
| 30 | char __secure_stack_end[0] __attribute__((section(".__secure_stack_end"))); |
Alexander Graf | 0bd425a | 2016-03-04 01:10:01 +0100 | [diff] [blame] | 31 | char __efi_runtime_start[0] __attribute__((section(".__efi_runtime_start"))); |
| 32 | char __efi_runtime_stop[0] __attribute__((section(".__efi_runtime_stop"))); |
| 33 | char __efi_runtime_rel_start[0] __attribute__((section(".__efi_runtime_rel_start"))); |
| 34 | char __efi_runtime_rel_stop[0] __attribute__((section(".__efi_runtime_rel_stop"))); |
Albert ARIBAUD | 9d25fa4 | 2014-02-22 17:53:42 +0100 | [diff] [blame] | 35 | char _end[0] __attribute__((section(".__end"))); |