While I'm not certain whether gcc is able to split one function's code between different sections (if for nothing else, this might help reduce TLB pressure by moving code unlikely to be executed not just out of the main function body), by way of inline assembly the Linux kernel certainly does in many places. Obviously, pure assembly make use of such even more heavily.
However, when frame unwind information is generated, one quickly becomes aware of a problem with this - the unwind information at a continuation point in other than the base section would need to replicate all unwind directives (note that DW_CFA_remember_state and DW_CFA_restore_state are not suitable here, as there need to be separate FDEs attached to the secondary code fragments). While this is generally possible (albeit tedious) in pure assembly code, doing so in inline assembly doesn't seem to be possible in any way (the compiler may not even use .cfi_* directives to emit frame unwind info). To cover all cases, it would basically appear to be necessary to add a referral op to the set of DW_CFA_* ops, which would indicate that the frame state at the given point is to be derived by assuming the location counter would in fact be at the origin of the control transfer). As I don't know how to approach requesting an addition like this to the Dwarf standard, I'm trying my luck here. Any pointers or suggestions are greatly appreciated. Thanks, Jan