www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/01/11/14:23:43

Date: Sun, 11 Jan 1998 14:21:58 -0500 (EST)
Message-Id: <199801111921.OAA26021@delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp-workers AT delorie DOT com
Subject: 8-byte stack alignment again

I just thought of something.  Here's the crt0.s code:

        movw    %ds, %dx                /* set stack */
        movw    %dx, %ss
        andb    $0xf8, %eax             /* align to 8-byte boundary */
        movl    %eax, %esp

        xorl    %ebp, %ebp
        call    ___crt1_startup         /* run program */
        jmp     exit


Won't the call make the stack 4-byte aligned again?  I think it does,
which would make pgcc code run at *worst* case (always unaligned)!

Maybe we do need to fix this in crt1.c, or mis-align %esp in crt0.s to
accomodate the call.

- Raw text -


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