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

[PATCH] x86/build: work around older GNU ld not leaving .got.plt empty


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 21 Mar 2022 12:46:54 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=2X6yEMK+OHgNoVyLNONBqCrM4DUfGQtj1DZaz8XZ8Xc=; b=TskZJrxJTJza7uS7pbZpfO5/44UU25R3pJd+9WeszWbItaig5Kqce78r7VNY/Adag8DjlBsQByLux0wnV7JJBUVvM1WqRkHzbtEYFj798XSoKdlo91HMnZcP7MdchbnwPhvxn3zh0w6a2knD7KS5Lf1Pkbk+PrfTprLFOfb1nll92VnEslcVLr1e8Dgo/162yr/4YdPKKmhHkc2ThwQiFuILUcPz8EkkQ0yqkkoLmCaXKwtsyE7yC2Fx+gEPmLKV3/EhSYK0MAZHJBgXWTx7RyPJF0DLcaCea4QZ27lLUjE808GapZrpURrVpc8kyEOhSvMox6PF1nD0o/jQ5z+gyA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h7+JA3EFncm/WTWh/XTkx/SX8ZvuK13gmv+TauKcXHStVtwt8v9wEMUGOn/FN9LlyzGp4dvsdY6hh5yMs2rhTlqWSOJc1XXZb+vdVxgkn37oWXV3ePLwJu+y6FGXPxsQRQrRkuYa3xG0ngNp6XdsBK2JFMeDBsxasvY/IBbxINK7excmSb3N2PU8k3zPKMVZAbEJkQ4riKeef7dPWLHZtKyLepcZEtRWHPMLvxWoPrbK0ZRKzYFLsFC4z3cvIBaZgmY222SFWbEB5su87kPTGeHpxt0YB7oZrxeM+VsTgVy8FERa0D9SvdEooRHqx4pueZrBC8dKfxXk6YoWaqutgQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Mon, 21 Mar 2022 11:47:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The initial three entries in .got.plt are "static", i.e. present
independent of actual entries allocation of which is triggered by
respective relocations. When no real entries are needed, halfway recent
ld discards the "static" portion of the table as well, but older GNU ld
fails to do so.

Fixes: dedb0aa42c6d ("x86/build: use --orphan-handling linker option if 
available")
Reported-by: Julien Grall <jgrall@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -497,7 +497,13 @@ ASSERT(IS_ALIGNED(__bss_end,        8),
 
 #ifndef EFI
 ASSERT(!SIZEOF(.got),      ".got non-empty")
-ASSERT(!SIZEOF(.got.plt),  ".got.plt non-empty")
+/*
+ * At least GNU ld 2.30 and earlier fail to discard the generic part of
+ * .got.plt when no actual entries were allocated. Permit this case alongside
+ * the section being empty.
+ */
+ASSERT(!SIZEOF(.got.plt) || SIZEOF(.got.plt) == 3 * 8,
+       "unexpected .got.plt size")
 ASSERT(!SIZEOF(.igot.plt), ".igot.plt non-empty")
 ASSERT(!SIZEOF(.iplt),     ".iplt non-empty")
 ASSERT(!SIZEOF(.plt),      ".plt non-empty")




 


Rackspace

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