Gentoo Archives: gentoo-dev

From: Anupam Kapoor <anupam.kapoor@×××××.com>
To: Gentoo Developers <gentoo-dev@l.g.o>
Cc: Gentoo Developers <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] ASM resources?
Date: Wed, 27 Oct 2004 13:48:11
Message-Id: e3177630410270647358ab7@mail.gmail.com
In Reply to: Re: [gentoo-dev] ASM resources? by "Robin H. Johnson"
1 On Wed, 27 Oct 2004 01:08:08 -0700, Robin H. Johnson <robbat2@g.o> wrote:
2 > On Wed, Oct 27, 2004 at 09:43:23AM +0200, Luca Barbato wrote:
3 > > Robin H. Johnson wrote:
4 > > >If you find anything on how to write ASM code that works properly with
5 > > >-fPIC, please tell me! I've got a MySQL bug hung up on that point, and I
6 > > >haven't succeeded in finding out how to do such a thing.
7 > > I remember that with -fPIC you lose a register, you may try to use
8 > > -fomit-frame-pointer to get one back or rewrite your inline asm to use
9 > > one register less (quite painfull I think ^^)
10 > That's totally not the problem, see bug 42968.
11
12 afaik, the only way to do this is to use the GOT(global offset table)
13 to get the address of global symbols. once you have the address of the
14 GOT, you can then load the addresses of your variables from there e.g.
15
16 lea eax, [ebx + foo wrt ..gotoff]
17
18 to load the address of "foo" into eax.
19
20 this is all nasm speak. you can find more information regarding shared
21 libs + asm in section 8 of the wonderful info pages.
22
23 kind regards
24 anupam
25
26 --
27 if you need gmail invites, let me know !
28
29 --
30 gentoo-dev@g.o mailing list