aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2020-06-30 13:42:09 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-06-30 13:42:09 +0000
commit568a8817281d6acb80580226dfcb4e39edcb74c1 (patch)
tree04dc65615b19ce309b5c1a48d02f5200ca8709d7
parent1ba168cf4233274236276d7bfbc520c90fa2a1cf (diff)
parente8ad6168b0153e09f1a54ee887555db7833019df (diff)
downloadtrusted-firmware-a-568a8817281d6acb80580226dfcb4e39edcb74c1.tar.gz
Merge "linker_script: move .rela.dyn section to bl_common.ld.h" into integration
-rw-r--r--bl2/bl2_el3.ld.S12
-rw-r--r--bl31/bl31.ld.S12
-rw-r--r--bl32/tsp/tsp.ld.S12
-rw-r--r--include/common/bl_common.ld.h11
4 files changed, 14 insertions, 33 deletions
diff --git a/bl2/bl2_el3.ld.S b/bl2/bl2_el3.ld.S
index 8c45d9898..bc1794c06 100644
--- a/bl2/bl2_el3.ld.S
+++ b/bl2/bl2_el3.ld.S
@@ -105,17 +105,7 @@ SECTIONS
__DATA_RAM_START__ = __DATA_START__;
__DATA_RAM_END__ = __DATA_END__;
- /*
- * .rela.dyn needs to come after .data for the read-elf utility to parse
- * this section correctly. Ensure 8-byte alignment so that the fields of
- * RELA data structure are aligned.
- */
- . = ALIGN(8);
- __RELA_START__ = .;
- .rela.dyn . : {
- } >RAM
- __RELA_END__ = .;
-
+ RELA_SECTION >RAM
STACK_SECTION >RAM
BSS_SECTION >RAM
XLAT_TABLE_SECTION >RAM
diff --git a/bl31/bl31.ld.S b/bl31/bl31.ld.S
index 11e86a3c1..502650097 100644
--- a/bl31/bl31.ld.S
+++ b/bl31/bl31.ld.S
@@ -115,17 +115,7 @@ SECTIONS
__RW_START__ = . ;
DATA_SECTION >RAM
-
- /*
- * .rela.dyn needs to come after .data for the read-elf utility to parse
- * this section correctly. Ensure 8-byte alignment so that the fields of
- * RELA data structure are aligned.
- */
- . = ALIGN(8);
- __RELA_START__ = .;
- .rela.dyn . : {
- } >RAM
- __RELA_END__ = .;
+ RELA_SECTION >RAM
#ifdef BL31_PROGBITS_LIMIT
ASSERT(. <= BL31_PROGBITS_LIMIT, "BL31 progbits has exceeded its limit.")
diff --git a/bl32/tsp/tsp.ld.S b/bl32/tsp/tsp.ld.S
index bdcd2cf70..d86ae5587 100644
--- a/bl32/tsp/tsp.ld.S
+++ b/bl32/tsp/tsp.ld.S
@@ -71,17 +71,7 @@ SECTIONS
__RW_START__ = . ;
DATA_SECTION >RAM
-
- /*
- * .rela.dyn needs to come after .data for the read-elf utility to parse
- * this section correctly. Ensure 8-byte alignment so that the fields of
- * RELA data structure are aligned.
- */
- . = ALIGN(8);
- __RELA_START__ = .;
- .rela.dyn . : {
- } >RAM
- __RELA_END__ = .;
+ RELA_SECTION >RAM
#ifdef TSP_PROGBITS_LIMIT
ASSERT(. <= TSP_PROGBITS_LIMIT, "TSP progbits has exceeded its limit.")
diff --git a/include/common/bl_common.ld.h b/include/common/bl_common.ld.h
index 208e3d681..ab3391aa2 100644
--- a/include/common/bl_common.ld.h
+++ b/include/common/bl_common.ld.h
@@ -101,6 +101,17 @@
__DATA_END__ = .; \
}
+/*
+ * .rela.dyn needs to come after .data for the read-elf utility to parse
+ * this section correctly.
+ */
+#define RELA_SECTION \
+ .rela.dyn : ALIGN(STRUCT_ALIGN) { \
+ __RELA_START__ = .; \
+ *(.rela*) \
+ __RELA_END__ = .; \
+ }
+
#if !(defined(IMAGE_BL31) && RECLAIM_INIT_CODE)
#define STACK_SECTION \
stacks (NOLOAD) : { \