mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Allow specifying offset in addition to alignment
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
error: Section "conflicting alignment" is defined with conflicting 4-byte alignment and address $cafe
|
||||
error: Section "conflicting alignment" is defined with conflicting 4-byte alignment (offset 0) and address $cafe
|
||||
---
|
||||
ERROR: -(18):
|
||||
Section "conflicting alignment" already declared as aligned to 4 bytes
|
||||
Section "conflicting alignment" already declared as aligned to 4 bytes (offset 0)
|
||||
ERROR: -(18):
|
||||
Cannot create section "conflicting alignment" (1 errors)
|
||||
|
||||
10
test/link/section-union/align-ofs-conflict.asm
Normal file
10
test/link/section-union/align-ofs-conflict.asm
Normal file
@@ -0,0 +1,10 @@
|
||||
IF !DEF(SECOND)
|
||||
ATTRS equs ",ALIGN[3,7]"
|
||||
ELSE
|
||||
ATTRS equs ",ALIGN[4,14]"
|
||||
ENDC
|
||||
|
||||
SECTION UNION "conflicting alignment", WRAM0 ATTRS
|
||||
db
|
||||
|
||||
PURGE ATTRS
|
||||
6
test/link/section-union/align-ofs-conflict.out
Normal file
6
test/link/section-union/align-ofs-conflict.out
Normal file
@@ -0,0 +1,6 @@
|
||||
error: Section "conflicting alignment" is defined with conflicting 8-byte alignment (offset 7) and 16-byte alignment (offset 14)
|
||||
---
|
||||
ERROR: -(18):
|
||||
Section "conflicting alignment" already declared with incompatible 3-byte alignment (offset 7)
|
||||
ERROR: -(18):
|
||||
Cannot create section "conflicting alignment" (1 errors)
|
||||
10
test/link/section-union/different-ofs.asm
Normal file
10
test/link/section-union/different-ofs.asm
Normal file
@@ -0,0 +1,10 @@
|
||||
IF !DEF(SECOND)
|
||||
ATTRS equs ",ALIGN[3,7]"
|
||||
ELSE
|
||||
ATTRS equs ",ALIGN[3,6]"
|
||||
ENDC
|
||||
|
||||
SECTION UNION "conflicting alignment", WRAM0 ATTRS
|
||||
db
|
||||
|
||||
PURGE ATTRS
|
||||
6
test/link/section-union/different-ofs.out
Normal file
6
test/link/section-union/different-ofs.out
Normal file
@@ -0,0 +1,6 @@
|
||||
error: Section "conflicting alignment" is defined with conflicting 8-byte alignment (offset 7) and 8-byte alignment (offset 6)
|
||||
---
|
||||
ERROR: -(18):
|
||||
Section "conflicting alignment" already declared with incompatible 3-byte alignment (offset 7)
|
||||
ERROR: -(18):
|
||||
Cannot create section "conflicting alignment" (1 errors)
|
||||
@@ -11,6 +11,11 @@ SECTION UNION "c", HRAM[$FFC0]
|
||||
ds 5
|
||||
c1::
|
||||
|
||||
SECTION UNION "d", SRAM,ALIGN[8,$BA]
|
||||
d1::
|
||||
|
||||
SECTION UNION "e", SRAM[$BABE]
|
||||
|
||||
|
||||
SECTION "output 1", ROM0
|
||||
dw a1,a2 ; $C00A, $C02A
|
||||
@@ -19,3 +24,4 @@ SECTION "output 1", ROM0
|
||||
|
||||
SECTION "output 3", ROM0
|
||||
db BANK(banked)
|
||||
dw d1,d2 ; $ABBA, $BBBA
|
||||
|
||||
@@ -12,6 +12,13 @@ b1: ; Same but in different sections now
|
||||
ds 5
|
||||
c2::
|
||||
|
||||
SECTION UNION "d", SRAM,ALIGN[12,$BBA]
|
||||
ds $1000
|
||||
d2::
|
||||
|
||||
SECTION UNION "e", SRAM,ALIGN[8,$BE]
|
||||
|
||||
|
||||
SECTION "output 2", ROM0
|
||||
dw a1,a2
|
||||
dw b1,b2
|
||||
|
||||
Reference in New Issue
Block a user