You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Presently, the SDK maintains an invariant that all default C readonly sections are always visible in memory, no matter the state of the underlying system. For systems where the whole ROM image of the program is banked as a unit (that is, no portion of it is fixed), this typically requires duplicating the C readonly sections at the same address in each bank. This potentially wastes a ton of space, especially given library functions like printf.
Two requirements justify this invariant:
The compiler can insert calls to certain library functions (libcalls). There is no ABI or standard for how or when these will be generated, so there's generally no supported way to prevent the compiler from inserting them. Accordingly, they must always be visibile, since anything written in C may call them.
The compiler may rewrite a call from one C library function to another (e.g., printf can become puts). This only requires that C library functions are all equally callable: if any are callable, all are.
Accordingly, we could relax the SDK's invariants by moving the libcalls in the SDK into a special section: .text.fixed and/or .rodata.fixed. These sections would be duplicated across banks, but the main C sections could be placed in a single bank. This would free the other banks for other code and data, while still allowing such code to make libcalls at will.
The text was updated successfully, but these errors were encountered:
Presently, the SDK maintains an invariant that all default C readonly sections are always visible in memory, no matter the state of the underlying system. For systems where the whole ROM image of the program is banked as a unit (that is, no portion of it is fixed), this typically requires duplicating the C readonly sections at the same address in each bank. This potentially wastes a ton of space, especially given library functions like
printf
.Two requirements justify this invariant:
printf
can becomeputs
). This only requires that C library functions are all equally callable: if any are callable, all are.Accordingly, we could relax the SDK's invariants by moving the libcalls in the SDK into a special section:
.text.fixed
and/or.rodata.fixed
. These sections would be duplicated across banks, but the main C sections could be placed in a single bank. This would free the other banks for other code and data, while still allowing such code to make libcalls at will.The text was updated successfully, but these errors were encountered: