• David Gow's avatar
    arch: um: Fix build for statically linked UML w/ constructors · 99ac1e23
    David Gow authored
    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: default avatarDavid Gow <davidgow@google.com>
    Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
    99ac1e23
uml.lds.S 2.55 KB