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.biesheu...@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com>
Tested-by: Liming Gao <liming....@intel.com>
---
 BaseTools/Scripts/gcc4.4-ld-script | 2 +-
 BaseTools/Scripts/gcc4.9-ld-script | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Scripts/gcc4.4-ld-script 
b/BaseTools/Scripts/gcc4.4-ld-script
index 68b2767590ac..c0aa62180440 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 b69232853617..37a93cd85e94 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) :
   {
     *(
-- 
1.9.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to