Commit 5bfac4fc authored by Soby Mathew's avatar Soby Mathew
Browse files

BL31: correct GOT section omission

When the patch SHA 931f7c61

 introduced PIE support for BL31,
adding the GOT section when the SEPARATE_CODE_AND_RODATA=0
to the linker script was erroneously omitted. This patch corrects
the same.

Also the patch reduces the alignment requirement for GOT and RELA
sections from 16 bytes to 8. Comments are added explain the
intent for alignment.

Change-Id: I8035cbf75f346f99bd56b13f32e0b3b70dd2fe6c
Signed-off-by: default avatarSoby Mathew <soby.mathew@arm.com>
parent 55cf015c
...@@ -66,11 +66,11 @@ SECTIONS ...@@ -66,11 +66,11 @@ SECTIONS
__CPU_OPS_END__ = .; __CPU_OPS_END__ = .;
/* /*
* Keep the .got section in the RO section as the it is patched * 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 * prior to enabling the MMU and having the .got in RO is better for
* security. * security. GOT is a table of addresses so ensure 8-byte alignment.
*/ */
. = ALIGN(16); . = ALIGN(8);
__GOT_START__ = .; __GOT_START__ = .;
*(.got) *(.got)
__GOT_END__ = .; __GOT_END__ = .;
...@@ -112,6 +112,16 @@ SECTIONS ...@@ -112,6 +112,16 @@ SECTIONS
KEEP(*(cpu_ops)) KEEP(*(cpu_ops))
__CPU_OPS_END__ = .; __CPU_OPS_END__ = .;
/*
* 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__ = .;
/* Place pubsub sections for events */ /* Place pubsub sections for events */
. = ALIGN(8); . = ALIGN(8);
#include <pubsub_events.h> #include <pubsub_events.h>
...@@ -165,11 +175,12 @@ SECTIONS ...@@ -165,11 +175,12 @@ SECTIONS
__DATA_END__ = .; __DATA_END__ = .;
} >RAM } >RAM
. = ALIGN(16);
/* /*
* .rela.dyn needs to come after .data for the read-elf utility to parse * .rela.dyn needs to come after .data for the read-elf utility to parse
* this section correctly. * this section correctly. Ensure 8-byte alignment so that the fields of
* RELA data structure are aligned.
*/ */
. = ALIGN(8);
__RELA_START__ = .; __RELA_START__ = .;
.rela.dyn . : { .rela.dyn . : {
} >RAM } >RAM
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment