summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2014-09-21 13:11:11 -0400
committerPeter Jones <pjones@redhat.com>2014-09-21 16:25:27 -0400
commit6744a7ef8eca44948565c3d1244ec931ed3f6fee (patch)
tree0a0de23c784ad9a20c1f8f37e60bb2e7ef2d4e29 /Makefile
parent0e7ba5947eb38b79de2051ecf3b95055e620475c (diff)
downloadefi-boot-shim-6744a7ef8eca44948565c3d1244ec931ed3f6fee.tar.gz
efi-boot-shim-6744a7ef8eca44948565c3d1244ec931ed3f6fee.zip
Do the same for ia32...
Once again, on ia32 this time, we see: 00000120 47 84 00 00 0a 00 00 00 00 00 00 00 00 00 00 00 |G...............| Which is where the pointer on ia32 for the Base Relocation Table should be. It points to 0x8447, which isn't a particularly reasonable address as numbers go, and happens to have this data there: 00008440 6f 00 6e 00 66 00 69 00 67 00 75 00 72 00 65 00 |o.n.f.i.g.u.r.e.| 00008450 00 00 49 00 50 00 76 00 36 00 28 00 00 00 2c 00 |..I.P.v.6.(...,.| 00008460 25 00 73 00 2c 00 00 00 29 00 00 00 25 00 64 00 |%.s.,...)...%.d.| 00008470 2e 00 25 00 64 00 2e 00 25 00 64 00 2e 00 25 00 |..%.d...%.d...%.| 00008480 64 00 00 00 44 00 48 00 43 00 50 00 00 00 49 00 |d...D.H.C.P...I.| 00008490 50 00 76 00 34 00 28 00 00 00 2c 00 25 00 73 00 |P.v.4.(...,.%.s.| And so that table is, in theory, this part: 00008447 00 67 00 75 00 72 00 65 00 | .g.u.r.e.| 00008450 00 |. | Which is pretty clearly not a pointer table of any kind. So give ia32 the same treatment as x86_64, and now all arches work basically the same. Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 17 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index d5fd55be..a52984f0 100644
--- a/Makefile
+++ b/Makefile
@@ -6,19 +6,25 @@ ARCH = $(shell $(CC) -dumpmachine | cut -f1 -d- | sed s,i[3456789]86,ia32,)
SUBDIRS = Cryptlib lib
-LIB_PATH = /usr/lib64
-
EFI_INCLUDE := /usr/include/efi
EFI_INCLUDES = -nostdinc -ICryptlib -ICryptlib/Include -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -Iinclude
-EFI_PATH := /usr/lib64/gnuefi
+ifeq ($(ARCH),ia32)
+LIB_PATH := /usr/lib
+EFI_PATH := /usr/lib/gnuefi
+endif
+LIB_PATH ?= /usr/lib64
+EFI_PATH ?= /usr/lib64/gnuefi
LIB_GCC = $(shell $(CC) -print-libgcc-file-name)
EFI_LIBS = -lefi -lgnuefi --start-group Cryptlib/libcryptlib.a Cryptlib/OpenSSL/libopenssl.a --end-group $(LIB_GCC)
ifeq ($(ARCH),x86_64)
EFI_CRT_OBJS := crt0-efi-$(ARCH).o
-endif
+else ifeq ($(ARCH),ia32)
+EFI_CRT_OBJS := crt0-efi-$(ARCH).o
+else
EFI_CRT_OBJS ?= $(EFI_PATH)/crt0-efi-$(ARCH).o
+endif
EFI_LDS = elf_$(ARCH)_efi.lds
DEFAULT_LOADER := \\\\grub.efi
@@ -137,9 +143,15 @@ SUBSYSTEM := 0xa
LDFLAGS += --defsym=EFI_SUBSYSTEM=$(SUBSYSTEM)
endif
+ifeq ($(ARCH),ia32)
+FORMAT := -O binary
+SUBSYSTEM := 0xa
+LDFLAGS += --defsym=EFI_SUBSYSTEM=$(SUBSYSTEM)
+endif
+
FORMAT ?= --target efi-app-$(ARCH)
-crt0-efi-x86_64.o : crt0-efi-x86_64.S
+crt0-efi-$(ARCH).o : crt0-efi-$(ARCH).S
$(CC) $(CFLAGS) -DEFI_SUBSYSTEM=$(SUBSYSTEM) -c -o $@ $<
%.efi: %.so