xref: /openbmc/u-boot/arch/arm/lib/sections.c (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini // SPDX-License-Identifier: GPL-2.0+
2df84502eSAlbert ARIBAUD /*
3df84502eSAlbert ARIBAUD  * Copyright 2013 Albert ARIBAUD <albert.u.boot@aribaud.net>
4df84502eSAlbert ARIBAUD  */
5df84502eSAlbert ARIBAUD 
6df84502eSAlbert ARIBAUD /**
7df84502eSAlbert ARIBAUD  * These two symbols are declared in a C file so that the linker
8df84502eSAlbert ARIBAUD  * uses R_ARM_RELATIVE relocation, rather than the R_ARM_ABS32 one
9df84502eSAlbert ARIBAUD  * it would use if the symbols were defined in the linker file.
10df84502eSAlbert ARIBAUD  * Using only R_ARM_RELATIVE relocation ensures that references to
11df84502eSAlbert ARIBAUD  * the symbols are correct after as well as before relocation.
12df84502eSAlbert ARIBAUD  *
13df84502eSAlbert ARIBAUD  * We need a 0-byte-size type for these symbols, and the compiler
14df84502eSAlbert ARIBAUD  * does not allow defining objects of C type 'void'. Using an empty
15df84502eSAlbert ARIBAUD  * struct is allowed by the compiler, but causes gcc versions 4.4 and
16df84502eSAlbert ARIBAUD  * below to complain about aliasing. Therefore we use the next best
17df84502eSAlbert ARIBAUD  * thing: zero-sized arrays, which are both 0-byte-size and exempt from
18df84502eSAlbert ARIBAUD  * aliasing warnings.
19df84502eSAlbert ARIBAUD  */
20df84502eSAlbert ARIBAUD 
21df84502eSAlbert ARIBAUD char __bss_start[0] __attribute__((section(".__bss_start")));
22df84502eSAlbert ARIBAUD char __bss_end[0] __attribute__((section(".__bss_end")));
23d026dec8SAlbert ARIBAUD char __image_copy_start[0] __attribute__((section(".__image_copy_start")));
24d026dec8SAlbert ARIBAUD char __image_copy_end[0] __attribute__((section(".__image_copy_end")));
2547bd65efSAlbert ARIBAUD char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start")));
2647bd65efSAlbert ARIBAUD char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end")));
27bf433afdSMarc Zyngier char __secure_start[0] __attribute__((section(".__secure_start")));
28bf433afdSMarc Zyngier char __secure_end[0] __attribute__((section(".__secure_end")));
29980d6a55SChen-Yu Tsai char __secure_stack_start[0] __attribute__((section(".__secure_stack_start")));
30980d6a55SChen-Yu Tsai char __secure_stack_end[0] __attribute__((section(".__secure_stack_end")));
3150149ea3SAlexander Graf char __efi_runtime_start[0] __attribute__((section(".__efi_runtime_start")));
3250149ea3SAlexander Graf char __efi_runtime_stop[0] __attribute__((section(".__efi_runtime_stop")));
3350149ea3SAlexander Graf char __efi_runtime_rel_start[0] __attribute__((section(".__efi_runtime_rel_start")));
3450149ea3SAlexander Graf char __efi_runtime_rel_stop[0] __attribute__((section(".__efi_runtime_rel_stop")));
35d0b5d9daSAlbert ARIBAUD char _end[0] __attribute__((section(".__end")));
36