Compiler versions tried are 3.0.0 and latest snapshot.
When I use the --no-std-crt0 option in a -mz80 build and supply my own crt0.rel file linking does not appear to be working correctly even when the crt0.rel file is a copy of the original z80 crt0.rel. The problem I see is the call to initialise the data array points to the C9 return code after the array initialisation code. In the attachment I have provided some simple test code and the good and bad binary images of the code produced.
To work around the problem I have to remove the --no-std-crt0 option and copy my customised crt0.rel file to the /usr/local/share/sdcc/lib/z80/ directory.
sdcc -mz80 --no-std-crt0 --data-loc 0 testcrt0.rel crt0.rel
Build that works
sdcc -mz80 --data-loc 0 testcrt0.rel
I'm new to sdcc so apologies if I'm doing something incorrect.