UML: define RUNTIME_DISCARD_EXIT
PATCH 1/1 UML: define RUNTIME_DISCARD_EXIT
With CONFIG_VIRTIO_UML=y, GNU ld < 2.36 fails to link UML vmlinux (w/wo CONFIG_LD_SCRIPT_STATIC).
.exit.text' referenced in section .uml.exitcall.exit' of arch/um/drivers/virtio_uml.o: defined in discarded section `.exit.text' of arch/um/drivers/virtio_uml.o
collect2: error: ld returned 1 exit status
This fix is similar to the following commits:
- 4b9880dbf3bd ("powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT")
- a494398bde27 ("s390: define RUNTIME_DISCARD_EXIT to fix link error with GNU ld < 2.36")
- c1c551bebf92 ("sh: define RUNTIME_DISCARD_EXIT")
---
arch/um/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/kernel/vmlinux.lds.S +1 -1
@@ -1,4 +1,4 @@ - +#define RUNTIME_DISCARD_EXIT KERNEL_STACK_SIZE = 4096 * (1 << CONFIG_KERNEL_STACK_ORDER); #ifdef CONFIG_LD_SCRIPT_STATIC
Signature · 1 line
2.34.1
Hi Masahiro,
Quoted 8 lines · On Wed, 8 Feb 2023 01:41:56 +0900 Masahiro Yamada <[email protected]> wrote:
With
CONFIG_VIRTIO_UML=y, GNU ld < 2.36 fails to link UML vmlinux (w/woCONFIG_LD_SCRIPT_STATIC).
.exit.text' referenced in section.uml.exitcall.exit' ofarch/um/drivers/virtio_uml.o: defined in discarded section `.exit.text' ofarch/um/drivers/virtio_uml.o
collect2: error: ld returned 1 exit statusThis fix is similar to the following commits:
Quoted 8 lines
-
4b9880dbf3bd("powerpc/vmlinux.lds: DefineRUNTIME_DISCARD_EXIT")
-a494398bde27("s390: defineRUNTIME_DISCARD_EXITto fix link error with GNU ld < 2.36")
-c1c551bebf92("sh: defineRUNTIME_DISCARD_EXIT")Fixes 99cb0d917ffa ("arch: fix broken BuildID for arm64 and riscv")Reported-by SeongJae Park <[email protected]>Signed-off-by Masahiro Yamada <[email protected]>
Thanks.
SJ
Quoted 18 lines
---
arch/um/kernel/vmlinux.lds.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/um/kernel/vmlinux.lds.S +1
-1@@ -1,4 +1,4 @@ - +#define RUNTIME_DISCARD_EXIT KERNEL_STACK_SIZE = 4096 * (1 << CONFIG_KERNEL_STACK_ORDER); #ifdef CONFIG_LD_SCRIPT_STATICSignature · 1 line
2.34.1