From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id A7F213858D1E for ; Mon, 13 Mar 2023 17:35:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A7F213858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id E0C1A1FE17; Mon, 13 Mar 2023 17:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1678728956; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cMK2/lYBSKkFex65N6fTekNYAPh4AM0fQVdCR6gG0LI=; b=cJz1Jf58HwassMDn65T1lcRXNZC9Vf6+qKXbHMISStzFEMJb71ozp9cYZLa+GvBnb8EoLg hZ70mBxHVG87pyNSIApGZc2ePkx4eN93Q4PzcYIhtxbxEjF9Q16TZWq1MMR0w2DOEWB3YS 2AE7jwttJFhUBxkOjXIj3li9EoQpVTE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1678728956; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cMK2/lYBSKkFex65N6fTekNYAPh4AM0fQVdCR6gG0LI=; b=+MjHZhtxGxvolATg7tAs88FKR4ey+g4X+TRmOv/6rB+xrB+xtOQPD15TK7hL790BrkX0ah F+pb1VW8yK1m5gDQ== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id D2DD72C141; Mon, 13 Mar 2023 17:35:56 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id C90A2639B; Mon, 13 Mar 2023 17:35:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id C7D7F62EE; Mon, 13 Mar 2023 17:35:56 +0000 (UTC) Date: Mon, 13 Mar 2023 17:35:56 +0000 (UTC) From: Michael Matz To: Ulf Samuelsson cc: binutils@sourceware.org, nickc@redhat.com Subject: Re: [PATCH v1 0/7 SECTOR: Support aligning to flash sector boundary In-Reply-To: Message-ID: References: <95D14810-3DEE-44ED-B071-72BC8C3C3AC0@emagii.com> <662cb2c6-e42d-4d46-3978-7159e86d88e5@emagii.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,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 List-Id: Hello, On Mon, 13 Mar 2023, Ulf Samuelsson wrote: > > That doesn't matter so much. The point is that the linker script already > > supports an assortment of expressions, one of them 'ALIGN(EXP,ALIGN)' > > (with EXP being optional and "dot" by default). This expression can be > > used in arbitrary places right now. If it makes sense to use it in > > arbitrary places? Probably not, but who knows the future? That's why > > syntax extensions to the ldscripts should not necessarily prescribe usage, > > and be orthogonal (that was my ultimate reason for suggesting to have > > something returning the sector-size for a given address). > > SECTOR is a function which returns the size of the sector of the current > location and can be used to align an expression to that size. > > You can do ALIGN(exp, SECTOR) if you want to. That will align the > expression to the sector size of the current location. So there is no > problem with orthogonality. > > You are asking for a function which does something else. > > You can add a function (SECTOR_SIZE '(' exp ')') if you find it useful. SECTOR without argument is good enough for my taste. My main objection was to the new directive ALIGN_SECTOR; I suggested SECTOR(exp) only in response to your worry about a SECTOR expression (without argument, and hence an implicit "dot") being used outside output section statements without clear meaning. So, I'm happy :) Thanks for consideration. Ciao, Michael.