-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path0005-gnu-efi-version-compatibility.patch
More file actions
40 lines (35 loc) · 1.54 KB
/
Copy path0005-gnu-efi-version-compatibility.patch
File metadata and controls
40 lines (35 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Lukas Schwaighofer <lukas@schwaighofer.name>
Date: Mon, 6 May 2019 00:43:10 +0200
Subject: Strip memtest and memcpy from libefi
Repack libefi.a to not contain the memset and memcpy symbols to make sure the
implementation from syslinux is used and no multiple symbol definitions are
present.
---
efi/Makefile | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff -urNp -x '*.orig' syslinux-6.04-pre1.org/efi/Makefile syslinux-6.04-pre1/efi/Makefile
--- syslinux-6.04-pre1.org/efi/Makefile 2016-03-02 06:06:02.000000000 +0100
+++ syslinux-6.04-pre1/efi/Makefile 2024-04-25 20:04:18.449147821 +0200
@@ -41,8 +41,10 @@ CORE_OBJS += $(addprefix $(OBJ)/../core/
fs/pxe/pxe.o fs/pxe/tftp.o fs/pxe/urlparse.o fs/pxe/dhcp_option.o \
fs/pxe/ftp.o fs/pxe/ftp_readdir.o fs/pxe/http.o fs/pxe/http_readdir.o)
+LIBEFI_STRIPPED = $(objdir)/libefi_stripped.a
+
LIB_OBJS = $(addprefix $(objdir)/com32/lib/,$(CORELIBOBJS)) \
- $(LIBEFI)
+ $(LIBEFI_STRIPPED)
CSRC = $(wildcard $(SRC)/*.c)
OBJS = $(subst $(SRC)/,,$(filter-out %wrapper.o, $(patsubst %.c,%.o,$(CSRC))))
@@ -71,6 +73,13 @@ BTARGET = syslinux.efi
syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
$(LD) $(LDFLAGS) --strip-debug -o $@ $^ -lgnuefi -lefi
+$(LIBEFI_STRIPPED): $(LIBEFI)
+ cp $(LIBEFI) $(LIBEFI_STRIPPED)
+ ar x $(LIBEFI_STRIPPED) init.o
+ strip -N memset -N memcpy init.o
+ ar r $(LIBEFI_STRIPPED) init.o
+ rm init.o
+
# We need to rename the .hash section because the EFI firmware
# linker really doesn't like it.
# $(OBJCOPY) --rename-section .gnu.hash=.sdata,load,data,alloc $^ $@