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