From patchwork Sun Jan 29 15:32:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 50004 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1786104wrn; Sun, 29 Jan 2023 07:32:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXvJ4wzTY6Up0wBHfxZvRKRfgtqAnoF4NFO8buA5AntJxHXBuqCC8jegQ2KnFWrZuF28reZc X-Received: by 2002:a17:906:a051:b0:870:baa6:6762 with SMTP id bg17-20020a170906a05100b00870baa66762mr47533183ejb.14.1675006345232; Sun, 29 Jan 2023 07:32:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675006345; cv=none; d=google.com; s=arc-20160816; b=RXHGmd+xTqMLSO9YU0XEIxdjEEZ/HwfjoDhBD2gBxT6KlrXfx1PJ668kEZkOVxZC5J myaDHMtyXj8RuVAMAwYtzY3JhYaChGwszcZU7iep5plh51mOHgcPJxabCAuSnyoUVAlG Q58TTMRSuLPQYA5ThJJ3tyGsQEyhiHJ61osfm/hjHtP5eIljMjAfYaf+dvwt3ZvUfGAP cchPK6gwLwsAk5QR5g+XuCkFG9zIk9N41z+MQYyD0X6UaJEg4PuQW1AmLxn186P9jKjb r+qlE6KCrgy4686fk618FgnuEtK/ntUEUBTJeAf+cNcgrpRtrhTXvKVdnLkXRcai6MXc J1bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dmarc-filter:delivered-to; bh=4OivDIdU8bKRC+dsrbGRcZbCS2REQTBwUX8yYqc8Ad8=; b=NyXgF2A74jTEIHB8tO+KoMOx/I8gi42ec8Z0OnLccQjBC/rnUMEUXGazrailYNEkCH eXANLARpFYIYFksWydSDIS9uLE9gRRucsAs9v+I/fWb1/Y9PwKycOl1MsC/xYPH+Z4Ci Ec72OEKWdRg1ntUO9jq1EeX8NrrPpXeDdYEIsFzaybmmvCqWTxUvqSiAXY2izC/RW9/h 56wN+Ogz02jCVsVq9MnVHY0s/Y55U903NZkAnu1TURqmUtNUsLC9A7OC+zVv88T81vB0 g3iBZDM3rJ2ThOpA4d4aqeBiqI7GwiiW8+aLTVzp1IPVyxBgWDnZCOPCCswA8tUtgvTn 1plQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@dinux.eu header.s=default header.b=gnQeMhHA; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ge6-20020a170907908600b0087c77d68c52si6797370ejb.406.2023.01.29.07.32.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Jan 2023 07:32:25 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=fail header.i=@dinux.eu header.s=default header.b=gnQeMhHA; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C45F73858438 for ; Sun, 29 Jan 2023 15:32:23 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id C947F3858D32 for ; Sun, 29 Jan 2023 15:32:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C947F3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinux.eu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4OivDIdU8bKRC+dsrbGRcZbCS2REQTBwUX8yYqc8Ad8=; b=gnQeMhHAI6u6EbmmJ/FFUXbNMA Li2LzckZx4nydGOcqGZYua/SiSoGpkkK+i9Um+GohLEBnJKmHzOzVJ8riVFyFS2Dp5m9qQ9Q6hbd6 sZm4580onCNJDOyrX8ykIDTbxUGzDZynX5RRSM3K/jDnwbPTIWWr0DdmTLWxPvU07I5gGcN5AF/4c pf8eIiWfzWICKn3JPwez0RAhlY6yEQIgUS9OvltuV2e4KQnuaEqne96T4BrsvZjLPKmcy3LmvVD2c 011rOSc2x0iKXoYbLzD3sDacqFIy5uNArfk0s7uBW17RWDbw7X2yHCjAv0jQmvlrRYgoIO1Nmcla/ +Y6zbY+Q==; Received: from 95-42-20-142.ip.btc-net.bg ([95.42.20.142]:48118 helo=kendros.lan) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pM9fA-000C91-7j; Sun, 29 Jan 2023 17:32:14 +0200 From: Dimitar Dimitrov To: binutils@sourceware.org Cc: Dimitar Dimitrov Subject: [PATCH 1/2] ld: pru: Merge the bss input sections into data Date: Sun, 29 Jan 2023 17:32:06 +0200 Message-Id: <20230129153207.944175-1-dimitar@dinux.eu> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756371453123933155?= X-GMAIL-MSGID: =?utf-8?q?1756371453123933155?= The popular method to load PRU firmware is through the remoteproc Linux kernel driver. In order to save a few bytes from the firmware, the PRU CRT0 is spared from calling memset for the bss segment [1]. Instead the host loader is supposed to zero out the bss segment. This is important for PRU, which typically has only 8KB for instruction memory. The legacy non-mainline PRU host driver relied on the default behaviour of the kernel core remoteproc [2]. That default is to zero out the loadable memory regions not backed by file storage (i.e. the bss sections). This worked for the libgloss' CRT0. But the PRU loader merged in mainline Linux explicitly changes the default behaviour [3]. It no longer is zeroing out memory regions. Hence the bss sections are not initialized - neither by CRT0, nor by the host loader. This patch fixes the issue by aligning the GNU LD default linker script with the mainline Linux kernel expectation. Since the mainline kernel driver is submitted by the PRU manufacturer itself (Text Instruments), we can consider that as defining the ABI. This change has been tested on Beaglebone AI-64 [4]. Static counter variables in the firmware are now always starting from zero, as expected. There was only one new toolchain test failure in orphan3.d, due to reordering of the output sections. I believe this is a harmless issue. I could not rewrite the PASS criteria to ignore the output section ordering, so I have disabled that test case for PRU. Ok for master? [1] https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=libgloss/pru/crt0.S;h=b3f0d53a93acc372f461007553e7688ca77753c9;hb=HEAD#l40 [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/remoteproc/remoteproc_elf_loader.c?h=v6.1#n228 [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/remoteproc/pru_rproc.c?h=v6.1#n641 [4] https://beagleboard.org/ai-64 ld/ChangeLog: * scripttempl/pru.sc (.data): Merge .bss input sections into the .data output section. * testsuite/ld-elf/orphan3.d: Disable for PRU.. Signed-off-by: Dimitar Dimitrov --- ld/scripttempl/pru.sc | 24 ++++++++++++++---------- ld/testsuite/ld-elf/orphan3.d | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ld/scripttempl/pru.sc b/ld/scripttempl/pru.sc index 56d07bea15d..7cb80694641 100644 --- a/ld/scripttempl/pru.sc +++ b/ld/scripttempl/pru.sc @@ -149,17 +149,13 @@ SECTIONS ${RELOCATING+*(.gnu.linkonce.r*)} ${RELOCATING+. = ALIGN(4);} ${RELOCATING+ PROVIDE (_data_end = .) ; } - } ${RELOCATING+ > dmem } - /* Linux remoteproc loader requires the resource_table section - start address to be aligned to 8 bytes. */ - .resource_table ${RELOCATING-0} ${RELOCATING+ ALIGN(8)} : - { - KEEP (*(.resource_table)) - } ${RELOCATING+ > dmem} - - .bss ${RELOCATING-0} : - { + ${RELOCATING+/* Merge the bss input sections into the output + data section. The Linux kernel's remoteproc PRU ELF loader + will not memzero the bss section. The CRT0 will not either, in order + to reduce the final firmware's instruction memory size. Hence + present bss sections as regular data sections, at the negligible + expense of increasing the ELF file size. */} ${RELOCATING+ PROVIDE (_bss_start = .) ; } *(.bss) ${RELOCATING+ *(.bss.*)} @@ -167,6 +163,14 @@ SECTIONS ${RELOCATING+*(.gnu.linkonce.b*)} ${RELOCATING+*(COMMON)} ${RELOCATING+ PROVIDE (_bss_end = .) ; } + + } ${RELOCATING+ > dmem} + + /* Linux remoteproc loader requires the resource_table section + start address to be aligned to 8 bytes. */ + .resource_table ${RELOCATING-0} ${RELOCATING+ ALIGN (8)} : + { + KEEP (*(.resource_table)) } ${RELOCATING+ > dmem} /* Global data not cleared after reset. */ diff --git a/ld/testsuite/ld-elf/orphan3.d b/ld/testsuite/ld-elf/orphan3.d index af6ce25e0fb..ec101643dea 100644 --- a/ld/testsuite/ld-elf/orphan3.d +++ b/ld/testsuite/ld-elf/orphan3.d @@ -7,7 +7,7 @@ #ld: #readelf: -S --wide #xfail: [uses_genelf] -#xfail: xstormy16-*-* +#xfail: xstormy16-*-* pru-*-* #... \[[ 0-9]+\] \.foo +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+20 +0+ +A +0 +0 +[0-9]+ From patchwork Sun Jan 29 15:38:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 50008 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1788098wrn; Sun, 29 Jan 2023 07:38:40 -0800 (PST) X-Google-Smtp-Source: AK7set/Hhogf8qb5YDrNajKsvl7hXZWU8S5yPIWocImanhLn0YGyvEgoTvDZ4kKB9pGw0I6vwic3 X-Received: by 2002:a17:906:c08d:b0:885:8f79:d6d7 with SMTP id f13-20020a170906c08d00b008858f79d6d7mr3887741ejz.61.1675006719957; Sun, 29 Jan 2023 07:38:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675006719; cv=none; d=google.com; s=arc-20160816; b=WvO66801T0Ap1orUNYk5l2rhlH2tfTThQ0bOxnrRVqS/2vq7OrdcXHp5pmtt24sqwo jYH2+bQFfOnR8Be8t3q8Mn0tfvk/pvfskGrfNVTbUU71IuiTlGuKdSFsjsLTVjYyz4xW XmSmmhY4Mv5MHQFdnEUtVwZl0D+GaUDJNRitJXSPhPAhQWvnzSV/KZ4lk8zZPDEEF9SE 4DLbtCl7QgQhQrQoY7/nWU4E5+/xtIX3ktw/d7Um0Z4SbzW2bwlzyseDIqhBy+q273OX GJtkLy4yJ6PY8zeql7TlivgsBzshbfocEMRbd2gwkpLpnhVvdm2vM9nTA4gloWbAGQOO OyWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=BsrQTyXqFHU8eiuk3GfmCyJOb2+Gpru/joDt7T+f+eg=; b=qlcILDWxFNyrX3L8ItAPq4hxP+Ygfbu12VY9QiOHZAgMFK3k2VBiX6zSJrO7CJMMvm c9/k5NRDt9EqBMxcqUmvgxJ5t0b8uHnLmgDBHhvBZR6tddpMyDczrp5S16Nsl553vxRT 1jnRDctBMiWI7xWNS2M6+znIJfv1dOJU5rrBlWezE+wuLgyLwhEXBh0Y7pmBJ+n1uaHD v0auUlJzzAN0pmUgmi8B4bcVrR0Vki97KFMuYGq16BkzBfbtb6LkcJ7cLeR7FEtrMlXl AT/KCD5h8ldSFgOHHgiT6+25o3I5MKMpAJnu3IbLtqAFdHP9W5RXHES4wIJgB8MjtDYK YrFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@dinux.eu header.s=default header.b=EAM8qrAY; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id gc19-20020a1709072b1300b00878109a0cbbsi10714669ejc.992.2023.01.29.07.38.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Jan 2023 07:38:39 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=fail header.i=@dinux.eu header.s=default header.b=EAM8qrAY; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B14E03858407 for ; Sun, 29 Jan 2023 15:38:38 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id AC0BC3858D32 for ; Sun, 29 Jan 2023 15:38:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AC0BC3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinux.eu DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=BsrQTyXqFHU8eiuk3GfmCyJOb2+Gpru/joDt7T+f+eg=; b=EAM8qrAYVCfVkT0X53hlU7EWep JMxxIjuLBNrt4Za/L7YrN8+xkeroksX3JgW9Tg435qVHJsrYJxtmtfVEC9bri2W9be8l5Ee8AGbEH Yl7IByruFvDI+VQjSjg0VfZcxQxV42bnvg/71VS2e2XhHfrXOVdSrb+r+HQk3xgkFSYyeZ5gsgA+n IGBIXNGOkz24ERf7UVTXKrNU2FVenet+foHlrY5T+R4czPD1teGZJOW+K4zQH3FS2kpqwWkLhXCNO 7MEosxsWPNSHhCQoqRdq3UIiTlT1AILxdV+3Xx9nf6IfkZkZY9/NHldmSVPyJe2to1tVRwe8kZrHt LyIiYlhA==; Received: from [95.42.20.142] (port=36452 helo=kendros.lan) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pM9lF-0004gt-2I; Sun, 29 Jan 2023 17:38:31 +0200 From: Dimitar Dimitrov To: binutils@sourceware.org Cc: Dimitar Dimitrov Subject: [PATCH 2/2] ld: pru: Add optional section alignments Date: Sun, 29 Jan 2023 17:38:20 +0200 Message-Id: <20230129153820.944711-1-dimitar@dinux.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230129153207.944175-1-dimitar@dinux.eu> References: <20230129153207.944175-1-dimitar@dinux.eu> MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756371846154031595?= X-GMAIL-MSGID: =?utf-8?q?1756371846154031595?= The Texas Instruments SoCs with AARCH64 host processors have stricter alignment requirements than ones with ARM32 host processors. It's not only the requirement for resource_table to be aligned to 8. But also any loadable segment size must be a multiple of 4 [1]. The current PRU default linker script may output a segment size not aligned to 4, which would cause firmware load failure on AARCH64 hosts. Fix this by using COMMONPAGESIZE and MAXPAGESIZE to signify respectively the section memory size requirement and the resource table section's start address alignment. This would avoid penalizing the ARM32 hosts, for which the default values (1 and 1) are sufficient. For AARCH64 hosts, the alignments would be overwritten from GCC spec files using the linker command line, e.g.: -z common-page-size=4 -z max-page-size=8 Ok for master? [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/remoteproc/pru_rproc.c?h=v6.1#n555 ld/ChangeLog: * scripttempl/pru.sc (_data_end): Remove the alignment. (.data): Align output section size to COMMONPAGESIZE. (.resource_table): Ditto. Signed-off-by: Dimitar Dimitrov --- ld/scripttempl/pru.sc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ld/scripttempl/pru.sc b/ld/scripttempl/pru.sc index 7cb80694641..4229bed99bb 100644 --- a/ld/scripttempl/pru.sc +++ b/ld/scripttempl/pru.sc @@ -147,7 +147,6 @@ SECTIONS ${RELOCATING+ *(.rodata:*)} ${RELOCATING+*(.gnu.linkonce.d*)} ${RELOCATING+*(.gnu.linkonce.r*)} - ${RELOCATING+. = ALIGN(4);} ${RELOCATING+ PROVIDE (_data_end = .) ; } ${RELOCATING+/* Merge the bss input sections into the output @@ -164,13 +163,22 @@ SECTIONS ${RELOCATING+*(COMMON)} ${RELOCATING+ PROVIDE (_bss_end = .) ; } + ${RELOCATING+/* In case this is the last input section, align to + keep the loadable segment size a multiple of the common page size. + Some SoCs have stricter memory size requirements than others. */ + . = ALIGN (CONSTANT (COMMONPAGESIZE));} } ${RELOCATING+ > dmem} /* Linux remoteproc loader requires the resource_table section - start address to be aligned to 8 bytes. */ - .resource_table ${RELOCATING-0} ${RELOCATING+ ALIGN (8)} : + start address to be aligned to 8 bytes for SoCs with AARCH64 + host processors. */ + .resource_table ${RELOCATING-0} ${RELOCATING+ ALIGN (CONSTANT (MAXPAGESIZE))} : { KEEP (*(.resource_table)) + ${RELOCATING+/* In case this is the last input section, align to + keep the loadable segment size a multiple of the common page size. + Some SoCs have stricter memory size requirements than others. */ + . = ALIGN (CONSTANT (COMMONPAGESIZE));} } ${RELOCATING+ > dmem} /* Global data not cleared after reset. */