This is the mail archive of the gcc-help@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: memory allocation


2013/9/17 Ian Lance Taylor <iant@google.com>:
> On Mon, Sep 16, 2013 at 1:43 AM, zhaobin xv <xvzhaobin@gmail.com> wrote:
>>
>> As I know in C :
>> 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.
>> I want to know what these base on to define?
>> Are there some manual or book about these?
>
> This question is not appropriate for the mailing list gcc@gcc.gnu.org,
> which is for the development of GCC itself.  It would be appropriate
> for gcc-help@gcc.gnu.org.  Please take any followups to gcc-help.
> Thanks.
>
> The document you are looking for is generally called the ABI for the
> target processor and operating system.  There are different ABIs for
> each processor, and different operating systems on each processor also
> have different ABIs.  If you tell us which specific processor and
> operating system you are interested in we may be able to point you at
> the ABI document for that target.
>
> Ian
 Thank lan for your answer
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.

according to elf or ABI?

do the segment originate from coff?


xvzhaobin


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