xref: /rk3399_rockchip-uboot/arch/arm/lib/sections.c (revision 47bd65ef057fb71b02b32741d5cfcaf03e2f0918)
1df84502eSAlbert ARIBAUD /*
2df84502eSAlbert ARIBAUD  * Copyright 2013 Albert ARIBAUD <albert.u.boot@aribaud.net>
3df84502eSAlbert ARIBAUD  *
4df84502eSAlbert ARIBAUD  * See file CREDITS for list of people who contributed to this
5df84502eSAlbert ARIBAUD  * project.
6df84502eSAlbert ARIBAUD  *
7df84502eSAlbert ARIBAUD  * This program is free software; you can redistribute it and/or
8df84502eSAlbert ARIBAUD  * modify it under the terms of the GNU General Public License as
9df84502eSAlbert ARIBAUD  * published by the Free Software Foundation; either version 2 of
10df84502eSAlbert ARIBAUD  * the License, or (at your option) any later version.
11df84502eSAlbert ARIBAUD  *
12df84502eSAlbert ARIBAUD  * This program is distributed in the hope that it will be useful,
13df84502eSAlbert ARIBAUD  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14df84502eSAlbert ARIBAUD  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15df84502eSAlbert ARIBAUD  * GNU General Public License for more details.
16df84502eSAlbert ARIBAUD  *
17df84502eSAlbert ARIBAUD  * You should have received a copy of the GNU General Public License
18df84502eSAlbert ARIBAUD  * along with this program; if not, write to the Free Software
19df84502eSAlbert ARIBAUD  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20df84502eSAlbert ARIBAUD  * MA 02111-1307 USA
21df84502eSAlbert ARIBAUD  */
22df84502eSAlbert ARIBAUD 
23df84502eSAlbert ARIBAUD /**
24df84502eSAlbert ARIBAUD  * These two symbols are declared in a C file so that the linker
25df84502eSAlbert ARIBAUD  * uses R_ARM_RELATIVE relocation, rather than the R_ARM_ABS32 one
26df84502eSAlbert ARIBAUD  * it would use if the symbols were defined in the linker file.
27df84502eSAlbert ARIBAUD  * Using only R_ARM_RELATIVE relocation ensures that references to
28df84502eSAlbert ARIBAUD  * the symbols are correct after as well as before relocation.
29df84502eSAlbert ARIBAUD  *
30df84502eSAlbert ARIBAUD  * We need a 0-byte-size type for these symbols, and the compiler
31df84502eSAlbert ARIBAUD  * does not allow defining objects of C type 'void'. Using an empty
32df84502eSAlbert ARIBAUD  * struct is allowed by the compiler, but causes gcc versions 4.4 and
33df84502eSAlbert ARIBAUD  * below to complain about aliasing. Therefore we use the next best
34df84502eSAlbert ARIBAUD  * thing: zero-sized arrays, which are both 0-byte-size and exempt from
35df84502eSAlbert ARIBAUD  * aliasing warnings.
36df84502eSAlbert ARIBAUD  */
37df84502eSAlbert ARIBAUD 
38df84502eSAlbert ARIBAUD char __bss_start[0] __attribute__((section(".__bss_start")));
39df84502eSAlbert ARIBAUD char __bss_end[0] __attribute__((section(".__bss_end")));
40d026dec8SAlbert ARIBAUD char __image_copy_start[0] __attribute__((section(".__image_copy_start")));
41d026dec8SAlbert ARIBAUD char __image_copy_end[0] __attribute__((section(".__image_copy_end")));
42*47bd65efSAlbert ARIBAUD char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start")));
43*47bd65efSAlbert ARIBAUD char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end")));
44