Rangi
b4988afc8a
Fix RGBLINK ignoring alignment constraints when placing empty sections
...
Fixes #2095
2026-09-17 11:16:18 -04:00
ISSOtm
6f69867d04
Make more RGBLINK tests use at-files
...
Less special handling = good
Possibly this can be done to more tests, but this is what I found.
2026-09-17 10:25:47 -04:00
ISSOtm
960f82126f
Fix to actually allow one-past-the-end zero-sized sections in linker scripts
2026-09-17 10:19:47 -04:00
ISSOtm
e39dbe1752
Remove no-op in link test script
...
No, `printf` does not do that.
This works because making it read from stdin suppresses
any words after the first one.
2026-09-17 09:35:32 -04:00
Rangi
b2967ff509
Correct rgblink(5) linkerscript doc to match behavior of unbanked ROMX/WRAMX ( #2103 )
2026-09-17 05:32:15 +02:00
Rangi
b0f49a36b7
Fix -t/--tiny for ROMX in bank 1, and -w/--wramx for WRAMX in bank 1 ( #2089 )
2026-09-14 15:53:45 -04:00
Rangi
a662cad7ce
Fix infinite loop when an aligned HRAM section cannot be placed ( #2064 )
2026-09-11 05:21:26 +02:00
Rangi
e85375f3e1
Avoid truncation warning from sp instruction test
2026-09-10 19:09:15 -04:00
Max Freedom Pollard
631ef003e7
Avoid signed overflow in RGBLINK's +, -, and * ( #2060 )
...
RGBASM computes these with unsigned arithmetic and casts back, since
signed overflow is UB in C++, but RGBLINK's RPN evaluator used `int32_t`
directly, so `src/link/patch.cpp` tripped UBSan on lines 117, 121, and
124. Share the three operators through `opmath.cpp` so both evaluators
stay in step.
2026-09-07 16:15:07 -04:00
Rangi
7d0cb000e8
Specify COLUMNS in test scripts for consistent output
2026-09-06 00:07:16 +02:00
Rangi
a2c52caca2
Disallow NUL characters in section names and assertion messages
...
Allowing these in object files would lose anything after the '\0'
when RGBLINK reads the object.
2026-08-22 19:51:03 -04:00
Rangi
0888600cb7
Avoid OOM allocation error from invalid too-high bank numbers
2026-08-22 18:31:26 -04:00
Rangi
8bc7de35f9
Prevent SECTION FRAGMENT combined sizes from overflowing their uint16_t size
2026-08-22 18:24:17 -04:00
Rangi
ec5e6cbabb
Handle -Wtruncation for link-time jr values
...
Fixes #2028
2026-07-21 14:51:58 -04:00
Rangi
d9c0d37fd5
Explicitly allow JR offsets to wrap around in RGBLINK
...
This reverts commit f27a8132d9 .
2026-07-20 19:23:11 -04:00
Rangi
19e60d9864
Fix large ds in linker script overflowing the PC
2026-07-14 00:42:42 -04:00
Rangi
5869e0dc60
Fix RGBLINK scrambling algorithm to work for SRAM
...
Since SRAM sections start from 0, we had been using a signed
`int8_t curScrambleSRAM` counter to allow 0 as a scrambled bank,
but this actually just placed all floating SRAM sections in bank 0.
2026-07-13 22:39:41 -04:00
Rangi
196d50c1d7
Add XXX: comment tag to working but fragile test cases
2026-07-13 22:39:41 -04:00
Rangi
417b5212d4
Fix OOM for too-small overlay files in 32K mode (rgblink -t)
2026-07-13 16:17:30 -04:00
Rangi
46a6966b70
Fix $8000_0000 % -1 to warn with -Wdiv like $8000_0000 / -1 does ( #2012 )
2026-07-06 15:08:44 -04:00
Rangi
be3fc61859
Fix included linker scripts with no newline at EOF ( #2011 )
2026-07-06 14:01:40 -04:00
Rangi
0adbb92e50
Same-line shellcheck comment explanations
...
These are obvious even with `git grep shellcheck`.
2026-07-06 04:43:08 +02:00
Rangi
09da4e001a
Use Bash arrays instead of POSIX splitting when possible
2026-07-06 04:43:08 +02:00
Rangi
de36a11be7
Prevent rgblink -Wno-* disabled warnings from printing a location trace anyway
...
Fixes #2005
2026-07-04 23:02:16 -04:00
Rangi
fc7d9ad573
Handle more numeric literal syntax errors in linker scripts
2026-06-09 18:46:51 -04:00
Rangi
6b2b6e6000
Fix off-by-one error with INCLUDEd linker script line numbers
2026-06-09 16:16:21 -04:00
Rangi42
f72a4d53e2
Add -Wlarge-constant to RGBLINK as it is for RGBASM
2026-06-09 16:16:21 -04:00
Rangi
996469ee28
Ensure CRLF line endings are preserved when necessary
...
Some test cases need CRLF line endings checked out even on Unix.
Also some source files had inadvertently contained CR bytes.
2026-05-25 22:00:45 -04:00
Rangi
d56dbbb4bf
Refactor section creation errors, and simplify output for single errors ( #1964 )
2026-05-21 13:01:08 -04:00
Rangi
d053025070
Avoid writing "XXX" since it's a conventional "TODO/FIXME" comment
2026-01-22 13:01:10 -05:00
Rangi
a91d26192d
Fix SECTION UNION alignment depending on piece order
2026-01-07 16:36:04 -05:00
Rangi
41fe1d8f25
Correct error message for unconstrained sections with overlay ( #1879 )
2025-12-28 19:21:53 -05:00
Rangi
2666dcbc26
Remove exclamation marks and periods from error messages ( #1874 )
2025-12-10 11:50:33 -05:00
Rangi
3553c9c4da
Fix RGBLINK evaluation of undefined RPN symbols
...
This was the only RPN case to not assign a deliberate value
in all possible branches.
Fixes #1858
2025-11-18 16:40:24 -05:00
Rangi
395b03e88e
Disallow SECTION UNION for ROM sections
...
Fixes #1855
2025-11-07 11:38:06 -05:00
Rangi
711fba5e35
Add more tests for things that only the external tests had covered
2025-10-08 13:32:48 -04:00
Rangi
fba0562650
Fix repeated REPT nodes in backtraces
2025-10-06 16:36:55 -04:00
Rangi42
96b953fe51
Add a test case for overlapping IF/ENDC and REPT/ENDR
...
This trips an asserton in the Rust rewrite because of its different
conditional stack design
2025-09-25 11:57:56 -04:00
Rangi42
ca4b890273
Consistently do & alignMask, not % alignSize
...
Also add more unrelated tests for coverage
2025-09-23 13:25:51 -04:00
Rangi42
1fdeb34e50
Fix too-short .out.bin expected test results
...
RGBASM tests now use `rgblink -x` instead of `dd` to get trimmed
test output. RGBLINK tests cannot do so because some of them
(e.g. bank-numbers.asm and sizeof-startof.asm) rely on ROMX
sections above 1, and `-x` implies `-t` which breaks that.
2025-09-15 09:25:33 -04:00
Rangi42
c8a088f281
Avoid nonessential EQUS expansion in tests
2025-09-06 13:45:12 -04:00
Rangi42
e569e0c200
Don't comment "; Next fragment/union" in .map files for empty section pieces
...
Fixes #1821
2025-09-05 15:31:46 -04:00
Rangi
534a4efee4
Add 0/1/2 warning levels to rgblink -Wtruncation ( #1816 )
2025-09-01 15:35:53 -04:00
Rangi42
92ed6ece53
Support 32-bit addresses ("XL4") as of SDCC 4.4.0
2025-08-20 09:17:45 -04:00
Rangi42
2bdf61da70
Increase RGBASM test coverage
2025-08-13 12:26:01 -04:00
Rangi
50d0b101c3
Format linker script error backtraces the same way as others ( #1792 )
2025-08-12 16:58:17 -04:00
Rangi
7b405513d9
Make quote marks consistent in error/warning messages ( #1791 )
...
- "Double quotes" for strings (filenames, section names, CLI option arguments, etc)
- 'Single quotes' for characters and CLI option flags
- `Backticks` for keywords and identifiers (symbol names, charmap names, etc)
CLI option flags also have their leading dashes
2025-08-12 15:24:21 -04:00
Rangi
7df9c12a6c
Fix division and modulo for very large negative numbers ( #1790 )
2025-08-11 20:46:47 -04:00
Rangi42
02310489c6
Suggest ld and call when failing to link ldh and rst
2025-08-11 15:02:18 -04:00
Rangi
5f8b7474b4
Add -B/--backtrace option to RGBASM and RGBLINK ( #1787 )
2025-08-11 14:30:14 -04:00