Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22048

What is the difference between __i686.get_pc_thunk and __x86.get_pc_thunk?

$
0
0

These helper functions are used by GCC and Clang in 32-bit x86 position-independent code to get the current execution address into a register, for example:

call    __i686.get_pc_thunk.bxaddl    $_GLOBAL_OFFSET_TABLE_, %ebxmovl    $2, 4(%esp)leal    .LC0@GOTOFF(%ebx), %eaxmovl    %eax, (%esp)call    dlopen@PLT

It seems the implementations are equivalent:

__x86.get_pc_thunk.bx:    movl    (%esp), %ebx    ret__i686.get_pc_thunk.bx:    movl (%esp), %ebx    ret

Is there any difference besides the name change (seems i686 is older)? And is there a reason for the i686 prefix instead of i386?


Viewing all articles
Browse latest Browse all 22048

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>