It is how FPC smartlinks (with LD!)
Any chance of this being done with GPC? I guess that Peter is very busy at the moment - but can anyone else do it (or explain how it can be done)? Thanks.
FPC does this internally, but maybe it could be done without changes in GPC?
One should create a .s parser that can detect global syms and breaks the .s in pieces there, piping the different small .s files to the back end .assembler
so e.g.
- compiler pipes gpc.s to our filter program. - the filter program splits gpc.s per global symbol up in gpc00.s gpc01.s gpc02.s etc - the filter programs pipes each .s separately through as, generating a .o per .s - all .s files are combined to a .a by AR, which is executed by the filterprogram
It is DOG slow (which is the reason that it is internal in FPC now), but could be handy for release versions.
E.g. a windows API unit generates 20000 .s files.