Allow STARTOF(SECTTYPE) and SIZEOF(SECTTYPE) to be constant when possible (#2131)

This commit is contained in:
Rangi authored and GitHub committed 2026-09-26 19:08:28 +02:00
1 parent 548a11c3ef
commit e0ee6c9013
6 files changed
+45 -6

No files matched your search

+11 -2
View File
@@ -772,7 +772,15 @@ and no longer the current section).
If
.Ar arg
is a section type keyword, it returns the size of that section type.
The result is not constant, since only RGBLINK can compute its value.
The result is a known constant except for
.Ic ROM0
and
.Ic WRAM0 ,
since their sizes may be affected by RGBLINK options
.Fl t
and
.Fl w
respectively.
.Pp
If
.Ar arg
@@ -786,7 +794,8 @@ The result is a known constant if the section has a fixed address.
If
.Ar arg
is a section type keyword, it returns the starting address of that section type.
The result is not constant, since only RGBLINK can compute its value.
.Pp
The result is always a known constant at assembly time.
.El
.Sh SECTIONS
Before you can start writing code, you must define a section.