Archive for January 15th, 2010
Getting the IP in Gcc, OSX vs. Linux
Gcc on Linux uses thunks to find the current IP address when generating PIC code.
So, while Gcc on Mac OS X might generate:
0: call 5
5: pop %ebx
6: add $(GOT - 5),%ebx
Gcc on Linux would generate:
0: call 16 <__i686.get_pc_thunk.bx>
5: add $(GOT - 5),%ebx
00000016 <__i686.get_pc_thunk.bx>:
16: mov (%esp),%ebx
19: ret
Why???


RSS Feed

Connect with Us