diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2018-05-03 16:40:13 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-05-09 10:55:01 +0200 |
commit | 0391fcb5e1f8f10d4cf491ec2ea107a2e6a937f7 (patch) | |
tree | 91915a3b8b42f466fe565991387e589376e37e33 /arch/s390/scripts | |
parent | 971a9ca6259752c04da09535707d08ccc5d1ed4b (diff) | |
download | linux-0391fcb5e1f8f10d4cf491ec2ea107a2e6a937f7.tar.bz2 |
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>
Diffstat (limited to 'arch/s390/scripts')
-rw-r--r-- | arch/s390/scripts/Makefile.chkbss | 14 |
1 files changed, 14 insertions, 0 deletions
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 @@ +# SPDX-License-Identifier: GPL-2.0 + +quiet_cmd_chkbss = CHKBSS $< +define cmd_chkbss + if ! $(OBJDUMP) -j .bss -w -h $< | awk 'END { if ($$3) exit 1 }'; then \ + echo "error: $< .bss section is not empty" >&2; exit 1; \ + fi; \ + touch $@; +endef + +$(obj)/built-in.a: $(patsubst %, $(obj)/%.chkbss, $(chkbss)) + +%.o.chkbss: %.o + $(call cmd,chkbss) |