cactus: add symbols relocation fixup

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Ibde8aadecf6ae6c320d01ee2acab9c3c8db3859d
diff --git a/spm/cactus/cactus.ld.S b/spm/cactus/cactus.ld.S
index a3d8e65..30ad0da 100644
--- a/spm/cactus/cactus.ld.S
+++ b/spm/cactus/cactus.ld.S
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -32,8 +32,20 @@
         . = ALIGN(PAGE_SIZE);
         __RODATA_START__ = .;
         *(.rodata*)
+
+        /*
+         * Keep the .got section in the RO section as it is patched
+         * prior to enabling the MMU and having the .got in RO is better for
+         * security. GOT is a table of addresses so ensure 8-byte alignment.
+         */
+        . = ALIGN(8);
+        __GOT_START__ = .;
+        *(.got)
+        __GOT_END__ = .;
+
         . = NEXT(PAGE_SIZE);
         __RODATA_END__ = .;
+
     }
 
     .data : {
@@ -44,6 +56,17 @@
         __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 . : {
+    }
+    __RELA_END__ = .;
+
     .bss (NOLOAD) : {
         . = ALIGN(PAGE_SIZE);
         __BSS_START__ = .;