Skip to content

Commit 99ac1e2

Browse files
sulixrichardweinberger
authored andcommitted
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 <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 40d3408 commit 99ac1e2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/um/kernel/uml.lds.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ SECTIONS
9595
}
9696

9797
.got : { *(.got.plt) *(.got) }
98+
.eh_frame : { KEEP (*(.eh_frame)) }
9899
.dynamic : { *(.dynamic) }
99100
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
100101
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }

0 commit comments

Comments
 (0)