]> git.baikalelectronics.ru Git - kernel.git/commit
scripts/kallsyms: fix offset overflow of kallsyms_relative_base
authorMasahiro Yamada <masahiroy@kernel.org>
Mon, 9 Dec 2019 03:51:48 +0000 (12:51 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 14 Dec 2019 06:53:04 +0000 (15:53 +0900)
commit2c22f7842213337176214189d108a0ec6ba51385
tree63ef989fe5aebaf326f916db8535dcb3683209ef
parentcc86645973c0abb0ae02f6248fbf7444d8e7ce42
scripts/kallsyms: fix offset overflow of kallsyms_relative_base

Since commit 9be285aaba93 ("scripts/kallsyms: shrink table before
sorting it"), kallsyms_relative_base can be larger than _text, which
causes overflow when building the 32-bit kernel.

https://lkml.org/lkml/2019/12/7/156

This is because _text is, unless --all-symbols is specified, now
trimmed from the symbol table before record_relative_base() is called.

Handle the offset signedness also for kallsyms_relative_base. Introduce
a new helper, output_address(), to reduce the code duplication.

Fixes: 9be285aaba93 ("scripts/kallsyms: shrink table before sorting it")
Reported-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kallsyms.c