https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120145

--- Comment #18 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Eric, it feels that I don't understand that this code is doing.
> 
>    0x000000e6d45f7b0c <+12>:    ldx  [ %o7 + 0x2c ], %g1
> => 0x000000e6d45f7b10 <+16>:    jmpl  %o7 + %g1, %g1
> 
> At begining it loads %o7 + 0x2c aka 0xe6d45f7b30
> <_z20notice_global_symbolp9tree_n...@got.plt> into %g1
> 
> After that it tries to jump to %o7 + %g1 which is wrong address:
> 
> (gdb) x/gx $o7 + $g1
> 0xfb8ee1f3d44f7b00:     Cannot access memory at address 0xfb8ee1f3d44f7b00
> (gdb) 

OK, it's the jmpl.  The @got.plt symbol is supposed to contain an offset so
adding it to %o7 (which contains the PC) makes sense.

What does %g1 alone point to?

Reply via email to