xref: /rk3399_rockchip-uboot/arch/arm/lib/sections.c (revision bf433afd60ce2ccd1bec3cf14150323be8272ac3)
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")));
28*bf433afdSMarc Zyngier char __secure_start[0] __attribute__((section(".__secure_start")));
29*bf433afdSMarc Zyngier char __secure_end[0] __attribute__((section(".__secure_end")));
30d0b5d9daSAlbert ARIBAUD char _end[0] __attribute__((section(".__end")));
31