[gnu-efi/f17] Align .reloc section as well to make secureboot work (mfleming)

Peter Jones pjones at fedoraproject.org
Wed Apr 25 13:16:20 UTC 2012


commit dd26c59bb1408b22a3d9e0f6fa2823b5f57e3798
Author: Peter Jones <pjones at redhat.com>
Date:   Wed Apr 25 09:16:10 2012 -0400

    Align .reloc section as well to make secureboot work (mfleming)

 gnu-efi-3.0e-align-reloc-section.patch |   34 ++++++++++++++++++++++++++++++++
 gnu-efi.spec                           |    6 ++++-
 2 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/gnu-efi-3.0e-align-reloc-section.patch b/gnu-efi-3.0e-align-reloc-section.patch
new file mode 100644
index 0000000..07f33cf
--- /dev/null
+++ b/gnu-efi-3.0e-align-reloc-section.patch
@@ -0,0 +1,34 @@
+From b1e7f6b21c4269de87c626a7e4792ccdeed1a3c5 Mon Sep 17 00:00:00 2001
+From: Matt Fleming <matt.fleming at intel.com>
+Date: Mon, 23 Apr 2012 11:19:58 +0100
+Subject: [PATCH] Align the .reloc section for x86-64
+
+Like the linker scripts for other architectures, the .reloc section
+needs to be aligned for x86-64. Use a 4096-byte boundary because that
+seems to be the convention used everywhere else in the linker scripts.
+
+Without this patch the .reloc section will not adhere to the alignment
+value in the FileAlignment field (512 bytes by default) of the PE/COFF
+header. This results in a signed executable failing to boot in a
+secure boot environment.
+
+Signed-off-by: Matt Fleming <matt.fleming at intel.com>
+---
+ gnuefi/elf_x86_64_efi.lds |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gnuefi/elf_x86_64_efi.lds b/gnuefi/elf_x86_64_efi.lds
+index d188aee..32cf687 100644
+--- a/gnuefi/elf_x86_64_efi.lds
++++ b/gnuefi/elf_x86_64_efi.lds
+@@ -17,6 +17,7 @@ SECTIONS
+   {
+    *(.text)
+   }
++  . = ALIGN(4096);
+   .reloc :
+   {
+    *(.reloc)
+-- 
+1.7.10
+
diff --git a/gnu-efi.spec b/gnu-efi.spec
index 3fba987..05dba26 100644
--- a/gnu-efi.spec
+++ b/gnu-efi.spec
@@ -1,7 +1,7 @@
 Summary: Development Libraries and headers for EFI
 Name: gnu-efi
 Version: 3.0e
-Release: 16%{?dist}
+Release: 17%{?dist}
 Group: Development/System
 License: GPLv2+
 URL: ftp://ftp.hpl.hp.com/pub/linux-ia64
@@ -20,6 +20,7 @@ Patch10: gnu-efi-3.0e-Add-.S-and-.E-rules.patch
 Patch11: gnu-efi-3.0e-Guarantee-16-byte-stack-alignment-on-x86_64-efi_call.patch
 Patch12: gnu-efi-3.0e-Add-the-routines-to-make-callbacks-work.patch
 Patch13: gnu-efi-3.0e-Add-tcc.efi-to-test-our-calling-convention-shananaga.patch
+Patch14: gnu-efi-3.0e-align-reloc-section.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 ExclusiveArch: i686 x86_64 ia64
 BuildRequires: git
@@ -69,6 +70,9 @@ rm -rf %{buildroot}
 %attr(0644,root,root) /boot/efi/EFI/redhat/*.efi
 
 %changelog
+* Wed Apr 25 2012 Peter Jones <pjones at redhat.com> - 3.0e-17
+- Align .reloc section as well to make secureboot work (mfleming)
+
 * Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0e-16
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list