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

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kkojima at gcc dot gnu.org

--- Comment #3 from Oleg Endo <olegendo at gcc dot gnu.org> ---
If I understand correctly, rebuilding the GOT pointer in r12 is necessary at
function entry, since it is generally not known if r12 is a valid GOT pointer
at function entry when mixing PIC code and non-PIC code.  Calling a PIC
function from a non-PIC function could result in a clobbered GOT pointer.

non_pic_func:
     mov.l  r12,@-r15
     mov.l  r11,@-r15

     <do stuff and clobber r12>

     <call PIC function here (r12 clobbered)>

     mov.l  @r15+,r11
     rts
     mov.l  @r15+,r12

Kaz, could you please confirm or refute this?

Reply via email to