Mail Archives: djgpp/1997/08/19/17:33:53
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).
Bill
--
Leave others their otherness.
- Raw text -