[PATCH v1 0/7 SECTOR: Support aligning to flash sector boundary

Michael Matz matz@suse.de
Mon Mar 13 17:35:56 GMT 2023


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.


More information about the Binutils mailing list