summaryrefslogtreecommitdiff
path: root/BaseTools/Scripts
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-08-03 08:21:39 +0000
committerabiesheuvel <abiesheuvel@Edk2>2015-08-03 08:21:39 +0000
commitfa1d29d5cce3d6acc70dcfa0445a4069f547f6e1 (patch)
tree849685be63ebd4a354a82369265f4d3d0412629d /BaseTools/Scripts
parente90ba6e1eaa88f7552df0b5d1304a0f5a78cd977 (diff)
downloadedk2-fa1d29d5cce3d6acc70dcfa0445a4069f547f6e1.zip
edk2-fa1d29d5cce3d6acc70dcfa0445a4069f547f6e1.tar.gz
edk2-fa1d29d5cce3d6acc70dcfa0445a4069f547f6e1.tar.bz2
BaseTools IA32/X64: move .rodata to PE/COFF .text section
The .rodata ELF section contains constant non-executable data that should never be modified by the program itself. Since the risk of inadvertent modification is typically higher than the risk of inadvertent execution, it makes sense to put this data in the R-X .text section rather than in the RW- .data section. So move it there. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18131 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Scripts')
-rw-r--r--BaseTools/Scripts/gcc-4K-align-ld-script2
-rw-r--r--BaseTools/Scripts/gcc4.4-ld-script2
-rw-r--r--BaseTools/Scripts/gcc4.9-ld-script2
3 files changed, 3 insertions, 3 deletions
diff --git a/BaseTools/Scripts/gcc-4K-align-ld-script b/BaseTools/Scripts/gcc-4K-align-ld-script
index 16cf623..1f0f1af 100644
--- a/BaseTools/Scripts/gcc-4K-align-ld-script
+++ b/BaseTools/Scripts/gcc-4K-align-ld-script
@@ -6,12 +6,12 @@ SECTIONS
.text : ALIGN(0x1000)
{
*(.text .stub .text.* .gnu.linkonce.t.*)
+ *(.rodata .rodata.* .gnu.linkonce.r.*)
. = ALIGN(0x20);
}
.data : ALIGN(0x1000)
{
*(
- .rodata .rodata.* .gnu.linkonce.r.*
.data .data.* .gnu.linkonce.d.*
.bss .bss.*
*COM*
diff --git a/BaseTools/Scripts/gcc4.4-ld-script b/BaseTools/Scripts/gcc4.4-ld-script
index c0aa621..22b3220 100644
--- a/BaseTools/Scripts/gcc4.4-ld-script
+++ b/BaseTools/Scripts/gcc4.4-ld-script
@@ -6,12 +6,12 @@ SECTIONS
.text ALIGN(0x20) :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
+ *(.rodata .rodata.* .gnu.linkonce.r.*)
. = ALIGN(0x20);
}
.data ALIGN(0x20) :
{
*(
- .rodata .rodata.* .gnu.linkonce.r.*
.data .data.* .gnu.linkonce.d.*
.bss .bss.*
*COM*
diff --git a/BaseTools/Scripts/gcc4.9-ld-script b/BaseTools/Scripts/gcc4.9-ld-script
index 37a93cd..2ac86e3 100644
--- a/BaseTools/Scripts/gcc4.9-ld-script
+++ b/BaseTools/Scripts/gcc4.9-ld-script
@@ -6,12 +6,12 @@ SECTIONS
.text ALIGN(0x20) :
{
*(.text .stub .text.* .gnu.linkonce.t.*)
+ *(.rodata .rodata.* .gnu.linkonce.r.*)
. = ALIGN(0x20);
}
.data ALIGN(0x40) :
{
*(
- .rodata .rodata.* .gnu.linkonce.r.*
.data .data.* .gnu.linkonce.d.*
.bss .bss.*
*COM*