Message ID | 1474860866-16406-47-git-send-email-sjg@chromium.org |
---|---|
State | Accepted |
Commit | 6bda55a38ce4d9c5fcab5a5011e06469662954b3 |
Delegated to: | Bin Meng |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3sj8wP3B5sz9s65 for <incoming@patchwork.ozlabs.org>; Mon, 26 Sep 2016 13:44:21 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=R/HbUnMp; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DE980B38FC; Mon, 26 Sep 2016 05:40:06 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lz20H0Pnalak; Mon, 26 Sep 2016 05:40:06 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9CD76B3987; Mon, 26 Sep 2016 05:36:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 39105B382F for <u-boot@lists.denx.de>; Mon, 26 Sep 2016 05:35:57 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rfMT_DSSoREa for <u-boot@lists.denx.de>; Mon, 26 Sep 2016 05:35:57 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by theia.denx.de (Postfix) with ESMTPS id CE044B3852 for <u-boot@lists.denx.de>; Mon, 26 Sep 2016 05:35:20 +0200 (CEST) Received: by mail-io0-f176.google.com with SMTP id e66so80411313iod.1 for <u-boot@lists.denx.de>; Sun, 25 Sep 2016 20:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=08Pb6VkqbW9kHPbkk5QZe0RIGuext7aBcuFHJcDTumw=; b=R/HbUnMp2oAHTWBkPTWuaXsN1f0bk+KejmpjZsJtL9iuaM9RcgxiX8W6LrtfVLvxIw WuJuGzBhGb+RSEU+MiYhSuULtKQO6pYPTsAwGKsKk87tnBxv61JfF1kJO5MGeaZKaZnp UMOJ6cGafs105mqt68QWISlwTjkBjHMXKdBeoocfbeVulDoWj3JRUnQHcpufF130j/5T YetFuAZYIGtJrf+yYbEDYBbX3NX+WG2gwQYhPOP8gqiPO7YXrxi30LnDzyUTo3Azq9sF cqebb3KX3jUwvu8+MdtqzOyaN7CGTgHCItyFMkNBlcij2qE/ek9Vq9B9wtf1TIzxCE6K g4fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=08Pb6VkqbW9kHPbkk5QZe0RIGuext7aBcuFHJcDTumw=; b=KTfd9CLCLDYqm8pXUumCzWXUk6RCZN06OjTG7EEAYOgHgZwkgrKniN1mSXra5puifx zH5FlkufShVZ+eK0RfYOsElXAVR2jWIqlZd/3kemigYp8imkiiTfp5HpzjnwVj5a3jA9 GK2UYhqea/C/Wo+PXwIrFbntMKBtH2R7nh3Ym3yU+QpUuaaK+SEeG8Op50OE8pDuVlQ7 wGlWcUaFrAToazMVpnXyGvWAnKEm9iCmYGg79vTgilOrB13JDbM7G7l/9V1OQ5sTiXHv 8C7r8uzhWTc3JUz6pQnj0jx0BKKmUbnsDx8xnjiPb0PhNXJf0cGOhyGj1NmvFdQpIeBs 2ApQ== X-Gm-Message-State: AA6/9RlH2YhCS8f7kVIizFS+bq1K/iLhtmsYgLAm7E7QrKrEm4Jbu+RbpAhNmt0SyaZC9NYd X-Received: by 10.107.173.105 with SMTP id w102mr12046218ioe.186.1474860919500; Sun, 25 Sep 2016 20:35:19 -0700 (PDT) Received: from kaki.bld.corp.google.com ([100.100.202.55]) by smtp.gmail.com with ESMTPSA id 7sm7535244ioe.4.2016.09.25.20.35.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Sep 2016 20:35:12 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 537642224F6; Sun, 25 Sep 2016 21:35:08 -0600 (MDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Date: Sun, 25 Sep 2016 21:33:49 -0600 Message-Id: <1474860866-16406-47-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1474860866-16406-1-git-send-email-sjg@chromium.org> References: <1474860866-16406-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH 46/82] x86: Do relocation before clearing BSS X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <http://lists.denx.de/mailman/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <http://lists.denx.de/mailman/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
diff --git a/common/board_f.c b/common/board_f.c index 28a63a6..a06578c 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -1040,8 +1040,8 @@ static init_fnc_t init_sequence_f[] = { setup_reloc, #if defined(CONFIG_X86) || defined(CONFIG_ARC) copy_uboot_to_ram, - clear_bss, do_elf_reloc_fixups, + clear_bss, #endif #if defined(CONFIG_XTENSA) clear_bss,
The BSS region may overlap with relocations. If we clear BSS we will overwrite the start of the relocation area. This doesn't matter when running from SPI flash, since it is read-only. But when relocating 64-bit U-Boot from one place in RAM to another, relocation will fail because some of its relocations have been zeroed. To fix this, put the ELF fixup call before the BSS clearing call. Signed-off-by: Simon Glass <sjg@chromium.org> --- common/board_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)