http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12306

--- Comment #6 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Maybe something like function multi-versioning could be used for that?

When compiling as PIC, each function would be output twice.  Once with the
assumption that it can be called from non-PIC functions and once with the
assumption that it can't.  So we'll have one function that does the r12 stuff
and another that doesn't.  Then the linker could figure it out by e.g. dead
code stripping, and maybe also taking into account the visibility.  In the
worst case, if the linker can't make a decision, it should leave the
"with-r12-stuff" version.

Reply via email to