shim/shim-fix-mokmanager-sections.patch

100 lines
2.8 KiB
Diff

From 61f1bfea2250c38b6c381a3876b41acf007f4289 Mon Sep 17 00:00:00 2001
From: Gary Ching-Pang Lin <glin@suse.com>
Date: Mon, 10 Nov 2014 17:19:58 +0800
Subject: [PATCH 1/2] Fix objcopy parameters to include .rel and .rela
The objcopy parameters -j .rel* and -j .rela* looked like that the
two sections would be in the EFI binary, but it's actually not, and
this caused MokManager.efi crash.
Remove the asterisks to fix MokManager.efi.
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
---
Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 332a29b..39160c5 100644
--- a/Makefile
+++ b/Makefile
@@ -133,13 +133,13 @@ FORMAT ?= --target efi-app-$(ARCH)
%.efi: %.so
$(OBJCOPY) -j .text -j .sdata -j .data \
- -j .dynamic -j .dynsym -j .rel* \
- -j .rela* -j .reloc -j .eh_frame \
+ -j .dynamic -j .dynsym -j .rel \
+ -j .rela -j .reloc -j .eh_frame \
-j .vendor_cert \
$(FORMAT) $^ $@
$(OBJCOPY) -j .text -j .sdata -j .data \
- -j .dynamic -j .dynsym -j .rel* \
- -j .rela* -j .reloc -j .eh_frame \
+ -j .dynamic -j .dynsym -j .rel \
+ -j .rela -j .reloc -j .eh_frame \
-j .debug_info -j .debug_abbrev -j .debug_aranges \
-j .debug_line -j .debug_str -j .debug_ranges \
$(FORMAT) $^ $@.debug
--
1.8.4.5
From a0d319c24c064b3275f4dc91cf141336fb7449fa Mon Sep 17 00:00:00 2001
From: Gary Ching-Pang Lin <glin@suse.com>
Date: Mon, 10 Nov 2014 17:31:15 +0800
Subject: [PATCH 2/2] Add nostdinc to the CFLAGS for lib
We don't need the headers from the standard include path.
Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
---
lib/Makefile | 2 +-
lib/console.c | 4 ++--
lib/guid.c | 1 -
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/lib/Makefile b/lib/Makefile
index ebd21a1..3c5101e 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -4,7 +4,7 @@ LIBFILES = simple_file.o guid.o console.o execute.o configtable.o shell.o variab
EFI_INCLUDES = -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -I../include
-CFLAGS = -ggdb -O0 -fno-stack-protector -fno-strict-aliasing -fpic \
+CFLAGS = -ggdb -O0 -fno-stack-protector -fno-strict-aliasing -fpic -nostdinc\
-fshort-wchar -Wall -DBUILD_EFI -fno-builtin -Werror \
$(EFI_INCLUDES)
diff --git a/lib/console.c b/lib/console.c
index 83ee679..fd8cc5c 100644
--- a/lib/console.c
+++ b/lib/console.c
@@ -4,8 +4,8 @@
*
* see COPYING file
*/
-#include <efi/efi.h>
-#include <efi/efilib.h>
+#include <efi.h>
+#include <efilib.h>
#include <console.h>
#include <variables.h>
diff --git a/lib/guid.c b/lib/guid.c
index 56ec952..c97a7ca 100644
--- a/lib/guid.c
+++ b/lib/guid.c
@@ -5,7 +5,6 @@
*/
#include <guid.h>
-#include <stdio.h>
#ifndef BUILD_EFI
/* EFI has %g for this, so it's only needed in platform c */
--
1.8.4.5