From 1145d94c738ea13e0d2ceedb97a4cfe46292b08e Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 4 Mar 2022 10:49:22 +0100 Subject: [PATCH] x86: also discard .fini_array in linker script MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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é --- xen/arch/x86/xen.lds.S | 2 ++ 1 file changed, 2 insertions(+) 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.*) -- 2.30.2