Am 08.10.23 um 21:39 schrieb Kamila Szewczyk:
I am building a Z80 program for the TI-83+ calculator.
If I force the C compiler to not optimise out some floating point
operations to try them out, e.g. as such:

     volatile float a = 1.0;
     volatile float b = 2.0;
     volatile float c = a + b;

The generated code calls ___fsadd, which in turn is imported from one of
the libraries supplied with SDCC for z80. However, the size of my binary
explodes almost ten times, which happens due to the linker placing _CODE
at 0x4000 (where it should go), while the ___fsadd function is placed at
0x8000, where the DATA area starts, as the linker command is:

sdcc -mz80 --no-std-crt0 --code-loc 0x4000 --code-size 0x4000 --xram-loc
0x9D95 --xram-size 0x6060 ...

Is there a way to merge _HOME and _CODE? I have noticed that I can force
the compiler to move _HOME to a different memory location, but that
would force me to set a fixed size for either _HOME or _CODE (and then
never be warned if either overflows), which I don't want.

Yours,
Kamila Szewczyk

The linker picks the order of segments in the order it first encounters them. So you can list your custom crt0 has first object to be linked, and have the linker get the order from there (like in the default crt0, which you can use as an example).

Philipp



_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to