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

@@ -1,2 +1,2 @@
error: ./section-attributes-mismatch.link(3): The linker script assigns section "sec" to address $0018, but that would be ALIGN[4, 8] instead of the requested ALIGN[4, 0]
error: ./section-attributes-mismatch.link(3): The linker script assigns section "sec" to address $0018, but that would be ALIGN[4, 8] instead of the requested ALIGN[4, 2]
Linking failed with 1 error

View File

@@ -1,3 +1,3 @@
SECTION "sec",ROM0,ALIGN[4]
ds 8, $42
SECTION "sec",ROM0,ALIGN[4,2]
ds 6, $42
SECTION "secfix",ROM0[$20]

View File

@@ -1,6 +1,7 @@
ROM0
align 4
align 4, 2
"sec"
ds $18
org $20
align 5
"secfix"