You should use the
DEFAULT_ROM INTO OS_PAGED_E0, OS_NONPAGED;
order.
I try to explain the reason why with the other order the linking does fail for certain setups.
The problem is that DEFAULT_ROM fills up OS_NONPAGED and only the last few bytes of that section may be available to subsequently allocate COPY (the COPY section gets allocated last as its content depends on the content of the other READ_WRITE sections).
With the (not recommended) order
DEFAULT_ROM INTO OS_NONPAGED, OS_PAGED_E0;
the linker to places all objects (functions) from DEFAULT_ROM into OS_NONPAGED until one function does not completely fit into OS_NONPAGED anymore. When this happens the linker switches the output to the next segment, here OS_PAGED_E0, and starts placing this function and the future objects in this segment. There are usually a few bytes (less than the size of the first function in OS_PAGED_E0) left in OS_NONPAGED. The linking will now only succeed if the COPY section fits into this gap.
The number of the remaining bytes is pretty unpredictability and therefore the linking success or failure can be triggered by a small change in the C code.
The correct (and easy) way to fix this issue is to list the section which also gets COPY as the last one for any PLACEMENT is it used. With that setup the linking will only fail if there is really not enough space left.
In general I would recommend to list sections which can be used for different content behind sections which can only take some particular content. This is not only the case for banked vs non banked segments, but to give another example the S08 has zero page memory which can also be used to host non zero page variables, so those zero page segments can also be listed to receive non zero page content (which is a bit of a waste, but it is better to link that to fail).
BTW: There are linker options to cause the linker to fill up the remaining bytes more efficiently. With those the linking would have failed more likely :smileyhappy:
BTW2: The content of the STARTUP, STRINGS and other generic sections are allocated in the order they are listed in the prm, so in this case before DEFAULT_ROM. The only two exceptions are COPY and the checksum sections, the content (and size) of those two depend on other sections which have to be placed first.
Daniel