This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: About STACK ALIGNMENT


"Rohit Arul Raj" <rohitarulraj@gmail.com> writes:

> 1. How do i get the stack alignment size of a particular target?
>    Does #define STACK_BOUNDARY 32 serve this purpose?

STACK_BOUNDARY is used to express the alignment maintained by the
hardware.  In practice this means that gcc can expect the stack to be
aligned to that boundary at function entry, and that gcc must maintain
that stack alignment when calling a function.  In some cases
maintaining that alignment may need to be implemented in the function
calling sequence.

> 2. Is it possible to override the STACK Alignment in ld file using ALIGN()?

No, that does not make sense.

> 3. Difference between stack alignment and data alignment?

One applies to the stack, which holds local variables, and the other
applies to global and static variables.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]