x86: also discard .fini_array in linker script
authorJan Beulich <jbeulich@suse.com>
Fri, 4 Mar 2022 09:49:22 +0000 (10:49 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 4 Mar 2022 09:49:22 +0000 (10:49 +0100)
commit1145d94c738ea13e0d2ceedb97a4cfe46292b08e
treefd0a7b69e481a3d144cc1e1a3f8b1d445db91344
parent248496f890562fd6d6fea779520dd6335269e92c
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 <Andrew.Cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/xen.lds.S