arm_reclaim_init.ld.S 1.11 KB
Newer Older
1
/*
2
 * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved.
3
4
5
6
7
8
9
10
11
12
13
14
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
#ifndef ARM_RECLAIM_INIT_LD_S
#define ARM_RECLAIM_INIT_LD_S

SECTIONS
{
        .init __STACKS_START__ : {
            . = . + PLATFORM_STACK_SIZE;
            . = ALIGN(PAGE_SIZE);
            __INIT_CODE_START__ = .;
15
	    *(*text.init*);
16
            __INIT_CODE_END__ = .;
17
            INIT_CODE_END_ALIGNED = ALIGN(PAGE_SIZE);
18
19
20
21
22
23
24
25
        } >RAM

#ifdef BL31_PROGBITS_LIMIT
    ASSERT(__INIT_CODE_END__ <= BL31_PROGBITS_LIMIT,
            "BL31 init has exceeded progbits limit.")
#endif
}

26
27
#define	ABS		ABSOLUTE

28
29
30
31
32
33
34
35
36
37
38
39
40
#define STACK_SECTION							\
	stacks (NOLOAD) : {						\
		__STACKS_START__ = .;					\
		*(tzfw_normal_stacks)					\
		__STACKS_END__ = .;					\
		/* Allow room for the init section where necessary. */	\
		OFFSET = ABS(SIZEOF(.init) - (. - __STACKS_START__));	\
		/* Offset sign */					\
		SIGN = ABS(OFFSET) & (1 << 63);				\
		/* Offset mask */					\
		MASK = ABS(SIGN >> 63) - 1;				\
		. +=  ABS(OFFSET) & ABS(MASK);				\
		.  = ALIGN(PAGE_SIZE);					\
41
	}
42

43
#endif /* ARM_RECLAIM_INIT_LD_S */