aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2019-03-25 11:00:46 +0000
committerGitHub <noreply@github.com>2019-03-25 11:00:46 +0000
commit2c269b47364a0f154ca6c1ae3ec82b1b7f923c99 (patch)
tree02e8391c0e9142ff647b4d274c498c0e467020cf
parent981db33f77d844ee647d3c24f572a3b10fe49c1b (diff)
parent330ead806510ed36f440b3b3c93ef67cf12716e0 (diff)
downloadtrusted-firmware-a-2.1-rc1.tar.gz
Merge pull request #1904 from lmayencourt/lm/move_pie_fixupv2.1-rc1
PIE: Fix reloc at the beginning of bl31 entrypoint
-rw-r--r--bl31/aarch64/bl31_entrypoint.S25
1 files changed, 13 insertions, 12 deletions
diff --git a/bl31/aarch64/bl31_entrypoint.S b/bl31/aarch64/bl31_entrypoint.S
index 065edffc7d..f24458c1bb 100644
--- a/bl31/aarch64/bl31_entrypoint.S
+++ b/bl31/aarch64/bl31_entrypoint.S
@@ -23,7 +23,6 @@
*/
func bl31_entrypoint
-#if !RESET_TO_BL31
/* ---------------------------------------------------------------
* Stash the previous bootloader arguments x0 - x3 for later use.
* ---------------------------------------------------------------
@@ -33,6 +32,18 @@ func bl31_entrypoint
mov x22, x2
mov x23, x3
+ /* --------------------------------------------------------------------
+ * If PIE is enabled, fixup the Global descriptor Table and dynamic
+ * relocations
+ * --------------------------------------------------------------------
+ */
+#if ENABLE_PIE
+ mov_imm x0, BL31_BASE
+ mov_imm x1, BL31_LIMIT
+ bl fixup_gdt_reloc
+#endif /* ENABLE_PIE */
+
+#if !RESET_TO_BL31
/* ---------------------------------------------------------------------
* For !RESET_TO_BL31 systems, only the primary CPU ever reaches
* bl31_entrypoint() during the cold boot flow, so the cold/warm boot
@@ -50,6 +61,7 @@ func bl31_entrypoint
_init_c_runtime=1 \
_exception_vectors=runtime_exceptions
#else
+
/* ---------------------------------------------------------------------
* For RESET_TO_BL31 systems which have a programmable reset address,
* bl31_entrypoint() is executed only on the cold boot path so we can
@@ -77,17 +89,6 @@ func bl31_entrypoint
#endif /* RESET_TO_BL31 */
/* --------------------------------------------------------------------
- * If PIE is enabled, fixup the Global descriptor Table and dynamic
- * relocations
- * --------------------------------------------------------------------
- */
-#if ENABLE_PIE
- mov_imm x0, BL31_BASE
- mov_imm x1, BL31_LIMIT
- bl fixup_gdt_reloc
-#endif /* ENABLE_PIE */
-
- /* --------------------------------------------------------------------
* Perform BL31 setup
* --------------------------------------------------------------------
*/