I’ve now got my C compiler (and linker) working so it can just load up just parts of the program that are needed to run. Each source file contains one or more functions that compile into 6502 assembly which I then assemble in to machine code. I put some extra information with that machine code, a header structure, that describes its size, and where it would prefer to live in the Beeb’s memory map, and I save it to floppy.
My bootstrap code then loads in just those compiled source files needed at the time. Whenever a function is called, I check to see if the source file that has it is loaded in memory, and if its not, load it up. And if I don’t have enough memory, I kick out some other piece of code I am not using.
I haven’t figured out yet which piece of code it is efficient to kick out to make room for another piece of compiled code. Bit of a head scratcher that one.