Fix stack alignment on 8 bytes at function call

Ensure stack pointer is correctly adjusted in prolog to be aligned on 8
bytes after the change of frame linking.
This commit is contained in:
Thomas Preud'homme 2013-01-27 01:08:01 +01:00
parent f3e5649150
commit 0f81512d7d

View File

@ -1231,7 +1231,7 @@ from_stack:
}
last_itod_magic=0;
leaffunc = 1;
loc = -12;
loc = 0;
}
/* generate function epilog */
@ -1255,9 +1255,9 @@ void gfunc_epilog(void)
diff = (-loc + 3) & -4;
#ifdef TCC_ARM_EABI
if(!leaffunc)
diff = (diff + 7) & -8;
diff = ((diff + 11) & -8) - 4;
#endif
if(diff > 12) {
if(diff > 0) {
x=stuff_const(0xE24BD000, diff); /* sub sp,fp,# */
if(x)
*(uint32_t *)(cur_text_section->data + func_sub_sp_offset) = x;