aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2018-05-03 10:40:13 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-05-09 04:55:01 -0400
commit0391fcb5e1f8f10d4cf491ec2ea107a2e6a937f7 (patch)
tree91915a3b8b42f466fe565991387e589376e37e33
parent971a9ca6259752c04da09535707d08ccc5d1ed4b (diff)
s390: introduce compile time check for empty .bss section
Introduce compile time check for files which should avoid using .bss section, because of the following reasons: - .bss section has not been zeroed yet, - initrd has not been moved to a safe location and could be overlapping with .bss section. Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/kernel/Makefile3
-rw-r--r--arch/s390/lib/Makefile3
-rw-r--r--arch/s390/scripts/Makefile.chkbss14
-rw-r--r--drivers/s390/char/Makefile3
4 files changed, 23 insertions, 0 deletions
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index b5146697ab50..2fed39b26b42 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -98,3 +98,6 @@ obj-$(CONFIG_TRACEPOINTS) += trace.o
98# vdso 98# vdso
99obj-y += vdso64/ 99obj-y += vdso64/
100obj-$(CONFIG_COMPAT) += vdso32/ 100obj-$(CONFIG_COMPAT) += vdso32/
101
102chkbss := head.o head64.o als.o early_nobss.o
103include $(srctree)/arch/s390/scripts/Makefile.chkbss
diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile
index 9bfe0802684b..57ab40188d4b 100644
--- a/arch/s390/lib/Makefile
+++ b/arch/s390/lib/Makefile
@@ -8,3 +8,6 @@ obj-y += mem.o xor.o
8lib-$(CONFIG_SMP) += spinlock.o 8lib-$(CONFIG_SMP) += spinlock.o
9lib-$(CONFIG_KPROBES) += probes.o 9lib-$(CONFIG_KPROBES) += probes.o
10lib-$(CONFIG_UPROBES) += probes.o 10lib-$(CONFIG_UPROBES) += probes.o
11
12chkbss := mem.o
13include $(srctree)/arch/s390/scripts/Makefile.chkbss
diff --git a/arch/s390/scripts/Makefile.chkbss b/arch/s390/scripts/Makefile.chkbss
new file mode 100644
index 000000000000..d92f2d94a5d9
--- /dev/null
+++ b/arch/s390/scripts/Makefile.chkbss
@@ -0,0 +1,14 @@
1# SPDX-License-Identifier: GPL-2.0
2
3quiet_cmd_chkbss = CHKBSS $<
4define cmd_chkbss
5 if ! $(OBJDUMP) -j .bss -w -h $< | awk 'END { if ($$3) exit 1 }'; then \
6 echo "error: $< .bss section is not empty" >&2; exit 1; \
7 fi; \
8 touch $@;
9endef
10
11$(obj)/built-in.a: $(patsubst %, $(obj)/%.chkbss, $(chkbss))
12
13%.o.chkbss: %.o
14 $(call cmd,chkbss)
diff --git a/drivers/s390/char/Makefile b/drivers/s390/char/Makefile
index d049e2d74484..0a4c13e1e76e 100644
--- a/drivers/s390/char/Makefile
+++ b/drivers/s390/char/Makefile
@@ -54,3 +54,6 @@ obj-$(CONFIG_CRASH_DUMP) += sclp_sdias.o zcore.o
54 54
55hmcdrv-objs := hmcdrv_mod.o hmcdrv_dev.o hmcdrv_ftp.o hmcdrv_cache.o diag_ftp.o sclp_ftp.o 55hmcdrv-objs := hmcdrv_mod.o hmcdrv_dev.o hmcdrv_ftp.o hmcdrv_cache.o diag_ftp.o sclp_ftp.o
56obj-$(CONFIG_HMC_DRV) += hmcdrv.o 56obj-$(CONFIG_HMC_DRV) += hmcdrv.o
57
58chkbss := sclp_early_core.o
59include $(srctree)/arch/s390/scripts/Makefile.chkbss