Role of edi/ebx during INTERNAL_SYSCALL

Mike Frysinger vapier@gentoo.org
Fri Apr 16 10:57:00 GMT 2010


On Friday 16 April 2010 03:42:17 Gaurav Mogre wrote:
> I've just recently tried to look around the libC code, and I'm just a
> bit confused on a few questions on INTERNAL_SYSCALL()   (for i386 via
> sysenter mechanism): If nr=3 (which is the case for __execve),
> LOADARGS_3 basically exchanges ebx and edi. I was wondering, why is it
> that the args are actually loaded into either edi and ebx? In general,
> how and when is the value of "args" stored in ebi
> I was also wondering where are the elf auxillary vectors actually
> parsed by libC into the TCB. I'm not really sure which functions call
> in the .ctors segment.

gcc does not allow %ebx to be clobbered in PIC code because it's the PIC 
register.  so glibc has to shuffle registers around behind the back of gcc so 
that it can work correctly while still compiling.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-help/attachments/20100416/4e37d507/attachment.sig>


More information about the Libc-help mailing list