~ubuntu-branches/debian/squeeze/ffcall/squeeze

« back to all changes in this revision

Viewing changes to ffcall/callback/trampoline_r/tramp-i386.s

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2010-06-26 15:29:30 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100626152930-c09y01gk3szcnykn
Tags: 1.10+cvs20100619-2
Ship to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Trampoline for i386 CPU */
2
 
 
3
 
/*
4
 
 * Copyright 1995-1999 Bruno Haible, <bruno@clisp.org>
5
 
 *
6
 
 * This is free software distributed under the GNU General Public Licence
7
 
 * described in the file COPYING. Contact the author if you don't have this
8
 
 * or can't live with it. There is ABSOLUTELY NO WARRANTY, explicit or implied,
9
 
 * on this software.
10
 
 */
11
 
 
12
 
/* Available registers: %eax, %edx, %ecx. */
13
 
/*
14
 
 * On Solaris 2.6, when the function being jumped to is an external symbol of
15
 
 * a shared library, the jump actually points to an ELF indirect jump:
16
 
 *   jmp *PTR
17
 
 * where PTR initially contains the address of some resolving routine which
18
 
 * will replace the PTR contents with the actual code address of the function
19
 
 * and then jump to the function.
20
 
 * Unfortunately, this resolving routine clobbers all three registers:
21
 
 * %eax, %edx, %ecx. Must pass the additional data via the stack.
22
 
 * A simple "pushl $<data>" is not sufficient: it causes trouble if the called
23
 
 * function is compiled with -fomit-frame-pointer.
24
 
 */
25
 
 
26
 
.globl _tramp
27
 
_tramp:
28
 
        popl %ecx
29
 
        pushl $0x73554711
30
 
        pushl %ecx
31
 
        jmp 0xbabebec0