This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: memory allocation
- From: zhaobin xv <xvzhaobin at gmail dot com>
- To: Ian Lance Taylor <iant at google dot com>, gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 19 Sep 2013 09:04:10 +0800
- Subject: Re: memory allocation
- Authentication-results: sourceware.org; auth=none
- References: <CANEcUBX9ntHdZ7qEJg7ke=MADcxfP_uOwNnA==XvKbf3kyH1Lw at mail dot gmail dot com> <CAKOQZ8zsfKUFv0PDhUmDWDgqD9p-xMYUfW_eR9B-TWx5yjmjeQ at mail dot gmail dot com>
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