From patchwork Wed Aug 2 18:39:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 796746 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kp/4PFxm"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xN27F1S01z9t1G for ; Thu, 3 Aug 2017 04:40:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4F89E87474; Wed, 2 Aug 2017 18:40:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tqo-FIOxbdo2; Wed, 2 Aug 2017 18:40:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B89F886C78; Wed, 2 Aug 2017 18:40:20 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 686811BFBB5 for ; Wed, 2 Aug 2017 18:40:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 634AA88BD2 for ; Wed, 2 Aug 2017 18:40:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AIak9kFs9uLk for ; Wed, 2 Aug 2017 18:40:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id 0B27488B1B for ; Wed, 2 Aug 2017 18:40:18 +0000 (UTC) Received: by mail-lf0-f67.google.com with SMTP id w199so4319394lff.2 for ; Wed, 02 Aug 2017 11:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=MwPDRH9qCDSnD6wph2W2gJAXcoPxzXQvExJ7kipDWiQ=; b=kp/4PFxm+tf8eCQG811Ir0OemXt45Z8VHSztlbEK2EgEu6LVjXDhafk835uG2Y/mVb 3JUbauLdroP9xlOl57Y2n9BdBXm4nTz0TdQoTw9rmvIS9cKyyqsgWzBkOmFBMmCJb5m+ w1pAa5NA1sYYxqQnRqqpbm7AHjbqsuaycbyHnBrAoOAUaNwNjLSgSPNcQduNQzaUeRwb QiH09jTCeTOfofICi4Dkmla0J32TlouFxF4lX9k/cwITBXzEBLZT3Vri12iR1bi7TJc3 qpPhYCpVeMUbK4ewd4yQc7WNTV8UugRqvX5qlAZpkVQm7NKT+/wrdPIrmy8w/qqU5Gbt rSHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MwPDRH9qCDSnD6wph2W2gJAXcoPxzXQvExJ7kipDWiQ=; b=jAiPuw+aicS/1kuGycBr/5+YI3oipuCH32e+ZZymJYLjntuRvqzeKcReQISP+3ciJG okSCw/4kTog4yJ08J5m45dTou5LQiktdz8XpmlUdA/8wAAhlZEoMRwg+7e5HzqLNA6b1 b9/GV0cOdi9ECcQoGlP1rzh0aoaNXITYuLkxgUZv2YZBUdOGOBakhZjbhZID9rUjw1HA gjBksbES69u5aDw8AbY1TDQkYVNiJwKqCKVZGyrKxSwsgthbkDzTNProe4nMnG9nbHHv damiF4MDedYXTukShsFHcQ3bp0K5OvM0zw7Dlw3MMU9SmM65o+cc2Tic3T+dflb55N4r Vw3w== X-Gm-Message-State: AIVw1109EuSSbRkIixikkvzNJFzAFHMwn2WpLNQdV1bEGy9LBH9hMETM vVac6JYHNC9/1YJq X-Received: by 10.25.207.85 with SMTP id f82mr7520314lfg.2.1501699215850; Wed, 02 Aug 2017 11:40:15 -0700 (PDT) Received: from octofox.metropolis ([5.19.183.212]) by smtp.gmail.com with ESMTPSA id g41sm3563496lji.94.2017.08.02.11.40.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 11:40:14 -0700 (PDT) From: Max Filippov To: buildroot@uclibc.org Date: Wed, 2 Aug 2017 11:39:59 -0700 Message-Id: <1501699199-3006-1-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 Cc: Thomas Petazzoni Subject: [Buildroot] [PATCH] package/binutils: fix assertion in 2.29 xtensa ld X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Section sorting code in xtensa ld was incorrectly cleaned up in release 2.29, resulting in the following assertion when --sort-section,alignment option is used: BFD (GNU Binutils) 2.29 assertion fail elf32-xtensa.c:3965 Backport the fix that restores original section sorting. Signed-off-by: Max Filippov --- ...a-ld-restore-old-section-sorting-behavior.patch | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 package/binutils/2.29/0007-xtensa-ld-restore-old-section-sorting-behavior.patch diff --git a/package/binutils/2.29/0007-xtensa-ld-restore-old-section-sorting-behavior.patch b/package/binutils/2.29/0007-xtensa-ld-restore-old-section-sorting-behavior.patch new file mode 100644 index 000000000000..b4118378d25d --- /dev/null +++ b/package/binutils/2.29/0007-xtensa-ld-restore-old-section-sorting-behavior.patch @@ -0,0 +1,48 @@ +From 3a399127ead1ba3c8b8d0b9e7206fce39311ee72 Mon Sep 17 00:00:00 2001 +From: Max Filippov +Date: Wed, 2 Aug 2017 02:49:56 -0700 +Subject: [PATCH] xtensa: ld: restore old section sorting behavior + +With the recent change 535b785fb0c9 ("Don't compare boolean values +against TRUE or FALSE") the following assertion is observed when +linking with --sort-section,alignment option: + + BFD (GNU Binutils) 2.29 assertion fail elf32-xtensa.c:3965 + +It appears that xtensa linker only supported sorting sections by name, +and the code that checks for the section sorting type in +ld/emultempl/xtensaelf.em was not updated in the change bcaa7b3eb957 +("ld/"), that replaced boolean wildcard_spec::sorted with enumeration. + +Restore the original behavior of the section sorting code. + +ld/ +2017-08-02 Max Filippov + + * emultempl/xtensaelf.em + (xtensa_wild_group_interleave_callback): Only check for by_name + sorting. + +Signed-off-by: Max Filippov +--- +Backported from: 73d5923e480944e2d66bde8c59f4dff298ec57e3 + + ld/emultempl/xtensaelf.em | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ld/emultempl/xtensaelf.em b/ld/emultempl/xtensaelf.em +index 1447d526a25b..3827d91b6291 100644 +--- a/ld/emultempl/xtensaelf.em ++++ b/ld/emultempl/xtensaelf.em +@@ -1432,7 +1432,7 @@ xtensa_wild_group_interleave_callback (lang_statement_union_type *statement) + struct wildcard_list *l; + for (l = w->section_list; l != NULL; l = l->next) + { +- if (l->spec.sorted != none) ++ if (l->spec.sorted == by_name) + { + no_reorder = TRUE; + break; +-- +2.1.4 +