Improve linker script align (#1271)

An offset is now supported, and invalid values are no longer silently
truncated, aligning behaviour with other instances of the directive.
This commit is contained in:
Rangi
2023-12-18 01:16:48 -05:00
committed by GitHub
parent 39018174c5
commit fdd45ab1dc
5 changed files with 54 additions and 20 deletions

View File

@@ -68,15 +68,25 @@ and
.Ic DS :
.Bl -bullet
.It
.Ic ORG
sets the address in which new sections will be placed.
.Ic ORG Ar addr
sets the address in which new sections will be placed to
.Ar addr .
It can not be lower than the current address.
.It
.Ic ALIGN
.Ic ALIGN Ar addr
or
.Ic ALIGN Ar addr , Ar offset
will increase the address until it is aligned to the specified boundary
.Po it tries to set to 0 the number of bits specified after the directive:
.Po it tries to set to
.Ar offset
the number of bits specified by
.Ar align :
for example,
.Ql ALIGN 8
will align to $100
will align to $100 ,
and
.Ql ALIGN 8 , 10
will align to $10A
.Pc .
.It
.Ic DS