File shim-fix-mokmanager-sections.patch of Package shim

From fa7e46558ebdafeb7b5f4a3b843f309a678d4365 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] Fix objcopy parameters to include .rel and .rela

This is a quick hack for the old objcopy.

The asterisks support in objcopy was added in 2.24. For the distro
with the older objcopy, some sections would be ignored and this could
crash the program.

Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
---
 Makefile | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 412496b..a791bcc 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,6 @@ LD		= $(CROSS_COMPILE)ld
 OBJCOPY		= $(CROSS_COMPILE)objcopy
 
 ARCH		= $(shell $(CC) -dumpmachine | cut -f1 -d- | sed s,i[3456789]86,ia32,)
-OBJCOPY_GTE224  = $(shell expr `$(OBJCOPY) --version |grep ^"GNU objcopy" | sed 's/^.* //g' | cut -f1-2 -d.` \>= 2.24)
 
 SUBDIRS		= Cryptlib lib
 
@@ -142,17 +141,14 @@ endif
 FORMAT		?= --target efi-app-$(ARCH)
 
 %.efi: %.so
-ifneq ($(OBJCOPY_GTE224),1)
-	$(error objcopy >= 2.24 is required)
-endif
 	$(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 \
 		-j .note.gnu.build-id \
-- 
2.1.4

openSUSE Build Service is sponsored by