summaryrefslogtreecommitdiff
path: root/shim
diff options
context:
space:
mode:
Diffstat (limited to 'shim')
-rw-r--r--shim/Makefile6
-rw-r--r--shim/entry.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/shim/Makefile b/shim/Makefile
index 51ec96c..42007b8 100644
--- a/shim/Makefile
+++ b/shim/Makefile
@@ -15,11 +15,11 @@ CFLAGS += -Wno-unused-const-variable -Wno-unused-function -fvisibility=hidden \
LIBDIRS += -L$(dir $(shell $(CC) -print-libgcc-file-name))
LDSCRIPT := shim.ld
-LDFLAGS += -z max-page-size=4096 --export-dynamic
+LDFLAGS += -z max-page-size=4096 --export-dynamic -pic --no-dynamic-linker
LOADLIBES := -lgcc
-OBJS := entry.o memcmp.o memcpy.o memmove.o memset.o
-$(OBJS): CFLAGS += -fPIC -fPIE
+OBJS := entry.o elf.o memcmp.o memcpy.o memmove.o memset.o
+$(OBJS): CFLAGS += -fPIC
DEPS := $(patsubst %.o,%.d,$(OBJS))
diff --git a/shim/entry.c b/shim/entry.c
index 303f582..a4d00c7 100644
--- a/shim/entry.c
+++ b/shim/entry.c
@@ -49,7 +49,11 @@ EFI_STATUS efi_shim_entry(struct efi_loader_image *image,
* 3. exit boot services
* 5. ???????????
*/
-
+
+ void *image_base = (void *)image->buffer_base;
+
+ elf_reloc(image_base);
+
EFI_STATUS status;
if (!image)