forked from Imagelibrary/rtems
bsps/powerpc: Fix small data area section
Fix small data area in case no fixed size is desired. Rename bsp_section_set_sdata_sbss_size into bsp_section_small_data_area_size since this symbol reflects the overall small data area size (including space for libdl). Do not use bsp_section_sbss_size before definition in linker command file. Add new symbols to <bsp/linker-symbols.h>. Update #3687.
This commit is contained in:
@@ -77,10 +77,18 @@ LINKER_SYMBOL(bsp_section_bss_begin)
|
||||
LINKER_SYMBOL(bsp_section_bss_end)
|
||||
LINKER_SYMBOL(bsp_section_bss_size)
|
||||
|
||||
LINKER_SYMBOL(bsp_section_sdata_begin)
|
||||
LINKER_SYMBOL(bsp_section_sdata_end)
|
||||
LINKER_SYMBOL(bsp_section_sdata_size)
|
||||
|
||||
LINKER_SYMBOL(bsp_section_sbss_begin)
|
||||
LINKER_SYMBOL(bsp_section_sbss_end)
|
||||
LINKER_SYMBOL(bsp_section_sbss_size)
|
||||
|
||||
LINKER_SYMBOL(bsp_section_sdata_libdl_begin)
|
||||
LINKER_SYMBOL(bsp_section_sdata_libdl_end)
|
||||
LINKER_SYMBOL(bsp_section_sdata_libdl_size)
|
||||
|
||||
LINKER_SYMBOL(bsp_section_rtemsstack_begin)
|
||||
LINKER_SYMBOL(bsp_section_rtemsstack_end)
|
||||
LINKER_SYMBOL(bsp_section_rtemsstack_size)
|
||||
|
||||
@@ -37,9 +37,7 @@ PROVIDE (PSIM_INSTRUCTIONS_PER_MICROSECOND = 10000);
|
||||
|
||||
PSIM = 0x0c000000;
|
||||
|
||||
/*
|
||||
* Allocate the maximum size to the small data sdata/sbss section.
|
||||
*/
|
||||
bsp_section_set_sdata_sbss_size = 65536;
|
||||
/* Allocate the maximum size to the small data area */
|
||||
bsp_section_small_data_area_size = 65536;
|
||||
|
||||
INCLUDE linkcmds.base
|
||||
|
||||
@@ -35,9 +35,7 @@ bsp_section_robarrier_align = 0x1000000;
|
||||
bsp_section_rwbarrier_align = 0x1000000;
|
||||
qoriq = 0xffe00000;
|
||||
|
||||
/*
|
||||
* Allocate the maximum size to the small data sdata/sbss section.
|
||||
*/
|
||||
bsp_section_set_sdata_sbss_size = 65536;
|
||||
/* Allocate the maximum size to the small data area */
|
||||
bsp_section_small_data_area_size = 65536;
|
||||
|
||||
INCLUDE linkcmds.base
|
||||
|
||||
@@ -38,9 +38,7 @@ qoriq = 0xffe000000;
|
||||
qoriq_bman_portal = 0xff4000000;
|
||||
qoriq_qman_portal = 0xff6000000;
|
||||
|
||||
/*
|
||||
* Allocate the maximum size to the small data sdata/sbss section.
|
||||
*/
|
||||
bsp_section_set_sdata_sbss_size = 65536;
|
||||
/* Allocate the maximum size to the small data area */
|
||||
bsp_section_small_data_area_size = 65536;
|
||||
|
||||
INCLUDE linkcmds.base
|
||||
|
||||
@@ -23,6 +23,15 @@
|
||||
ENTRY (_start)
|
||||
STARTUP (start.o)
|
||||
|
||||
/*
|
||||
* The upper layer linker command file may optionally define the symbol
|
||||
* bsp_section_small_data_area_size. By default, the small data area is
|
||||
* defined by the .sdata and .sbss input sections. Define
|
||||
* bsp_section_small_data_area_size, if you want to make space available for
|
||||
* dynamically loaded libraries (libdl). Small memory targets which do not use
|
||||
* libdl, should not define this symbol.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Global symbols that may be defined externally
|
||||
*/
|
||||
@@ -304,13 +313,6 @@ SECTIONS {
|
||||
bsp_section_data_load_begin = LOADADDR (.data);
|
||||
bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
|
||||
|
||||
/*
|
||||
* Set bsp_section_set_sdata_bss_size to the system's sdata and bss data size, eg:
|
||||
*
|
||||
* bsp_section_set_sdata_sbss_size = 65536;
|
||||
*/
|
||||
bsp_section_sdata_sbss_size = DEFINED(bsp_section_set_sdata_sbss_size) ?
|
||||
bsp_section_set_sdata_sbss_size : 0;
|
||||
.sbss : ALIGN_WITH_INPUT {
|
||||
bsp_section_sbss_begin = .;
|
||||
*(.dynsbss)
|
||||
@@ -318,10 +320,12 @@ SECTIONS {
|
||||
*(.scommon)
|
||||
bsp_section_sbss_end = .;
|
||||
bsp_section_sdata_libdl_begin = .;
|
||||
. += bsp_section_sdata_sbss_size - (bsp_section_sdata_size + bsp_section_sbss_size);
|
||||
. = DEFINED(bsp_section_small_data_area_size) ?
|
||||
bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
|
||||
bsp_section_sdata_libdl_end = .;
|
||||
} > REGION_DATA AT > REGION_DATA
|
||||
bsp_section_sbss_size = bsp_section_sbss_end - bsp_section_sbss_begin;
|
||||
bsp_section_sdata_libdl_size = bsp_section_sdata_libdl_end - bsp_section_sdata_libdl_begin;
|
||||
|
||||
.bss : ALIGN_WITH_INPUT {
|
||||
bsp_section_bss_begin = .;
|
||||
|
||||
Reference in New Issue
Block a user