Merge pull request #319 from mid-kid/patch-317

Allow linker script to consider section attributes
This commit is contained in:
Antonio Niño Díaz
2019-01-19 16:15:37 +00:00
12 changed files with 57 additions and 19 deletions

View File

@@ -20,4 +20,5 @@ for i in *.asm; do
fi
done
rm -f $o $gb $before $after
exit $rc

View File

@@ -6,4 +6,5 @@ for i in *.asm; do
mv -f $fname ${i%.asm}.out
done
rm -f $fname
exit 0

View File

@@ -0,0 +1,5 @@
ROM0
org $10
"sec"
org $20
"secfix"

View File

@@ -0,0 +1,2 @@
error: Different attributes for "sec" in source and linkerscript

View File

@@ -0,0 +1,2 @@
SECTION "sec",ROM0,ALIGN[4]
SECTION "secfix",ROM0[$20]

View File

@@ -0,0 +1,5 @@
ROM0
align 4
"sec"
org $20
"secfix"

View File

View File

@@ -16,6 +16,14 @@ head -c 20 $gbtemp > $otemp 2>&1
diff bank-numbers.out.bin $otemp
rc=$(($? || $rc))
$RGBASM -o $otemp section-attributes.asm
$RGBLINK -l section-attributes.link -o $gbtemp $otemp > $outtemp 2>&1
diff section-attributes.out $outtemp
rc=$(($? || $rc))
$RGBLINK -l section-attributes-mismatch.link -o $gbtemp $otemp > $outtemp 2>&1
diff section-attributes-mismatch.out $outtemp
rc=$(($? || $rc))
$RGBASM -o $otemp wramx-dmg-mode.asm
$RGBLINK -o $gbtemp $otemp > $outtemp 2>&1
diff wramx-dmg-mode-no-d.out $outtemp
@@ -60,4 +68,5 @@ $RGBLINK -o $gbtemp $otemp
diff all-instructions.out.bin $gbtemp
rc=$(($? || $rc))
rm -f $otemp $gbtemp $gbtemp2 $outtemp
exit $rc

View File

@@ -9,6 +9,12 @@ $RGBASM -o $otemp bank-numbers.asm
$RGBLINK -o $gbtemp $otemp > bank-numbers.out 2>&1
head -c 20 $gbtemp > bank-numbers.out.bin 2>&1
$RGBASM -o $otemp section-attributes.asm
$RGBLINK -l section-attributes.link \
-o $gbtemp $otemp > section-attributes.out 2>&1
$RGBLINK -l section-attributes-mismatch.link \
-o $gbtemp $otemp > section-attributes-mismatch.out 2>&1
$RGBASM -o $otemp wramx-dmg-mode.asm
$RGBLINK -o $gbtemp $otemp > wramx-dmg-mode-no-d.out 2>&1
$RGBLINK -d -o $gbtemp $otemp > wramx-dmg-mode-d.out 2>&1
@@ -28,4 +34,5 @@ $RGBLINK -t -o $gbtemp $otemp > romx-tiny-t.out 2>&1
$RGBASM -o $otemp all-instructions.asm
$RGBLINK -o all-instructions.out.bin $otemp 2>&1
rm -f $otemp $gbtemp
exit 0