diff options
Diffstat (limited to 'arch/arm/boot/compressed/Makefile')
-rw-r--r-- | arch/arm/boot/compressed/Makefile | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 0c74a6fab952..21f56ff32797 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
@@ -26,6 +26,10 @@ HEAD = head.o | |||
26 | OBJS += misc.o decompress.o | 26 | OBJS += misc.o decompress.o |
27 | FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c | 27 | FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c |
28 | 28 | ||
29 | # string library code (-Os is enforced to keep it much smaller) | ||
30 | OBJS += string.o | ||
31 | CFLAGS_string.o := -Os | ||
32 | |||
29 | # | 33 | # |
30 | # Architecture dependencies | 34 | # Architecture dependencies |
31 | # | 35 | # |
@@ -89,21 +93,41 @@ suffix_$(CONFIG_KERNEL_GZIP) = gzip | |||
89 | suffix_$(CONFIG_KERNEL_LZO) = lzo | 93 | suffix_$(CONFIG_KERNEL_LZO) = lzo |
90 | suffix_$(CONFIG_KERNEL_LZMA) = lzma | 94 | suffix_$(CONFIG_KERNEL_LZMA) = lzma |
91 | 95 | ||
96 | # Borrowed libfdt files for the ATAG compatibility mode | ||
97 | |||
98 | libfdt := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c | ||
99 | libfdt_hdrs := fdt.h libfdt.h libfdt_internal.h | ||
100 | |||
101 | libfdt_objs := $(addsuffix .o, $(basename $(libfdt))) | ||
102 | |||
103 | $(addprefix $(obj)/,$(libfdt) $(libfdt_hdrs)): $(obj)/%: $(srctree)/scripts/dtc/libfdt/% | ||
104 | $(call cmd,shipped) | ||
105 | |||
106 | $(addprefix $(obj)/,$(libfdt_objs) atags_to_fdt.o): \ | ||
107 | $(addprefix $(obj)/,$(libfdt_hdrs)) | ||
108 | |||
109 | ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y) | ||
110 | OBJS += $(libfdt_objs) atags_to_fdt.o | ||
111 | endif | ||
112 | |||
92 | targets := vmlinux vmlinux.lds \ | 113 | targets := vmlinux vmlinux.lds \ |
93 | piggy.$(suffix_y) piggy.$(suffix_y).o \ | 114 | piggy.$(suffix_y) piggy.$(suffix_y).o \ |
94 | font.o font.c head.o misc.o $(OBJS) | 115 | lib1funcs.o lib1funcs.S font.o font.c head.o misc.o $(OBJS) |
95 | 116 | ||
96 | # Make sure files are removed during clean | 117 | # Make sure files are removed during clean |
97 | extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S | 118 | extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S $(libfdt) $(libfdt_hdrs) |
98 | 119 | ||
99 | ifeq ($(CONFIG_FUNCTION_TRACER),y) | 120 | ifeq ($(CONFIG_FUNCTION_TRACER),y) |
100 | ORIG_CFLAGS := $(KBUILD_CFLAGS) | 121 | ORIG_CFLAGS := $(KBUILD_CFLAGS) |
101 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) | 122 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) |
102 | endif | 123 | endif |
103 | 124 | ||
104 | ccflags-y := -fpic -fno-builtin | 125 | ccflags-y := -fpic -fno-builtin -I$(obj) |
105 | asflags-y := -Wa,-march=all | 126 | asflags-y := -Wa,-march=all |
106 | 127 | ||
128 | # Supply kernel BSS size to the decompressor via a linker symbol. | ||
129 | KBSS_SZ = $(shell size $(obj)/../../../../vmlinux | awk 'END{print $$3}') | ||
130 | LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) | ||
107 | # Supply ZRELADDR to the decompressor via a linker symbol. | 131 | # Supply ZRELADDR to the decompressor via a linker symbol. |
108 | ifneq ($(CONFIG_AUTO_ZRELADDR),y) | 132 | ifneq ($(CONFIG_AUTO_ZRELADDR),y) |
109 | LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR) | 133 | LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR) |
@@ -123,7 +147,7 @@ LDFLAGS_vmlinux += -T | |||
123 | # For __aeabi_uidivmod | 147 | # For __aeabi_uidivmod |
124 | lib1funcs = $(obj)/lib1funcs.o | 148 | lib1funcs = $(obj)/lib1funcs.o |
125 | 149 | ||
126 | $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE | 150 | $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S |
127 | $(call cmd,shipped) | 151 | $(call cmd,shipped) |
128 | 152 | ||
129 | # We need to prevent any GOTOFF relocs being used with references | 153 | # We need to prevent any GOTOFF relocs being used with references |
@@ -139,8 +163,16 @@ bad_syms=$$($(CROSS_COMPILE)nm $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \ | |||
139 | ( echo "following symbols must have non local/private scope:" >&2; \ | 163 | ( echo "following symbols must have non local/private scope:" >&2; \ |
140 | echo "$$bad_syms" >&2; rm -f $@; false ) | 164 | echo "$$bad_syms" >&2; rm -f $@; false ) |
141 | 165 | ||
166 | check_for_multiple_zreladdr = \ | ||
167 | if [ $(words $(ZRELADDR)) -gt 1 -a "$(CONFIG_AUTO_ZRELADDR)" = "" ]; then \ | ||
168 | echo 'multiple zreladdrs: $(ZRELADDR)'; \ | ||
169 | echo 'This needs CONFIG_AUTO_ZRELADDR to be set'; \ | ||
170 | false; \ | ||
171 | fi | ||
172 | |||
142 | $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ | 173 | $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ |
143 | $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE | 174 | $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE |
175 | @$(check_for_multiple_zreladdr) | ||
144 | $(call if_changed,ld) | 176 | $(call if_changed,ld) |
145 | @$(check_for_bad_syms) | 177 | @$(check_for_bad_syms) |
146 | 178 | ||