linker_script: replace common read-only data with RODATA_COMMON

The common section data are repeated in many linker scripts (often
twice in each script to support SEPARATE_CODE_AND_RODATA). When you
add a new read-only data section, you end up with touching lots of
places.

After this commit, you will only need to touch bl_common.ld.h when
you add a new section to RODATA_COMMON.

Replace a series of RO section with RODATA_COMMON, which contains
6 sections, some of which did not exist before.

This is not a big deal because unneeded data should not be compiled
in the first place. I believe this should be controlled by BL*_SOURCES
in Makefiles, not by linker scripts.

When I was working on this commit, the BL1 image size increased
due to the fconf_populator. Commit c452ba159c14 ("fconf: exclude
fconf_dyn_cfg_getter.c from BL1_SOURCES") fixed this issue.

I investigated BL1, BL2, BL2U, BL31 for plat=fvp, and BL2-AT-EL3,
BL31, BL31 for plat=uniphier. I did not see any more  unexpected
code addition.

Change-Id: I5d14d60dbe3c821765bce3ae538968ef266f1460
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
diff --git a/bl1/bl1.ld.S b/bl1/bl1.ld.S
index 87f1ae8..e706ce2 100644
--- a/bl1/bl1.ld.S
+++ b/bl1/bl1.ld.S
@@ -45,8 +45,7 @@
         __RODATA_START__ = .;
         *(SORT_BY_ALIGNMENT(.rodata*))
 
-	PARSER_LIB_DESCS
-	CPU_OPS
+	RODATA_COMMON
 
         /*
          * No need to pad out the .rodata section to a page boundary. Next is
@@ -67,8 +66,7 @@
         *(SORT_BY_ALIGNMENT(.text*))
         *(SORT_BY_ALIGNMENT(.rodata*))
 
-	PARSER_LIB_DESCS
-	CPU_OPS
+	RODATA_COMMON
 
         *(.vectors)
         __RO_END__ = .;
diff --git a/bl2/bl2.ld.S b/bl2/bl2.ld.S
index afb0133..dc51652 100644
--- a/bl2/bl2.ld.S
+++ b/bl2/bl2.ld.S
@@ -45,8 +45,7 @@
         __RODATA_START__ = .;
         *(SORT_BY_ALIGNMENT(.rodata*))
 
-	FCONF_POPULATOR
-	PARSER_LIB_DESCS
+	RODATA_COMMON
 
         . = ALIGN(PAGE_SIZE);
         __RODATA_END__ = .;
@@ -58,8 +57,7 @@
         *(SORT_BY_ALIGNMENT(.text*))
         *(SORT_BY_ALIGNMENT(.rodata*))
 
-	FCONF_POPULATOR
-	PARSER_LIB_DESCS
+	RODATA_COMMON
 
         *(.vectors)
         __RO_END_UNALIGNED__ = .;
diff --git a/bl2/bl2_el3.ld.S b/bl2/bl2_el3.ld.S
index d237990..3c27443 100644
--- a/bl2/bl2_el3.ld.S
+++ b/bl2/bl2_el3.ld.S
@@ -53,9 +53,7 @@
         __RODATA_START__ = .;
         *(SORT_BY_ALIGNMENT(.rodata*))
 
-	PARSER_LIB_DESCS
-	CPU_OPS
-	GOT
+	RODATA_COMMON
 
         . = ALIGN(PAGE_SIZE);
         __RODATA_END__ = .;
@@ -73,9 +71,7 @@
         *(SORT_BY_ALIGNMENT(.text*))
         *(SORT_BY_ALIGNMENT(.rodata*))
 
-	CPU_OPS
-	PARSER_LIB_DESCS
-	GOT
+	RODATA_COMMON
 
         *(.vectors)
         __RO_END_UNALIGNED__ = .;
diff --git a/bl2u/bl2u.ld.S b/bl2u/bl2u.ld.S
index 96545a3..37e658a 100644
--- a/bl2u/bl2u.ld.S
+++ b/bl2u/bl2u.ld.S
@@ -46,6 +46,9 @@
     .rodata . : {
         __RODATA_START__ = .;
         *(SORT_BY_ALIGNMENT(.rodata*))
+
+	RODATA_COMMON
+
         . = ALIGN(PAGE_SIZE);
         __RODATA_END__ = .;
     } >RAM
@@ -56,6 +59,8 @@
         *(SORT_BY_ALIGNMENT(.text*))
         *(SORT_BY_ALIGNMENT(.rodata*))
 
+	RODATA_COMMON
+
         *(.vectors)
         __RO_END_UNALIGNED__ = .;
         /*
diff --git a/bl31/bl31.ld.S b/bl31/bl31.ld.S
index 6b7f915..ac99a7d 100644
--- a/bl31/bl31.ld.S
+++ b/bl31/bl31.ld.S
@@ -47,11 +47,7 @@
         __RODATA_START__ = .;
         *(SORT_BY_ALIGNMENT(.rodata*))
 
-	RT_SVC_DESCS
-	FCONF_POPULATOR
-	PMF_SVC_DESCS
-	CPU_OPS
-	GOT
+	RODATA_COMMON
 
         /* Place pubsub sections for events */
         . = ALIGN(8);
@@ -67,11 +63,7 @@
         *(SORT_BY_ALIGNMENT(.text*))
         *(SORT_BY_ALIGNMENT(.rodata*))
 
-	RT_SVC_DESCS
-	FCONF_POPULATOR
-	PMF_SVC_DESCS
-	CPU_OPS
-	GOT
+	RODATA_COMMON
 
         /* Place pubsub sections for events */
         . = ALIGN(8);
diff --git a/bl32/sp_min/sp_min.ld.S b/bl32/sp_min/sp_min.ld.S
index d83b4e0..f652f17 100644
--- a/bl32/sp_min/sp_min.ld.S
+++ b/bl32/sp_min/sp_min.ld.S
@@ -48,10 +48,7 @@
         __RODATA_START__ = .;
         *(.rodata*)
 
-	RT_SVC_DESCS
-	FCONF_POPULATOR
-	PMF_SVC_DESCS
-	CPU_OPS
+	RODATA_COMMON
 
         /* Place pubsub sections for events */
         . = ALIGN(8);
@@ -67,9 +64,7 @@
         *(.text*)
         *(.rodata*)
 
-	RT_SVC_DESCS
-	FCONF_POPULATOR
-	CPU_OPS
+	RODATA_COMMON
 
         /* Place pubsub sections for events */
         . = ALIGN(8);
diff --git a/bl32/tsp/tsp.ld.S b/bl32/tsp/tsp.ld.S
index b1ec423..b071e82 100644
--- a/bl32/tsp/tsp.ld.S
+++ b/bl32/tsp/tsp.ld.S
@@ -37,7 +37,7 @@
         __RODATA_START__ = .;
         *(.rodata*)
 
-	GOT
+	RODATA_COMMON
 
         . = ALIGN(PAGE_SIZE);
         __RODATA_END__ = .;
@@ -49,7 +49,7 @@
         *(.text*)
         *(.rodata*)
 
-	GOT
+	RODATA_COMMON
 
         *(.vectors)
 
diff --git a/include/common/bl_common.ld.h b/include/common/bl_common.ld.h
index d9e2e01..5c5fe5b 100644
--- a/include/common/bl_common.ld.h
+++ b/include/common/bl_common.ld.h
@@ -56,6 +56,14 @@
 	*(.got)						\
 	__GOT_END__ = .;
 
+#define RODATA_COMMON					\
+	RT_SVC_DESCS					\
+	FCONF_POPULATOR					\
+	PMF_SVC_DESCS					\
+	PARSER_LIB_DESCS				\
+	CPU_OPS						\
+	GOT
+
 #define STACK_SECTION					\
 	stacks (NOLOAD) : {				\
 		__STACKS_START__ = .;			\
diff --git a/plat/mediatek/mt6795/bl31.ld.S b/plat/mediatek/mt6795/bl31.ld.S
index 03a737f..02d79af 100644
--- a/plat/mediatek/mt6795/bl31.ld.S
+++ b/plat/mediatek/mt6795/bl31.ld.S
@@ -38,8 +38,7 @@
         *(.text*)
         *(.rodata*)
 
-	RT_SVC_DESCS
-	CPU_OPS
+	RODATA_COMMON
 
         __RO_END_UNALIGNED__ = .;
         /*