aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-01-17 10:54:40 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2013-01-17 10:54:40 -0800
commit755ec12eac1030fc9dbffc9594386e07d0153b04 (patch)
tree48c1f5c736246a846a66f60108c4f8763d493bd9
parent8f2de46e618a39054fd6e86602391af8da5fcbac (diff)
downloadsyslinux-755ec12eac1030fc9dbffc9594386e07d0153b04.tar.gz
syslinux-755ec12eac1030fc9dbffc9594386e07d0153b04.tar.xz
syslinux-755ec12eac1030fc9dbffc9594386e07d0153b04.zip
Always strip all the modules
Always strip the modules; they are too big unstripped. Specifically, we generate unstripped *.elf files, and then convert them to stripped *.c32 files. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--com32/chain/Makefile2
-rw-r--r--com32/cmenu/Makefile9
-rw-r--r--com32/elflink/ldlinux/Makefile6
-rw-r--r--com32/gfxboot/Makefile2
-rw-r--r--com32/gpllib/Makefile4
-rw-r--r--com32/hdt/Makefile2
-rw-r--r--com32/lib/Makefile4
-rw-r--r--com32/libutil/Makefile5
-rw-r--r--com32/lua/src/Makefile7
-rw-r--r--com32/mboot/Makefile2
-rw-r--r--com32/menu/Makefile4
-rw-r--r--com32/modules/Makefile2
-rw-r--r--com32/sysdump/Makefile2
-rw-r--r--mk/elf.mk6
-rw-r--r--mk/lib.mk3
15 files changed, 35 insertions, 25 deletions
diff --git a/com32/chain/Makefile b/com32/chain/Makefile
index 9a298fae..ed37ffa3 100644
--- a/com32/chain/Makefile
+++ b/com32/chain/Makefile
@@ -20,7 +20,7 @@ OBJS = chain.o partiter.o utility.o options.o mangle.o
all: chain.c32
-chain.c32: $(OBJS) $(C_LIBS)
+chain.elf: $(OBJS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
%.o: %.c
diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile
index 181937bd..f827afd2 100644
--- a/com32/cmenu/Makefile
+++ b/com32/cmenu/Makefile
@@ -44,14 +44,15 @@ MENUS = $(LIBS) $(CMENUS) $(IMENUS)
all: menus
-libmenu/libmenu.c32: $(LIBMENU)
- $(LD) -shared $(LDFLAGS) -o $@ $^
+libmenu/libmenu.elf: $(LIBMENU)
+ $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) \
+ -o $@ $^
tidy dist:
- rm -f *.o *.lo *.c32 *.lst *.elf .*.d */.*.d
+ rm -f *.o *.lo *.lst *.elf */*.o */*.elf .*.d */.*.d
libclean:
- rm -f libmenu/*.o libmenu/*.c32
+ rm -f libmenu/*.c32
clean: tidy menuclean libclean
rm -f *.lss *.c32 *.com
diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile
index fa53226e..b2d0cecb 100644
--- a/com32/elflink/ldlinux/Makefile
+++ b/com32/elflink/ldlinux/Makefile
@@ -1,6 +1,6 @@
## -----------------------------------------------------------------------
##
-## Copyright 2011 Intel Corporation - All Rights Reserved
+## Copyright 2011-2013 Intel Corporation - All Rights Reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@@ -21,10 +21,10 @@ BTARGET = ldlinux.c32
all: $(BTARGET) ldlinux_lnx.a
-ldlinux.c32 : ldlinux.o cli.o readconfig.o refstr.o colors.o getadv.o \
+ldlinux.elf : ldlinux.o cli.o readconfig.o refstr.o colors.o getadv.o \
adv.o execute.o chainboot.o kernel.o get_key.o \
advwrite.o setadv.o eprintf.o loadhigh.o msg.o
- $(LD) $(LDFLAGS) -soname $(@F) -o $@ $^ $(LIBS)
+ $(LD) $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^ $(LIBS)
LNXCFLAGS += -D__export='__attribute__((visibility("default")))'
LNXLIBOBJS = get_key.lo
diff --git a/com32/gfxboot/Makefile b/com32/gfxboot/Makefile
index f2a73762..bd0bab11 100644
--- a/com32/gfxboot/Makefile
+++ b/com32/gfxboot/Makefile
@@ -19,7 +19,7 @@ MODULES = gfxboot.c32
all: $(MODULES)
-gfxboot.c32 : gfxboot.o realmode_callback.o $(LIBS) $(C_LIBS)
+gfxboot.elf : gfxboot.o realmode_callback.o $(LIBS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
realmode_callback.o: realmode_callback.asm
diff --git a/com32/gpllib/Makefile b/com32/gpllib/Makefile
index 053e8642..c704866b 100644
--- a/com32/gpllib/Makefile
+++ b/com32/gpllib/Makefile
@@ -21,8 +21,8 @@ COM32DIR = $(AUXDIR)/com32
all: libcom32gpl.c32
-libcom32gpl.c32 : $(LIBOBJS)
- $(LD) -shared $(LDFLAGS) -soname $(@F) -o $@ $^
+libcom32gpl.elf : $(LIBOBJS)
+ $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
tidy dist clean:
find . \( -name \*.o -o -name .\*.d -o -name \*.tmp \) -print0 | \
diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile
index d264b5ba..42f5c0d1 100644
--- a/com32/hdt/Makefile
+++ b/com32/hdt/Makefile
@@ -52,7 +52,7 @@ QEMU ?= qemu-kvm
all: $(MODULES) $(TESTFILES)
-hdt.c32 : $(OBJS) $(LIBS) $(C_LIBS)
+hdt.elf : $(OBJS) $(LIBS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
memtest:
diff --git a/com32/lib/Makefile b/com32/lib/Makefile
index 7806230b..dd1ef7c6 100644
--- a/com32/lib/Makefile
+++ b/com32/lib/Makefile
@@ -214,9 +214,9 @@ COM32DIR = $(AUXDIR)/com32
all: libcom32.c32 libcom32min.a libcom32core.a
-libcom32.c32 : $(LIBOBJS)
+libcom32.elf : $(LIBOBJS)
rm -f $@
- $(LD) -shared $(LDFLAGS) -soname $(@F) -o $@ $^
+ $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
libcom32min.a : $(MINLIBOBJS)
rm -f $@
diff --git a/com32/libutil/Makefile b/com32/libutil/Makefile
index fb437dc7..42f69dcf 100644
--- a/com32/libutil/Makefile
+++ b/com32/libutil/Makefile
@@ -41,8 +41,9 @@ LNXLIBOBJS = $(patsubst %.o,%.lo,$(LIBOBJS))
all: libutil_com.c32 libutil_lnx.a
-libutil_com.c32: $(LIBOBJS)
- $(LD) $(LDFLAGS) -soname $(@F) -o $@ $^
+.PRECIOUS: libutil_com.elf
+libutil_com.elf: $(LIBOBJS)
+ $(LD) $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
libutil_lnx.a: $(LNXLIBOBJS)
rm -f $@
diff --git a/com32/lua/src/Makefile b/com32/lua/src/Makefile
index 01d1f81c..d70d23ea 100644
--- a/com32/lua/src/Makefile
+++ b/com32/lua/src/Makefile
@@ -50,10 +50,11 @@ CFLAGS += -DLUA_ANSI
all: $(MODULES) $(TESTFILES)
-$(LIBLUA) : $(LIBLUA_OBJS)
- $(LD) -shared $(LDFLAGS) -o $@ $^
+liblua.elf : $(LIBLUA_OBJS)
+ $(LD) $(LDFLAGS) -shared -soname $(patsubst %.elf,%.c32,$(@F)) \
+ -o $@ $^
-lua.c32 : $(OBJS) $(LIBLUA) $(C_LIBS)
+lua.elf : $(OBJS) $(LIBLUA) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
tidy dist:
diff --git a/com32/mboot/Makefile b/com32/mboot/Makefile
index 02e9f49e..6e010b1c 100644
--- a/com32/mboot/Makefile
+++ b/com32/mboot/Makefile
@@ -28,7 +28,7 @@ OBJS = mboot.o map.o mem.o initvesa.o apm.o solaris.o syslinux.o
all: $(MODULES) $(TESTFILES)
-mboot.c32 : $(OBJS) $(C_LIBS)
+mboot.elf : $(OBJS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
tidy dist:
diff --git a/com32/menu/Makefile b/com32/menu/Makefile
index b7719456..e62c6b87 100644
--- a/com32/menu/Makefile
+++ b/com32/menu/Makefile
@@ -28,10 +28,10 @@ COMMONOBJS = menumain.o readconfig.o passwd.o drain.o printmsg.o colors.o \
all: $(MODULES) $(TESTFILES)
-menu.c32 : menu.o $(COMMONOBJS) $(C_LIBS)
+menu.elf : menu.o $(COMMONOBJS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
-vesamenu.c32 : vesamenu.o $(COMMONOBJS) $(C_LIBS)
+vesamenu.elf : vesamenu.o $(COMMONOBJS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
tidy dist:
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index 9cf4da8e..628fa5d6 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -35,7 +35,7 @@ all: $(MODULES) $(TESTFILES)
dmitest.o: dmitest.c
$(CC) $(CFLAGS) $(GPLINCLUDE) -c -o $@ $<
-dmitest.c32 : dmi_utils.o dmitest.o $(C_LIBS)
+dmitest.elf : dmi_utils.o dmitest.o $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
tidy dist:
diff --git a/com32/sysdump/Makefile b/com32/sysdump/Makefile
index 8763b3c8..7d42ae0c 100644
--- a/com32/sysdump/Makefile
+++ b/com32/sysdump/Makefile
@@ -45,7 +45,7 @@ CFLAGS += -DDATE='"$(DATE)"'
all: $(MODULES) $(TESTFILES)
-sysdump.c32 : $(OBJS) $(LIBS) $(C_LIBS)
+sysdump.elf : $(OBJS) $(LIBS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
tidy dist:
diff --git a/mk/elf.mk b/mk/elf.mk
index 160dadcc..f759b70f 100644
--- a/mk/elf.mk
+++ b/mk/elf.mk
@@ -81,5 +81,9 @@ C_LNXLIBS = $(com32)/libutil/libutil_lnx.a \
%.lnx: %.lo $(LNXLIBS) $(C_LNXLIBS)
$(CC) $(LNXCFLAGS) -o $@ $^
-%.c32: %.o $(C_LIBS)
+.PRECIOUS: %.elf
+%.elf: %.o $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
+
+%.c32: %.elf
+ $(OBJCOPY) --strip-debug --strip-unneeded $< $@
diff --git a/mk/lib.mk b/mk/lib.mk
index ea817e66..ca8e41ba 100644
--- a/mk/lib.mk
+++ b/mk/lib.mk
@@ -79,3 +79,6 @@ LDFLAGS = -m elf_i386 --hash-style=gnu -T $(com32)/lib/elf32.ld
.c.ls:
$(CC) $(MAKEDEPS) $(CFLAGS) $(SOFLAGS) -S -o $@ $<
+
+%.c32: %.elf
+ $(OBJCOPY) --strip-debug --strip-unneeded $< $@