• Jeffrey Lee's avatar
    Update stubs to not use dangerous library chunk entries · 87239378
    Jeffrey Lee authored
    There are a few times over the years where existing library chunks have
    been extended by adding new entries onto the end. However this is an
    unsafe thing to do, because older CLibs which don't support those
    entries will do one of the following:
    
    * Fill the entries with branches to random addresses (pre-5.37)
    * Fill the entries with branches to zero (5.37+, APCS-R)
    * Fill the entries with random addresses within CLib (5.37+, APCS-32)
    
    To solve these problems, I've decided to go with the safest approach
    possible:
    
    * Add new library chunks containing all of the entries which had been
    added to existing chunks
    * For the stubs, the troublesome entries are only available via the new
    chunks, and the chunks they used to be in have been shrunk to their
    original sizes
    * For compatibility with programs built with old stubs, the CLib module
    supports the use of the troublesome entries by both the new chunks and
    their original chunks
    * Updated the "Add new entries ..." text in the chunk entry files to
    discourage people from adding new entries
    
    Programs built using these new stubs, which use the troublesome entries,
    will require the user to install a new CLib which supports the new
    chunks. Running against an old CLib will fail safely with an "Unknown
    library chunk" error.
    
    The new chunks are set up as follows:
    
    * Chunk 7 contains the C99 float/double math functions (63 entries)
    * Chunk 8 contains the C99 complex math functions (50 entries)
    * Chunk 9 contains the other functions which have been moved around
    (e.g. large file support, aligned allocs, _vswi) (24 entries)
    
    Version 6.18. Tagged as 'RISC_OSLib-6_18'
    87239378