Commit d8ed1902 authored by Gaosheng Cui's avatar Gaosheng Cui Committed by Zheng Zengkai
Browse files

arm32: kaslr: Bugfix of BSS size calculation when enabled kaslr



hulk inclusion
category: bugfix
bugzilla: 55083
CVE: NA

------------------------------------------------------------------------

Gcc flag '-fvisibility=hidden' specifies the visibility attribute for external linkage entities in object files.
You can also selectively set visibility attributes for entities by using pairs of the #pragma GCC visibility push
and #pragma GCC visibility pop compiler directives throughout your source program.when we include the hidden.h,
__bss_start and __bss_end went from global symbol to local symbol,so we need to modify the regular expression to
accommodate this change.

Fixes: 27fdadbf34d2 ("[Backport] ARM: 9056/1: decompressor: fix BSS size calculation for LLVM ld.lld")
Signed-off-by: default avatarGaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent de6dfa19
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -127,8 +127,8 @@ asflags-y := -DZIMAGE

# Supply kernel BSS size to the decompressor via a linker symbol.
KBSS_SZ = $(shell echo $$(($$($(NM) $(obj)/../../../../vmlinux | \
		sed -n -e 's/^\([^ ]*\) [ABD] __bss_start$$/-0x\1/p' \
		       -e 's/^\([^ ]*\) [ABD] __bss_stop$$/+0x\1/p') )) )
		sed -n -e 's/^\([^ ]*\) [ABbD] __bss_start$$/-0x\1/p' \
		       -e 's/^\([^ ]*\) [ABbD] __bss_stop$$/+0x\1/p') )) )
LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ)
# Supply ZRELADDR to the decompressor via a linker symbol.
ifneq ($(CONFIG_AUTO_ZRELADDR),y)