From patchwork Mon Aug 20 12:32:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 144608 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3918371ljj; Mon, 20 Aug 2018 05:32:52 -0700 (PDT) X-Google-Smtp-Source: AA+uWPymAcummdGD2tLHj14sepaSbPrjboRJLXsl33tn6lG5krxyxMVBzOsrOeMAAQpcy3dc1J+o X-Received: by 2002:a50:a542:: with SMTP id z2-v6mr53757621edb.77.1534768372836; Mon, 20 Aug 2018 05:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534768372; cv=none; d=google.com; s=arc-20160816; b=F/KNqOvdbq70huDKCxD7rlnZiE/+7oonjnm6cv6NOPGq20s/DYGT9KJoMbBbjU2y+c +hfio6Ik9HKfvSOdQrah1UJqRVgqFR91nEZfRnlr28Nv+dL3jXTX1lZJkqb+Fq65Q8us 69XE26ZeMV29TLwhwvfOd+QcOJUM0WbqwITG2L1mObPsmBjSE3XsoBqzjFDFoh/mFUMg A1KcDPvg3VZo8gnOipRvxMQBqDqkH+lC5ZzXwsunQD7dYLPzzJsrvtfrF940MUc0W7Fg SQn34qQUOVhSduYqCgL9KMdTlzThE98HY7G8o/fDXSrIUllhvKT6FuOq6eByGra1Px0f 3eQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=U/HkMIYPOlT+U0tOpVLNGzmdN2b7JryHzQG4/u17Cqo=; b=Dt1WNsaK1PbidUyT1d1b9HGa+n8a3lDDjD93FNXDTyjT+JqyalHRbUg7LLxioNQpWC E3TXDkWMMBvMdQooW2SxmmOKGBNo8ep5cmMzWqelqj+toYLSUF0RHml52SM4VvufzzZ1 VxdC42/H8xQpi6nlj5nqyJH+Sl8Vi+JeZm9Bs45Mdy7vlVlHPRASAZaA74l3LYWh1zJG T2jIVA2asFRV7FGHDFUJgaCwnnEvDgKetLfKCSbhSov5joIyN2u5FTvr3STrD1OfvdMo DgSCbBqOFuA6isHCzxy31SlYfIKdTvqtNprHWzuZzzyUwim4CkzSHBLYykexQVwIsJsV vf8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id o13-v6si2335360edh.418.2018.08.20.05.32.52; Mon, 20 Aug 2018 05:32:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 5661EC21E34; Mon, 20 Aug 2018 12:32:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 03235C21C2F; Mon, 20 Aug 2018 12:32:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 17C95C21C2F; Mon, 20 Aug 2018 12:32:24 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 088B3C21DD9 for ; Mon, 20 Aug 2018 12:32:24 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8015CAE50; Mon, 20 Aug 2018 12:32:23 +0000 (UTC) From: Alexander Graf To: U-Boot Mailing List Date: Mon, 20 Aug 2018 14:32:18 +0200 Message-Id: <20180820123220.55342-2-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180820123220.55342-1-agraf@suse.de> References: <20180820123220.55342-1-agraf@suse.de> Cc: Heinrich Schuchardt , Tom Rini Subject: [U-Boot] [PATCH 1/3] x86: Include bss subsections in linker script X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When we build with -fdata-sections we may end up with bss subsections. Our linker script explicitly lists only a single consecutive bss section though. Adapt the statement to also include subsections. This fixes booting efi-x86_app_defconfig. Signed-off-by: Alexander Graf Reviewed-by: Bin Meng Tested-by: Bin Meng --- arch/x86/cpu/u-boot-64.lds | 2 +- arch/x86/cpu/u-boot.lds | 2 +- arch/x86/lib/elf_ia32_efi.lds | 2 +- arch/x86/lib/elf_x86_64_efi.lds | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/cpu/u-boot-64.lds b/arch/x86/cpu/u-boot-64.lds index 862aa2d35e..98c7f8e9c5 100644 --- a/arch/x86/cpu/u-boot-64.lds +++ b/arch/x86/cpu/u-boot-64.lds @@ -95,7 +95,7 @@ SECTIONS .bss __rel_dyn_start (OVERLAY) : { __bss_start = .; - *(.bss) + *(.bss*) *(COM*) . = ALIGN(4); __bss_end = .; diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds index a1cc19ce4c..a283c290ee 100644 --- a/arch/x86/cpu/u-boot.lds +++ b/arch/x86/cpu/u-boot.lds @@ -94,7 +94,7 @@ SECTIONS .bss __rel_dyn_start (OVERLAY) : { __bss_start = .; - *(.bss) + *(.bss*) *(COM*) . = ALIGN(4); __bss_end = .; diff --git a/arch/x86/lib/elf_ia32_efi.lds b/arch/x86/lib/elf_ia32_efi.lds index 983fabbc4d..aad61e7f81 100644 --- a/arch/x86/lib/elf_ia32_efi.lds +++ b/arch/x86/lib/elf_ia32_efi.lds @@ -46,7 +46,7 @@ SECTIONS *(.sbss) *(.scommon) *(.dynbss) - *(.bss) + *(.bss*) *(COMMON) /* U-Boot lists and device tree */ diff --git a/arch/x86/lib/elf_x86_64_efi.lds b/arch/x86/lib/elf_x86_64_efi.lds index 7cad70a2e4..b436429b33 100644 --- a/arch/x86/lib/elf_x86_64_efi.lds +++ b/arch/x86/lib/elf_x86_64_efi.lds @@ -44,7 +44,7 @@ SECTIONS *(.sbss) *(.scommon) *(.dynbss) - *(.bss) + *(.bss*) *(COMMON) *(.rel.local) From patchwork Mon Aug 20 12:32:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 144607 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3918066ljj; Mon, 20 Aug 2018 05:32:33 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxSIJ07QwU/VvlM9uzTffERlgLW7sRh/5ScHekF1H5st0a0S+IvwR7jJaX7eKd2T1yMx4D9 X-Received: by 2002:a50:f31a:: with SMTP id p26-v6mr55924721edm.68.1534768353865; Mon, 20 Aug 2018 05:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534768353; cv=none; d=google.com; s=arc-20160816; b=JAA1LlnC+Ekvr+RE93t4Kl/1u2Yo7+bOKYdSBb3sIOw9H58zoopMsijU0AA5WRMVh8 KHOl4PnZqWVD1wnXd8cTj+TONPOAdEE9AWaAGjwFPd0IYKNrk4FG4kL4Saa7iIvFx+mQ 9Up+5LK8YDU1a5nwQMuSAPRlmNyIK+tK5ZMV0vfFVIgLiESyBNVhAfjNs+EroelRlXSY 3AHGMTC+v7rCHvecen8dOcdybN1IrmSo0KA8LXYn/Ra1LkOKaiqnC85bDodf3r8WE5Uq cHSQtakMK1xXptIrJxv4mHUQ+pwork9wmWQjpBO3IinBDce+SGU5tl3VcXm9q9nfgoBd ReVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=vcX2dNlMVfdQ7Ir8+GlqGipzYYqQhVPSX9MlBxjUBF0=; b=cW1hsL9Acs8dtXm1RQtJQOQP0VPs7U8VbDV6bGbzWkT+JVR0BLkokeSUXDxTEgFSRf W/h+IO9VGg5CH8PYAXr7WpBrSNgk5xk6HWILX7cDWBTJWUmekoSFKwy5uHito2oeNFlC Bb6VbE0vp2boCzieStIbRjfcg1/e0hbuDHjXw2TlFCCttCQ/GYPyeGWCyyXfOutZMyHO PIES00vxZlw14waiacuNgMZs4syPdHfiZra0sVk7mYK6WoKCU5G/drub8zeVWFqhKkiL H2kLSBR/9XkYUhO3blINuMpYcwymxPev11rVb8Q66GNDoQdhgezENRocIR3lWP2jgJkb 6TNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id d29-v6si955798edb.244.2018.08.20.05.32.33; Mon, 20 Aug 2018 05:32:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 6CDBAC21E39; Mon, 20 Aug 2018 12:32:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5C3E7C21C8B; Mon, 20 Aug 2018 12:32:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D2A77C21DEC; Mon, 20 Aug 2018 12:32:24 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id D4680C21C2F for ; Mon, 20 Aug 2018 12:32:23 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7EC7DADF4; Mon, 20 Aug 2018 12:32:23 +0000 (UTC) From: Alexander Graf To: U-Boot Mailing List Date: Mon, 20 Aug 2018 14:32:19 +0200 Message-Id: <20180820123220.55342-3-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180820123220.55342-1-agraf@suse.de> References: <20180820123220.55342-1-agraf@suse.de> Cc: Heinrich Schuchardt , Tom Rini Subject: [U-Boot] [PATCH 2/3] x86: Enable -fdata-sections always X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" We left -fdata-sections disabled for x86_64 before because we encountered random bugs that were at that time inexplicable. Turns out this really was just side effects of missing .bss* statements in the linker scripts. With those fixed, we can enable data sections for all targets. Signed-off-by: Alexander Graf Reviewed-by: Bin Meng Tested-by: Bin Meng --- arch/x86/config.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/config.mk b/arch/x86/config.mk index 586e11a0dd..5b04febd68 100644 --- a/arch/x86/config.mk +++ b/arch/x86/config.mk @@ -23,13 +23,11 @@ endif ifeq ($(IS_32BIT),y) PLATFORM_CPPFLAGS += -march=i386 -m32 -# TODO: These break on x86_64; need to debug further -PLATFORM_RELFLAGS += -fdata-sections else PLATFORM_CPPFLAGS += $(if $(CONFIG_SPL_BUILD),,-fpic) -fno-common -m64 endif -PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden +PLATFORM_RELFLAGS += -fdata-sections -ffunction-sections -fvisibility=hidden PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions PLATFORM_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64) From patchwork Mon Aug 20 12:32:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 144610 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3920225ljj; Mon, 20 Aug 2018 05:34:39 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyLj3iBlcyTz9rQhZBfn0E91fibxrrZ/jhE9SYOIcGSxWpyiMGrrBjPOxU4SM9L+5+k5dwI X-Received: by 2002:aa7:c803:: with SMTP id a3-v6mr55752205edt.124.1534768479395; Mon, 20 Aug 2018 05:34:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534768479; cv=none; d=google.com; s=arc-20160816; b=PE2okDx2bDSxZW1div7ilmS7bktGk8uqaEt22eWEKW/nbKgbs1GuF4k3p/54ucMeu3 X9YMJYjlxqsRwpvbGCIuutMyjH63+/CFExh7Edd/oNWawHtSEkhVp/glcDJeQDxShAuw JlxkD+0TgrQ4x/Kkl3Y95NoV+nKD3S+xgXyoPZwxn+c7Z0CefCZMeiXaau/KhODlhANe 3D6C0fnBJ1Ff/auM1sj+YUlwCD1VujgY8OsW6dbbQ8dmpwytUlilxwsWgPOpR7OLF3qU YMPuL4FXoqLB/GijS5wtViLq0nyqcoDk6iIT0kLDGGS2FRKxSjgxsVfIuL6tLYV2kI3o sGMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=1df7KOshT1jHKgbuHxRYOINBE+7KJPzrxQVh2r/sBpg=; b=b6r6vEJNc9NRjbYjRvNNQTL/NV8fNWPDBDM3j49UgetpnhZTZwzVuNqcRawcvoy3Bj 3qgNFgwNpZRcnCAsj94Jt4jXl1AMrG7ZdQy/QcO3HIcKmmkM95iv7gqFoLwe5pzXjb1H C5aEVm3nhKT2XiP0SHWylLZH/cdymt9oEjMcgHFsGmtVDR/GMnXivQTP3Z3cNZlW0hFP JH6IfYtyVB3c9u9U8PqGto2ExQZnWX2SaJF7V+Pbaj44HnEQjpfxXpqGPZYLKHS6PNYA H4ua1WQV4kZorU+l1I1u9UvwCbv57df+Q2nVkzvoAhMXJAJRpRI5622+FNbQ/um9nu8L 5uQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id o18-v6si3666370edf.177.2018.08.20.05.34.39; Mon, 20 Aug 2018 05:34:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 03F0FC21E44; Mon, 20 Aug 2018 12:33:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C8D82C21E31; Mon, 20 Aug 2018 12:32:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2C58DC21D74; Mon, 20 Aug 2018 12:32:24 +0000 (UTC) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id E82C7C21D74 for ; Mon, 20 Aug 2018 12:32:23 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 82BB2AE7E; Mon, 20 Aug 2018 12:32:23 +0000 (UTC) From: Alexander Graf To: U-Boot Mailing List Date: Mon, 20 Aug 2018 14:32:20 +0200 Message-Id: <20180820123220.55342-4-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180820123220.55342-1-agraf@suse.de> References: <20180820123220.55342-1-agraf@suse.de> Cc: Heinrich Schuchardt , Tom Rini Subject: [U-Boot] [PATCH 3/3] riscv: Include bss subsections in linker script X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When we build with -fdata-sections we may end up with bss subsections. Our linker script explicitly lists only a single consecutive bss section though. Adapt the statement to also include subsections. Signed-off-by: Alexander Graf --- arch/riscv/cpu/ax25/u-boot.lds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/cpu/ax25/u-boot.lds b/arch/riscv/cpu/ax25/u-boot.lds index 3cc89746b1..c50b9642f1 100644 --- a/arch/riscv/cpu/ax25/u-boot.lds +++ b/arch/riscv/cpu/ax25/u-boot.lds @@ -82,7 +82,7 @@ SECTIONS .bss : { __bss_start = .; - *(.bss) + *(.bss*) . = ALIGN(4); __bss_end = .; }