When using sdcc to link objects using --no-std-crt0, _CODE = 0x0200 and _DATA = 0x8000 are still passed to the linker. e.g.
$ sdcc -mz80 --no-std-crt0 mycrt0.rel file1.rel file2.rel file3.rel
With --no-std-crt0, does it make sense to still pass these when linking this way?
I've logged this as a feature request, because I'm not sure it's a bug. When I'm linking, I have to arrange for symbols in my crt0 file, then pass these to the link line:
$ sdcc -mz80 --no-std-crt0 --out-fmt-ihx \ -Wl "-b _CODE = _crt_code_start" \ -Wl "-b _DATA = _crt_data_start" \ -o kernel.ihx \ ../ml/crt-kernel.rel version.rel ../disp/kernel_disp.lib ... etc ...
The crt contains (amongst other things):
.area _HEADER (ABS) ... _crt_code_start:: .area _CODE .area _CODE_END _crt_data_start:: .area _INITIALIZED
Thus the whole lot flows on from one section to another.
Incidentally, I stopped using an explicit linker file, as it became awkward to maintain across sdcc updates with changes to sdldz80 flags, linker filename changes, coding in knowledge of sdcc's installation directory (to link in z80.lib), etc...
Currently I'm using sdcc #8787.
Log in to post a comment.