Albert ARIBAUD | 3ebd1cb | 2013-02-25 00:58:59 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Albert ARIBAUD <albert.u.boot@aribaud.net> |
| 3 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Albert ARIBAUD | 3ebd1cb | 2013-02-25 00:58:59 +0000 | [diff] [blame] | 5 | */ |
| 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 | |
Albert ARIBAUD | df84502 | 2013-06-11 14:17:32 +0200 | [diff] [blame] | 22 | char __bss_start[0] __attribute__((section(".__bss_start"))); |
| 23 | char __bss_end[0] __attribute__((section(".__bss_end"))); |
Albert ARIBAUD | d026dec | 2013-06-11 14:17:33 +0200 | [diff] [blame] | 24 | char __image_copy_start[0] __attribute__((section(".__image_copy_start"))); |
| 25 | char __image_copy_end[0] __attribute__((section(".__image_copy_end"))); |
Albert ARIBAUD | 47bd65e | 2013-06-11 14:17:34 +0200 | [diff] [blame] | 26 | char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start"))); |
| 27 | char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end"))); |
Marc Zyngier | bf433af | 2014-07-12 14:24:02 +0100 | [diff] [blame] | 28 | char __secure_start[0] __attribute__((section(".__secure_start"))); |
| 29 | char __secure_end[0] __attribute__((section(".__secure_end"))); |
Albert ARIBAUD | d0b5d9d | 2014-02-22 17:53:42 +0100 | [diff] [blame] | 30 | char _end[0] __attribute__((section(".__end"))); |