summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-08-03 08:21:28 +0000
committerabiesheuvel <abiesheuvel@Edk2>2015-08-03 08:21:28 +0000
commite90ba6e1eaa88f7552df0b5d1304a0f5a78cd977 (patch)
treecc6e3a80e0daa4d2cc92bd2cc8db67b65afbff3f
parent37ee497e7846436af4847ec22fd72bc10de86ea5 (diff)
downloadedk2-e90ba6e1eaa88f7552df0b5d1304a0f5a78cd977.zip
edk2-e90ba6e1eaa88f7552df0b5d1304a0f5a78cd977.tar.gz
edk2-e90ba6e1eaa88f7552df0b5d1304a0f5a78cd977.tar.bz2
BaseTools IA32/X64: remove NOP padding from X86/IA32 GCC linker scripts
The NOP padding in the GCC linker scripts ensures that all empty regions in the ELF binary are filled with x86 NOP instructions. There is no upside to doing this: if the CPU ends up executing these instructions, we have little hope of resuming normal execution of the program anyway. And having NOP slides in memory only makes it easier for attackers to launch exploits. So remove them. 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@18130 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--BaseTools/Scripts/gcc4.4-ld-script2
-rw-r--r--BaseTools/Scripts/gcc4.9-ld-script2
2 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Scripts/gcc4.4-ld-script b/BaseTools/Scripts/gcc4.4-ld-script
index 68b2767..c0aa621 100644
--- a/BaseTools/Scripts/gcc4.4-ld-script
+++ b/BaseTools/Scripts/gcc4.4-ld-script
@@ -7,7 +7,7 @@ SECTIONS
{
*(.text .stub .text.* .gnu.linkonce.t.*)
. = ALIGN(0x20);
- } =0x90909090
+ }
.data ALIGN(0x20) :
{
*(
diff --git a/BaseTools/Scripts/gcc4.9-ld-script b/BaseTools/Scripts/gcc4.9-ld-script
index b692328..37a93cd 100644
--- a/BaseTools/Scripts/gcc4.9-ld-script
+++ b/BaseTools/Scripts/gcc4.9-ld-script
@@ -7,7 +7,7 @@ SECTIONS
{
*(.text .stub .text.* .gnu.linkonce.t.*)
. = ALIGN(0x20);
- } =0x90909090
+ }
.data ALIGN(0x40) :
{
*(