[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Problem med gcc -Os



Mads Bondo Dydensborg <sslug@sslug> writes:

> Jeg har det lidt spøjse problem at hvis jeg oversætter et program med -Os, 
> så sker der det at en variabel et sted ryger i et register, og 
> gudhjælpemig bliver overskrevet ved kald til en biblioteksrutine.
> 
> Virkeligt mystisk.

Hvilket register drejer det sig om, og på hvilken platform?

"calling convention" på linux/i386 er at:

den kaldte ("callee") gemmer %ebp, %esi, %edi, %ebx
kalderen ("caller") gemmer alle andre registre

Altså hvis du har noget i fx %ecx eller %eax skal du ikke regne med at
det er der efter du har kaldt en funktion.

Kilde:

http://www.fokus.gmd.de/linux/HOWTO/html_single/Assembly-HOWTO.html#S-CALL


-- 
===============================================================
<sslug@sslug>     Herlev, Denmark     Software Designer
<URL:http://www.andreasen.org/>   <*>  AvantiCore Semiconductor
===============================================================



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *