On Wed, Sep 18, 2013 at 6:04 PM, zhaobin xv <xvzhaobin@xxxxxxxxx> wrote: > > I am studing cmplier and linux on arm,I want to know how complier > (such as gcc) to allocate memory? > > a. Global and static variables locate at data segment > b. When a function is called, memory is allocated on the stack to hold > parameter values, local variables, and the address of the calling > function > c. the struct is aligned based on the greatest alignment requirement > of it's members. Yes, that is all correct. > according to elf or ABI? The full ELF specification, including the appropriate ELF processor supplement for the processor in question, is itself the ABI for an operating system that uses ELF. So when you ask whether this is ELF or the ABI, you need to be clear on what you mean by ELF. > do the segment originate from coff? If you mean precisely "segment," then, no, COFF does not have segments. It only has sections. As far as I know ELF was the first object file format to have a clear notion of supporting an arbitrary number of segments that are composed of an arbitrary number of sections. Ian