]> git.baikalelectronics.ru Git - kernel.git/commit
arch: um: Fix build for statically linked UML w/ constructors
authorDavid Gow <davidgow@google.com>
Thu, 26 May 2022 18:54:02 +0000 (11:54 -0700)
committerRichard Weinberger <richard@nod.at>
Sun, 17 Jul 2022 21:14:34 +0000 (23:14 +0200)
commit4734d3d4b0efe3b979c343ab30caebb6b6b6b9ec
treecce73af0dca77fb7526523cd47ab97e93cd5d1d5
parent0f68b086be3c4285e097498dc8a2b0bf32b73a00
arch: um: Fix build for statically linked UML w/ constructors

If CONFIG_CONSTUCTORS is enabled on a statically linked
(CONFIG_STATIC_LINK=y) build of UML, the build fails due to the
.eh_frame section being both used and discarded:

ERROR:root:`.eh_frame' referenced in section `.text' of /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o: defined in discarded section `.eh_frame' of /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o
`.eh_frame' referenced in section `.text' of /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o: defined in discarded section `.eh_frame' of /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o

Instead, keep the .eh_frame section, as we do in dyn.lds.S for
dynamically linked UML.

This can be reproduced with:
./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_STATIC_LINK=y --kconfig_add CONFIG_GCOV_KERNEL=y --kconfig_add CONFIG_DEBUG_FS=y

Signed-off-by: David Gow <davidgow@google.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/kernel/uml.lds.S