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

This commit is contained in:
Peter Jones 2012-04-25 09:16:10 -04:00
parent b5f98993c2
commit dd26c59bb1
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From b1e7f6b21c4269de87c626a7e4792ccdeed1a3c5 Mon Sep 17 00:00:00 2001
From: Matt Fleming <matt.fleming@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@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

View File

@ -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@redhat.com> - 3.0e-17
- Align .reloc section as well to make secureboot work (mfleming)
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0e-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild