[lkml]   [2001]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Global Offset Table question..
Dave Airlie wrote:
> I've been trying to get dynamic loading on the Linux/VAX project going,
> and I've having trouble with the Global Offset Table and how it magically
> gets in to the ebx register on x86.. where is this done?
> I think I've looked at the kernel, gcc, binutils, 1.9, glibc 2.2.3
> and can't see exactly where this happens...
> Anyone care to enlighten my poor brain...
> Thanks,
> Dave.

I assume you are talking about position independant code? On the x86,
the only instructions that can use IP-relative addressing are branch
instructions. This asm fragment shows how it's done:

call 1f
1: popl %ebx
addl $(GOT - 1b), %ebx

If the Vax has better support for IP-relative addressing, this may be
easier. On recent x86 procesors, the above code will screw up the
call/return cache (branch prediction) and cause performance penalties.

Brian Gerst
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.029 / U:1.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site