mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
0391fcb5e1
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>
14 lines
341 B
Makefile
14 lines
341 B
Makefile
# 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)
|