[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    Re: [gentoo-dev] ASM resources?
From:       Anupam Kapoor <anupam.kapoor () gmail ! com>
Date:       2004-10-27 13:59:47
Message-ID: e3177630410270647358ab7 () mail ! gmail ! com
[Download RAW message or body]

On Wed, 27 Oct 2004 01:08:08 -0700, Robin H. Johnson <robbat2@gentoo.org> wrote:
> On Wed, Oct 27, 2004 at 09:43:23AM +0200, Luca Barbato wrote:
> > Robin H. Johnson wrote:
> > >If you find anything on how to write ASM code that works properly with
> > >-fPIC, please tell me! I've got a MySQL bug hung up on that point, and I
> > >haven't succeeded in finding out how to do such a thing.
> > I remember that with -fPIC you lose a register, you may try to use
> > -fomit-frame-pointer to get one back or rewrite your inline asm to use
> > one register less (quite painfull I think ^^)
> That's totally not the problem, see bug 42968.

afaik, the only way to do this is to use the GOT(global offset table)
to get the address of global symbols. once you have the address of the
GOT, you can then load the addresses of your variables from there e.g.

lea eax, [ebx + foo wrt ..gotoff]

to load the address of "foo" into eax.

this is all nasm speak. you can find more information regarding shared
libs + asm in section 8 of the wonderful info pages.

kind regards
anupam

-- 
if you need gmail invites, let me know !

--
gentoo-dev@gentoo.org mailing list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic