From: Jan Beulich Date: Fri, 4 Mar 2022 09:49:22 +0000 (+0100) Subject: x86: also discard .fini_array in linker script X-Git-Tag: archive/raspbian/4.17.0-1+rpi1^2~33^2~860 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1145d94c738ea13e0d2ceedb97a4cfe46292b08e;p=xen.git x86: also discard .fini_array in linker script This simply parallels .dtors. Both section types can reference .text.exit, which requires them to be discarded together with that one. Compilers, depending on their findings during the configure phase, may elect to use either model. While .{init,fini}_array look to be preferred, cross compilers apparently have this guessed, likely resulting in a fallback to .{c,d}tors. Hence we need to support both sets. Fixes: 4b7fd8153ddf ("x86: fold sections in final binaries") Reported-by: Andrew Cooper Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index 021470d932..506bc8e404 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -414,6 +414,8 @@ SECTIONS *(.eh_frame) *(.dtors) *(.dtors.*) + *(.fini_array) + *(.fini_array.*) #ifdef EFI *(.comment) *(.comment.*)