aboutsummaryrefslogtreecommitdiffstats
path: root/com32/MCONFIG
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-24 19:01:02 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-24 19:01:02 -0700
commit04e7c2784dd3fd45090d1ddb31905dd7a9b921a3 (patch)
treefbe5e2df0e93dddcb4b34d44755d433d84663f38 /com32/MCONFIG
parent24ffb34fcff5b50b56d987e18dcf519e278c771e (diff)
downloadsyslinux-04e7c2784dd3fd45090d1ddb31905dd7a9b921a3.tar.gz
syslinux-04e7c2784dd3fd45090d1ddb31905dd7a9b921a3.tar.xz
syslinux-04e7c2784dd3fd45090d1ddb31905dd7a9b921a3.zip
com32: make com32 modules self-relocating (COM32R)
Introduce a new "COM32R" format, which is exactly like COM32 except that they contain position-independent code. Therefore, the core can load them at any sufficiently aligned address; by protocol select 4K as the alignment. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/MCONFIG')
-rw-r--r--com32/MCONFIG9
1 files changed, 6 insertions, 3 deletions
diff --git a/com32/MCONFIG b/com32/MCONFIG
index e02ec67c..2136176d 100644
--- a/com32/MCONFIG
+++ b/com32/MCONFIG
@@ -1,5 +1,5 @@
## -*- makefile -*- -------------------------------------------------------
-##
+##
## Copyright 2008-2009 H. Peter Anvin - All Rights Reserved
## Copyright 2009 Intel Corporation; author: H. Peter Anvin
##
@@ -20,9 +20,11 @@ include $(topdir)/MCONFIG
GCCOPT := $(call gcc_ok,-std=gnu99,) \
$(call gcc_ok,-m32,) \
$(call gcc_ok,-fno-stack-protector,) \
+ $(call gcc_ok,-fPIE,-fPIC) \
-mregparm=3 -DREGPARM=3 -march=i386 -Os
-com32 = $(topdir)/com32
+com32 := $(topdir)/com32
+RELOCS := $(com32)/tools/relocs
ifneq ($(NOGPL),1)
GPLLIB = $(com32)/gpllib/libcom32gpl.a
@@ -41,7 +43,7 @@ SFLAGS = $(GCCOPT) -W -Wall -march=i386 \
-nostdinc -iwithprefix include \
-I$(com32)/libutil/include -I$(com32)/include $(GPLINCLUDE)
-LDFLAGS = -m elf_i386 -T $(com32)/lib/com32.ld
+LDFLAGS = -m elf_i386 --emit-relocs -T $(com32)/lib/com32.ld
LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc)
LNXCFLAGS = -I$(com32)/libutil/include -W -Wall -O -g -D_GNU_SOURCE
@@ -80,3 +82,4 @@ C_LNXLIBS = $(com32)/libutil/libutil_lnx.a
%.c32: %.elf
$(OBJCOPY) -O binary $< $@
+ $(RELOCS) $< >> $@