aboutsummaryrefslogtreecommitdiffstats
path: root/include/common/bl_common.ld.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/common/bl_common.ld.h')
-rw-r--r--include/common/bl_common.ld.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/common/bl_common.ld.h b/include/common/bl_common.ld.h
index 8ea7d6a8c..97fed7204 100644
--- a/include/common/bl_common.ld.h
+++ b/include/common/bl_common.ld.h
@@ -17,6 +17,10 @@
#define BSS_ALIGN 8
#endif
+#ifndef DATA_ALIGN
+#define DATA_ALIGN 1
+#endif
+
#define CPU_OPS \
. = ALIGN(STRUCT_ALIGN); \
__CPU_OPS_START__ = .; \
@@ -85,6 +89,18 @@
GOT \
BASE_XLAT_TABLE_RO
+/*
+ * .data must be placed at a lower address than the stacks if the stack
+ * protector is enabled. Alternatively, the .data.stack_protector_canary
+ * section can be placed independently of the main .data section.
+ */
+#define DATA_SECTION \
+ .data . : ALIGN(DATA_ALIGN) { \
+ __DATA_START__ = .; \
+ *(SORT_BY_ALIGNMENT(.data*)) \
+ __DATA_END__ = .; \
+ }
+
#define STACK_SECTION \
stacks (NOLOAD) : { \
__STACKS_START__ = .; \