VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / arch / arm / boot / compressed / Makefile
index dc06c21..951fbf6 100644 (file)
@@ -3,9 +3,6 @@
 #
 # create a compressed vmlinuz image from the original vmlinux
 #
-# Note! ZTEXTADDR, ZBSSADDR and ZRELADDR are now exported
-# from arch/arm/boot/Makefile
-#
 
 HEAD   = head.o
 OBJS   = misc.o
@@ -16,7 +13,6 @@ FONTC = drivers/video/console/font_acorn_8x8.c
 #
 ifeq ($(CONFIG_ARCH_ACORN),y)
 OBJS           += ll_char_wr.o font.o
-CFLAGS_misc.o  := -DPARAMS_PHYS=$(PARAMS_PHYS)
 endif
 
 ifeq ($(CONFIG_ARCH_SHARK),y)
@@ -27,10 +23,6 @@ ifeq ($(CONFIG_ARCH_CAMELOT),y)
 OBJS           += head-epxa10db.o
 endif
 
-ifeq ($(CONFIG_ARCH_FTVPCI),y)
-OBJS           += head-ftvpci.o
-endif
-
 ifeq ($(CONFIG_ARCH_L7200),y)
 OBJS           += head-l7200.o
 endif
@@ -59,36 +51,57 @@ ifeq ($(CONFIG_DEBUG_ICEDCC),y)
 OBJS            += ice-dcc.o
 endif
 
-SEDFLAGS       = s/TEXT_START/$(ZTEXTADDR)/;s/LOAD_ADDR/$(ZRELADDR)/;s/BSS_START/$(ZBSSADDR)/
+#
+# We now have a PIC decompressor implementation.  Decompressors running
+# from RAM should not define ZTEXTADDR.  Decompressors running directly
+# from ROM or Flash must define ZTEXTADDR (preferably via the config)
+# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
+ifeq ($(CONFIG_ZBOOT_ROM),y)
+ZTEXTADDR      := $(CONFIG_ZBOOT_ROM_TEXT)
+ZBSSADDR       := $(CONFIG_ZBOOT_ROM_BSS)
+else
+ZTEXTADDR      := 0
+ZBSSADDR       := ALIGN(4)
+endif
+
+SEDFLAGS       = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
 
-targets       := vmlinux vmlinux.lds piggy piggy.gz piggy.o \
-                 font.o head.o $(OBJS)
+targets       := vmlinux vmlinux.lds piggy.gz piggy.o font.o \
+                head.o misc.o $(OBJS)
 EXTRA_CFLAGS  := -fpic
 EXTRA_AFLAGS  :=
 
-LDFLAGS_vmlinux := -p --no-undefined -X \
+# Supply ZRELADDR, INITRD_PHYS and PARAMS_PHYS to the decompressor via
+# linker symbols.  We only define initrd_phys and params_phys if the
+# machine class defined the corresponding makefile variable.
+LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
+ifneq ($(INITRD_PHYS),)
+LDFLAGS_vmlinux += --defsym initrd_phys=$(INITRD_PHYS)
+endif
+ifneq ($(PARAMS_PHYS),)
+LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS)
+endif
+LDFLAGS_vmlinux += -p --no-undefined -X \
        $(shell $(CC) $(CFLAGS) --print-libgcc-file-name) -T
 
+# Don't allow any static data in misc.o, which
+# would otherwise mess up our GOT table
+CFLAGS_misc.o := -Dstatic=
+
 $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \
                $(addprefix $(obj)/, $(OBJS)) FORCE
        $(call if_changed,ld)
        @:
 
-
-$(obj)/piggy: vmlinux FORCE
-       $(call if_changed,objcopy)
-
-$(obj)/piggy.gz: $(obj)/piggy FORCE
+$(obj)/piggy.gz: $(obj)/../Image FORCE
        $(call if_changed,gzip)
 
-LDFLAGS_piggy.o := -r -b binary
 $(obj)/piggy.o:  $(obj)/piggy.gz FORCE
-       $(call if_changed,ld)
 
 CFLAGS_font.o := -Dstatic=
 $(obj)/font.o: $(FONTC)
 
-$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in Makefile arch/arm/boot/Makefile .config
+$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
        @sed "$(SEDFLAGS)" < $< > $@
 
 $(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c