Change behavior of merging FRAGMENTs to constrain each fragment individually

Additionally, remove the deprecated merging of non-fragment SECTIONs
This commit is contained in:
ISSOtm
2021-01-21 19:41:04 +01:00
committed by Eldred Habert
parent 6623b1dc45
commit 76446e6d00
60 changed files with 604 additions and 232 deletions

8
test/asm/align-16.asm Normal file
View File

@@ -0,0 +1,8 @@
SECTION "Byte", ROM0
db 2
SECTION "ROM0", ROM0, ALIGN[16]
db 1

0
test/asm/align-16.err Normal file
View File

0
test/asm/align-16.out Normal file
View File

View File

@@ -0,0 +1 @@


View File

@@ -0,0 +1,2 @@
SECTION "Tesst", ROM0, ALIGN[1,2]

View File

@@ -0,0 +1,3 @@
ERROR: align-large-ofs.asm(2):
Alignment offset (2) must be smaller than alignment size (2)
error: Assembly aborted (1 errors)!

View File

2
test/asm/align-large.asm Normal file
View File

@@ -0,0 +1,2 @@
SECTION "You lost the game", ROM0[17]

0
test/asm/align-large.err Normal file
View File

0
test/asm/align-large.out Normal file
View File

View File

@@ -0,0 +1,27 @@
SECTION "Word", ROM0/*[5]*/
dw $78df
SECTION FRAGMENT "Frag", ROM0/*[1]*/
db $40
SECTION FRAGMENT "Frag", ROM0/*[2]*/
db $2e
SECTION FRAGMENT "Frag", ROM0/*[3]*/,ALIGN[1,1]
db $1f
SECTION "Byte", ROM0/*[0]*/
db $44
SECTION FRAGMENT "Frag", ROM0/*[4]*/
db $7b
align 2, 1
SECTION FRAGMENT "Frag", ROM0[5]

View File

View File

View File

@@ -0,0 +1 @@
D@.{<7B>x

View File

@@ -0,0 +1,25 @@
SECTION FRAGMENT "Frag", ROM0[1]
db $40
SECTION "Word", ROM0/*[6]*/
dw $78d5
SECTION FRAGMENT "Frag", ROM0/*[2]*/,ALIGN[1]
db $2e
SECTION FRAGMENT "Frag", ROM0/*[3]*/
db $1f
SECTION "Byte", ROM0/*[0]*/
db $44
SECTION FRAGMENT "Frag", ROM0/*[4]*/
db $7b
align 2, 1

View File

View File

View File

@@ -0,0 +1 @@
D@.{<7B>x

View File

@@ -0,0 +1,25 @@
SECTION FRAGMENT "Frag", ROM0/*[1]*/
db $40
SECTION "Word", ROM0/*[6]*/
dw $78d5
SECTION FRAGMENT "Frag", ROM0/*[2]*/,ALIGN[1]
db $2e
SECTION FRAGMENT "Frag", ROM0/*[3]*/
db $1f
SECTION "Byte", ROM0/*[0]*/
db $44
SECTION FRAGMENT "Frag", ROM0/*[4]*/
db $7b
align 2 ; Uh oh

View File

@@ -0,0 +1,3 @@
ERROR: fragment-align.asm(25):
Section's alignment fails required alignment (offset from section start = $0004)
error: Assembly aborted (1 errors)!

View File

View File

@@ -1,10 +1,4 @@
ERROR: section-union.asm(37):
Section "test" already declared as union section
warning: section-union.asm(37): [-Wobsolete]
Concatenation of non-fragment sections is deprecated
ERROR: section-union.asm(37):
Section "test" already declared as fixed at $c000
ERROR: section-union.asm(37):
Section "test" already declared as aligned to 256 bytes
Section already declared as union section
FATAL: section-union.asm(37):
Cannot create section "test" (3 errors)
Cannot create section "test" (1 error)