Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 23 May 2012 17:40:34 +0000 (10:40 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 23 May 2012 17:40:34 +0000 (10:40 -0700)
Pull x86 EFI updates from Ingo Molnar:
 "This patchset makes changes to the bzImage EFI header, so that it can
  be signed with a secure boot signature tool.  It should not affect
  anyone who is not using the EFI self-boot feature in any way."

* 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, efi: Fix NumberOfRvaAndSizes field in PE32 header for EFI_STUB
  x86, efi: Fix .text section overlapping image header for EFI_STUB
  x86, efi: Fix issue of overlapping .reloc section for EFI_STUB

1  2 
arch/x86/boot/compressed/eboot.c
arch/x86/boot/tools/build.c

Simple merge
@@@ -201,17 -201,19 +201,24 @@@ int main(int argc, char ** argv
        /* Size of image */
        put_unaligned_le32(file_sz, &buf[pe_header + 0x50]);
  
+       /*
+        * Subtract the size of the first section (512 bytes) which
+        * includes the header and .reloc section. The remaining size
+        * is that of the .text section.
+        */
+       file_sz -= 512;
+       /* Size of code */
+       put_unaligned_le32(file_sz, &buf[pe_header + 0x1c]);
  #ifdef CONFIG_X86_32
 -      /* Address of entry point */
 -      put_unaligned_le32(i, &buf[pe_header + 0x28]);
 +      /*
 +       * Address of entry point.
 +       *
 +       * The EFI stub entry point is +16 bytes from the start of
 +       * the .text section.
 +       */
 +      put_unaligned_le32(i + 16, &buf[pe_header + 0x28]);
  
        /* .text size */
        put_unaligned_le32(file_sz, &buf[pe_header + 0xb0]);