]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools IA32/X64: remove NOP padding from X86/IA32 GCC linker scripts
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 3 Aug 2015 08:21:28 +0000 (08:21 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Mon, 3 Aug 2015 08:21:28 +0000 (08:21 +0000)
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

BaseTools/Scripts/gcc4.4-ld-script
BaseTools/Scripts/gcc4.9-ld-script

index 68b2767590aca075a354bd088f5c3967a51f6aa3..c0aa62180440c2d331e815c8433f50715a520d60 100644 (file)
@@ -7,7 +7,7 @@ SECTIONS
   {\r
     *(.text .stub .text.* .gnu.linkonce.t.*)\r
     . = ALIGN(0x20);\r
-  } =0x90909090\r
+  }\r
   .data ALIGN(0x20) :\r
   {\r
     *(\r
index b692328536171e5ba8602e5dcf3147188d8829fe..37a93cd85e94000caa1ad2531ac46d7ce18c2eb0 100644 (file)
@@ -7,7 +7,7 @@ SECTIONS
   {\r
     *(.text .stub .text.* .gnu.linkonce.t.*)\r
     . = ALIGN(0x20);\r
-  } =0x90909090\r
+  }\r
   .data ALIGN(0x40) :\r
   {\r
     *(\r