Mail Archives: djgpp/1997/08/19/17:33:53

Date: Wed, 20 Aug 1997 09:31:46 +1100
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: Function Sizes
In-reply-to: <Pine.SUN.3.91.970819161648.21250R-100000@is>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, DJGPP <djgpp AT delorie DOT com>,
chirayu AT radiolink DOT net
Message-id: <>
Organization: Tait Electronics Limited
MIME-version: 1.0
References: <1 DOT 5 DOT 4 DOT 16 DOT 19970819170452 DOT 3547702e AT giasbga DOT vsnl DOT net DOT in>
Comments: Authenticated sender is <billc AT blackmagic DOT tait DOT co DOT nz>

On 19 Aug 97 at 16:17, Eli Zaretskii wrote:

> On Tue, 19 Aug 1997, Chirayu Krishnappa wrote:
> > >aware that you cannot be always sure that it will work.  Subtle
> > >changes in compiler optimizations in some future release could
> > >rearrange functions and break this trick altogether.
> > 
> > But then we need some way to lock functions in a compatible (with future
> > compiler versions) manner. This seems to be the only method.
> The only reliable way is to write the function in assembly.

Not quite, you can also use the __attribute__((section)) method (gnu 
only of course) to put all code to be locked into a special section, 
use a special linker script to handle the new section correctly, and 
lock the whole section at once.  The only problems are: gcc for 
djgpp isn't configured to allow section attributes. I have the patch 
for this, and gcc-2.8 should be configured correctly (I've sent the 
patch to the maintainers). Also gas-2.8.1 (and below) has a bug that 
causes problems with relocations for `call' instructions (I have the 
patch and 2.8.2 will have the fix).
Leave others their otherness.

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019