[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] RFC: xen/x86: Enable --gc-sections


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Tue, 9 Dec 2025 10:12:02 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zyRqL42Pv9oBW2yOakW5gRYlNvi81x59wZ/DHAsNt5A=; b=cpYz7f+63FpXqJR7snP7t+jfP20n2aihgnYYXN0iF39Z7vF5Vb4MAv7vOxdziwZYYrzY9yLIZBu2Y9PvkStQcE/G311BUohCYVMWtXvxmc5w7GkEULm8DSVQLuSZBMtlArDXkwOSFYfV83i4jgYa/wfVQYVWYqw7SGoPGNFaeqMYlMDN8RDan5VPTAqkBdRJkoRB/Owqg4KSeydMvH/I1J7NTrRF61eGM9ZGP3ff9M5zzfJIfXgi2nVjQiHnlFRHmFJiAzNZifFNA8nGr8hwkYtH+SBqlO4v7Wbvv2nvY4C0owE1mOiYMN7FOGk4jNBwkNiuy5UIg/7I61RF4eUk/w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aGy7A2gJj6d2KpQQV+YQBk8UKUKF/thU9UBnIHO1s5lEDbzGQvRlkkck/Aygf+LUFIqBCA4HojoqoefjfzXnolfgcDB4BvX7fqRzFc4+r6jcf3TdtuSQlArovFuInYU6AZMP+vBYeKrcSFjSqnHjTO2/2NH1qFeBYD/XEjASh7x/36N4rUk8Q0cee5q2Hj4oIpSdwyXmPUbeV5ZgYdZXaxFh1Q7TGfNEDmWWpmaCQCg4laYmPcD9cSJdRlt3BOSFs0Vg3trSVX8i/qxb6rcx/ZgEWucY9fKc7SZoNnG0HzCmdc6TbTuLD7L5/OqibjXIIS16X9r5XVuaUjJ/BvQcoA==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 09 Dec 2025 15:12:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-12-09 02:36, Jan Beulich wrote:
On 09.12.2025 00:00, Jason Andryuk wrote:
On 2025-12-08 03:56, Jan Beulich wrote:
On 05.12.2025 23:28, Jason Andryuk wrote:
When linking to create xen-syms, add --gc-sections to garbage collect
unused stuff.

What about xen.efi?

I tried briefly and it fails to link.  The GCC manual says it is
considered experimental for PE and COFF.

The gcc manual documents linker behavior? Do you have a more concrete pointer?

My bad - it's binutils. https://sourceware.org/binutils/docs/ld.html down at --gc-sections: "Note that garbage collection for COFF and PE format targets is supported, but the implementation is currently considered to be experimental."

I just added into EFI_LDFLAGS:
    CC      .xen.efi.0s.o
ld -mi386pep --no-warn-rwx-segments --subsystem=10
--enable-long-section-names --disable-high-entropy-va --dynamicbase
--image-base=0xffff82d040000000 --stack=0,0 --heap=0,0
--section-alignment=0x200000 --file-alignment=0x20
--major-image-version=4 --minor-image-version=22 --major-os-version=2
--minor-os-version=0 --major-subsystem-version=2
--minor-subsystem-version=0 --gc-sections --print-gc-sections
--build-id=sha1 -T arch/x86/efi.lds prelink.o  ./.xen.efi.0s.o -b
pe-x86-64 arch/x86/efi/buildid.o -o ./.xen.efi.0xffff82d040000000.0 && :
ld: kexec_reloc is too large
ld: kexec_reloc is too large
ld:
prelink.o:/home/jandryuk/xen/xen/arch/x86/boot/head.S:60:(.text.header+0x48):
undefined reference to `start'

I see. This then would want mentioning in the patch description. And I've added
it to my binutils side todo list.

I trimmed, but the output continues for a long time.

Thanks,
Jason



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.