[hellogcc] Re: Anyone know howto forced the stack alignment to 8 bytes or more ?

  • From: Mingjie Xing <mingjie.xing@xxxxxxxxx>
  • To: "hellogcc@xxxxxxxxxxxxx" <hellogcc@xxxxxxxxxxxxx>
  • Date: Mon, 21 Apr 2014 16:08:47 +0800

很少有目标机器会直接提供指定栈对奇方式的选项,估计是因为这个属于ABI的范畴吧,所以,一般你指定了一个abi,也就隐含的指定了栈的对齐方式,比如mips下的o32,
n32等。

如果是修改编译器本身,可以参见gccint里的17.5 Storage
Layout章节,里面介绍了相应的设置栈对齐方式的宏,STACK_BOUNDARY,PREFERRED_STACK_BOUNDARY等。

祝好
邢明杰

Other related posts: