Report locations for RGBLINK errors with conflicting objects (#1494)

This requires updating the object file format to record the
fstack context for sections themselves, not just for patches.
This commit is contained in:
Sylvie
2024-09-10 13:23:48 -04:00
committed by GitHub
parent 8cd0e66297
commit 1dcc000572
26 changed files with 173 additions and 79 deletions

View File

@@ -1 +1 @@
error: Section "Frag" is defined with conflicting 2-byte alignment (offset 1) and 4-byte alignment (offset 3)
error: Section "Frag" is defined with 2-byte alignment (offset 1) at fragment-align/base-bad/a.asm(2), but with 4-byte alignment (offset 3) at fragment-align/base-bad/b.asm(2)

View File

@@ -1 +1 @@
error: Section "Frag" is defined with conflicting address $0000 and 4-byte alignment (offset 2)
error: Section "Frag" is defined with address $0000 at fragment-align/org-bad/a.asm(2), but with 4-byte alignment (offset 2) at fragment-align/org-bad/b.asm(2)

View File

@@ -1 +1 @@
error: Section "Frag" is defined with conflicting 4-byte alignment (offset 1) and address $0006
error: Section "Frag" is defined with 4-byte alignment (offset 1) at fragment-align/org-rev-bad/a.asm(6), but with address $0006 at fragment-align/org-rev-bad/b.asm(2)

View File

@@ -0,0 +1,2 @@
SECTION "Same", ROM0
db 1

View File

@@ -0,0 +1,2 @@
SECTION "Same", ROM0
db 2

View File

@@ -0,0 +1 @@
error: Section "Same" is defined at section-normal/same-name/b.asm(1), but also at section-normal/same-name/a.asm(1)

View File

@@ -1,4 +1,4 @@
error: Section "conflicting alignment" is defined with conflicting 4-byte alignment (offset 0) and address $cafe
error: Section "conflicting alignment" is defined with 4-byte alignment (offset 0) at section-union/align-conflict.asm(7), but with address $cafe at section-union/align-conflict.asm(7)
---
error: <stdin>(18):
Section already declared as aligned to 4 bytes (offset 0)

View File

@@ -1,4 +1,4 @@
error: Section "conflicting alignment" is defined with conflicting 8-byte alignment (offset 7) and 16-byte alignment (offset 14)
error: Section "conflicting alignment" is defined with 8-byte alignment (offset 7) at section-union/align-ofs-conflict.asm(7), but with 16-byte alignment (offset 14) at section-union/align-ofs-conflict.asm(7)
---
error: <stdin>(18):
Section already declared with incompatible 8-byte alignment (offset 7)

View File

@@ -1,4 +1,4 @@
error: Section "conflicting types" is defined with conflicting types HRAM and WRAM0
error: Section "conflicting types" is defined with type HRAM at section-union/bad-types.asm(7), but with type WRAM0 at section-union/bad-types.asm(7)
---
error: <stdin>(18):
Section already exists but with type HRAM

View File

@@ -1,4 +1,4 @@
error: Section "conflicting banks" is defined with conflicting banks 4 and 1
error: Section "conflicting banks" is defined with bank 4 at section-union/bank-conflict.asm(5), but with bank 1 at section-union/bank-conflict.asm(5)
---
error: <stdin>(14):
Section already declared with different bank 4

View File

@@ -1,4 +1,4 @@
error: Section "conflicting alignment" is defined with conflicting 8-byte alignment (offset 7) and 8-byte alignment (offset 6)
error: Section "conflicting alignment" is defined with 8-byte alignment (offset 7) at section-union/different-ofs.asm(7), but with 8-byte alignment (offset 6) at section-union/different-ofs.asm(7)
---
error: <stdin>(18):
Section already declared with incompatible 8-byte alignment (offset 7)

View File

@@ -1,4 +1,4 @@
error: Section "conflicting address" is defined with conflicting addresses $beef and $babe
error: Section "conflicting address" is defined with address $beef at section-union/org-conflict.asm(7), but with address $babe at section-union/org-conflict.asm(7)
---
error: <stdin>(16):
Section already declared as fixed at different address $beef

View File

@@ -1 +1 @@
error: "Same" both in section-union/same-export/a.o from section-union/same-export/a.asm(2) and in section-union/same-export/b.o from section-union/same-export/b.asm(2)
error: "Same" is defined as a label at section-union/same-export/a.asm(2), but as another label at section-union/same-export/b.asm(2)

View File

@@ -0,0 +1 @@
EXPORT DEF SAME EQU 1

View File

@@ -0,0 +1 @@
EXPORT DEF SAME EQU 2

View File

@@ -0,0 +1 @@
error: "SAME" is defined as 2 at symbols/conflict/b.asm(1), but as 1 at symbols/conflict/a.asm(1)

View File

@@ -86,17 +86,6 @@ evaluateTest () {
fi
}
substPath () {
# Replace the file name with a different one to match changed output, escaping regex metacharacters
subst="$(printf '%s\n' "$1" | sed 's:[][\/.^$*]:\\&:g')"
sed -i'' -e "s|$subst|$2|g" "$3"
if which cygpath &>/dev/null; then
# Replace the MinGW path with a Windows path, escaping regex metacharacters
subst="$(cygpath -m "$1" | sed 's:[][\/.^$*]:\\&:g')"
sed -i'' -e "s|$subst|$2|g" "$3"
fi
}
for i in *.asm; do
test=${i%.asm}
startTest
@@ -268,6 +257,15 @@ rgblinkQuiet -o "$gbtemp" "$otemp" "$gbtemp2"
tryCmpRom "$test"/ref.out.bin
evaluateTest
test="section-normal/same-name"
startTest
"$RGBASM" -o "$otemp" "$test"/a.asm
"$RGBASM" -o "$gbtemp" "$test"/b.asm
continueTest
rgblinkQuiet "$otemp" "$gbtemp" 2>"$outtemp"
tryDiff "$test"/out.err "$outtemp"
evaluateTest
test="section-union/good"
startTest
"$RGBASM" -o "$otemp" "$test"/a.asm
@@ -283,8 +281,6 @@ startTest
"$RGBASM" -o "$gbtemp2" "$test"/b.asm
continueTest
rgblinkQuiet "$gbtemp2" "$otemp" 2>"$outtemp"
substPath "$otemp" "$test/a.o" "$outtemp"
substPath "$gbtemp2" "$test/b.o" "$outtemp"
tryDiff "$test"/out.err "$outtemp"
evaluateTest
@@ -294,8 +290,6 @@ startTest
"$RGBASM" -o "$gbtemp2" "$test"/b.asm
continueTest
rgblinkQuiet -o "$gbtemp" "$gbtemp2" "$otemp" 2>"$outtemp"
substPath "$otemp" "$test/a.o" "$outtemp"
substPath "$gbtemp2" "$test/b.o" "$outtemp"
tryDiff "$test"/out.err "$outtemp"
tryCmpRom "$test"/ref.out.bin
evaluateTest
@@ -317,6 +311,15 @@ for i in section-union/*.asm; do
evaluateTest
done
test="symbols/conflict"
startTest
"$RGBASM" -o "$otemp" "$test"/a.asm
"$RGBASM" -o "$gbtemp" "$test"/b.asm
continueTest
rgblinkQuiet "$otemp" "$gbtemp" 2>"$outtemp"
tryDiff "$test"/out.err "$outtemp"
evaluateTest
test="symbols/good"
startTest
"$RGBASM" -o "$otemp" "$test"/a.asm