From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85186 invoked by alias); 2 Nov 2018 11:01:24 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 85172 invoked by uid 89); 2 Nov 2018 11:01:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=expertise, distribute X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Nov 2018 11:01:22 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 28CA0C075674; Fri, 2 Nov 2018 11:01:21 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-117-198.ams2.redhat.com [10.36.117.198]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6BE6B1001943; Fri, 2 Nov 2018 11:01:20 +0000 (UTC) From: Florian Weimer To: Adrian Muresan Cc: "gcc-help\@gcc.gnu.org" Subject: Re: GNU linker script - how to automatically distribute code to multiple non-contiguous sections References: Date: Fri, 02 Nov 2018 11:01:00 -0000 In-Reply-To: (Adrian Muresan's message of "Tue, 30 Oct 2018 20:28:15 +0000") Message-ID: <87efc3eoar.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00004.txt.bz2 * Adrian Muresan: > I'm modifying an existing=C2=A0.ld=C2=A0and I have two flash sections for= the > code. These two flash sections are not contiguous so I cannot merely > extend the definition of one of the sections to include the other. > > Currently all of the code can fit in sec1 but if I turn off space > optimizations, it doesn't fit. > > QUESTION > > How do I write the .ld to say: place as much of the code as will fit > in sec1 and then as much as will fit in sec2 and then ... sec3... etc? This is more a question for the binutils list. Can you use the MEMORY directive and a region specifier on the output section definition to achieve this? (Sorry, not my area of expertise.) Florian