Mail Archives: djgpp/1998/09/18/15:16:04
Rylan wrote:
> I've ran into a situation where attempting to use -O3 and even -O2 with ANY
> code that calls NASM compiled functions (in their own, seperate .O) compiles
> fine but crashes the moment the NASM code is reached. This happens without a
> stack trace, nothing - the whole program just stops. Unoptimized compiles of
> the same code runs 100%.
I can't know for sure without seeing your code, but the last several
times I have seen questions like yours, the NASM code had the wrong
segment name.
To use .o files with djgpp without any special linking tricks, the
executable portion of the .o file must be in a segment named ".text".
Other people have gotten that wrong, so that their NASM code
was never even reached by a call from the C code. It seemed to
work/not work based on subtle things (like your -O3). In fact
it wasn't working either way and the subtle change just moved
things around so the call reached a different wrong address.
If the above guess is wrong, post one of your nasm files so
we can give more informed answers.
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/
- Raw text -