seen with the 2.38 branch 20220123 and 20220126, https://bugs.debian.org/1004269 https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/1958389 The Debian report contains the more useful stack trace. The Ubuntu report suggests that this is only seen on Intel hardware, not AMD hardware.
I can build xen-4.16.0 on Fedora 35. Please provide ALL inputs so that I can reproduce it.
Created attachment 13937 [details] Likely fix From the backtrace in https://bugs.debian.org/1004269 it is clear that the problem is triggered by commit e86fc4a5bc37 in which a new extrap field was added to coffcode.h combined_entry_type but is not used on anything except rs6000 coff targets.
HJ, you likely can reproduce the failue with an asan build of binutils, or using MALLOC_PERTURB_. I haven't tested the patch yet.
Works for me: /export/build/gnu/tools-build/binutils-asan/build-x86_64-linux/ld/ld-new -mi386pep --subsystem=10 --image-base=0xffff82d040000000 --stack=0,0 --heap=0,0 --section-alignment=0x200000 --file-alignment=0x20 --major-image-version=4 --minor-image-version=16 --major-os-version=2 --minor-os-version=0 --major-subsystem-version=2 --minor-subsystem-version=0 --build-id=sha1 -T efi.lds -N prelink.o /export/gnu/import/git/gitlab/xen/xen/.xen.efi.1r.o /export/gnu/import/git/gitlab/xen/xen/.xen.efi.1s.o -b pe-x86-64 efi/buildid.o -o /export/gnu/import/git/gitlab/xen/xen/xen.efi ================================================================= ==1616314==ERROR: LeakSanitizer: detected memory leaks Direct leak of 862212 byte(s) in 133 object(s) allocated from: #0 0x7f3fbb6e791f in __interceptor_malloc (/lib64/libasan.so.6+0xae91f) #1 0xb4844b in xmalloc /export/gnu/import/git/gitlab/x86-binutils/libiberty/xmalloc.c:149 SUMMARY: AddressSanitizer: 862212 byte(s) leaked in 133 allocation(s). [hjl@gnu-tgl-2 x86]$
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=07c9f243b3a12cc6749bc02ee7b165859979348b commit 07c9f243b3a12cc6749bc02ee7b165859979348b Author: Alan Modra <amodra@gmail.com> Date: Fri Jan 28 14:29:34 2022 +1030 PR28826 x86_64 ld segfaults building xen Fallout from commit e86fc4a5bc37 PR 28826 * coffgen.c (coff_write_alien_symbol): Init dummy to zeros.
The binutils-2_38-branch branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=61ecfbda44fb8d165f01cac3d704a5e9fd321795 commit 61ecfbda44fb8d165f01cac3d704a5e9fd321795 Author: Alan Modra <amodra@gmail.com> Date: Fri Jan 28 14:29:34 2022 +1030 PR28826 x86_64 ld segfaults building xen Fallout from commit e86fc4a5bc37 PR 28826 * coffgen.c (coff_write_alien_symbol): Init dummy to zeros. (cherry picked from commit 07c9f243b3a12cc6749bc02ee7b165859979348b)
Fixed mainline and 2.38 branch