summaryrefslogtreecommitdiffstats
path: root/bsps/powerpc
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-02-11 07:34:14 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-02-11 11:41:13 +0100
commiteec706e2bf41a9a166aa5e744d041171015214ea (patch)
tree3ff2b448ccde61efdbb87f1486a624ecf4fa94b5 /bsps/powerpc
parentlibdl: Add powerpc large memory and small data support. (diff)
downloadrtems-eec706e2bf41a9a166aa5e744d041171015214ea.tar.bz2
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.
Diffstat (limited to 'bsps/powerpc')
-rw-r--r--bsps/powerpc/include/bsp/linker-symbols.h8
-rw-r--r--bsps/powerpc/psim/start/linkcmds6
-rw-r--r--bsps/powerpc/qoriq/start/linkcmds.qoriq_e5006
-rw-r--r--bsps/powerpc/qoriq/start/linkcmds.qoriq_e6500_326
-rw-r--r--bsps/powerpc/shared/start/linkcmds.base20
5 files changed, 26 insertions, 20 deletions
diff --git a/bsps/powerpc/include/bsp/linker-symbols.h b/bsps/powerpc/include/bsp/linker-symbols.h
index 61e0da4158..06e5ef57a5 100644
--- a/bsps/powerpc/include/bsp/linker-symbols.h
+++ b/bsps/powerpc/include/bsp/linker-symbols.h
@@ -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)
diff --git a/bsps/powerpc/psim/start/linkcmds b/bsps/powerpc/psim/start/linkcmds
index a34f4a2bcd..69491abb86 100644
--- a/bsps/powerpc/psim/start/linkcmds
+++ b/bsps/powerpc/psim/start/linkcmds
@@ -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
diff --git a/bsps/powerpc/qoriq/start/linkcmds.qoriq_e500 b/bsps/powerpc/qoriq/start/linkcmds.qoriq_e500
index 266e21b934..2c217ecb1f 100644
--- a/bsps/powerpc/qoriq/start/linkcmds.qoriq_e500
+++ b/bsps/powerpc/qoriq/start/linkcmds.qoriq_e500
@@ -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
diff --git a/bsps/powerpc/qoriq/start/linkcmds.qoriq_e6500_32 b/bsps/powerpc/qoriq/start/linkcmds.qoriq_e6500_32
index 34a4eee9f4..abc9c9e6c5 100644
--- a/bsps/powerpc/qoriq/start/linkcmds.qoriq_e6500_32
+++ b/bsps/powerpc/qoriq/start/linkcmds.qoriq_e6500_32
@@ -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
diff --git a/bsps/powerpc/shared/start/linkcmds.base b/bsps/powerpc/shared/start/linkcmds.base
index 642f0bf7e1..65ee046b95 100644
--- a/bsps/powerpc/shared/start/linkcmds.base
+++ b/bsps/powerpc/shared/start/linkcmds.base
@@ -24,6 +24,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 = .;