Memory allocation for local variables.

2006-12-13 Thread Sandeep Kumar
Hi all, I tried compiling the above two programs : on x86, 32 bit machines. And when I used objdump on that I saw the following code. Can anyone help me know, Why in the objdump of our first program the esp is decremented by 18H bytes and in the second program the esp is decremented by 28H bytes.

What is text.hot section in elf files ?

2006-02-05 Thread Sandeep Kumar
Hello everyone, While scrolling down the objdump of the code for /usr/bin/gcc, There is a section called text.hot section, which is normally not present on the elf files. What is that? is it something specific to /usr/bin/gcc only.How can be create such sections in our normal executables ? -- Reg

Problem with Trampolines initialization

2006-01-17 Thread Sandeep Kumar
Hello everyone, I have a doubt reagarding these trampolines, When i was going through the details in an atricle named GCC-INTERNALS, It said that we have a macro with the following name TRAMPOLINE_ADJUST_ADDRESS (addr). The explaination to it said that this is used mainly to perform any machine-

Re: Abnormal behavior of malloc in gcc-3.2.2

2005-11-20 Thread Sandeep Kumar
On 11/20/05, Andrew Pinski <[EMAIL PROTECTED]> wrote: > > > > Hi Everyone, > > > > int > > main () > > { > > int *p; > > int i; > > > > p = (int *) malloc (400 * sizeof (int)); > > for (i = 0; i < 512; i++) > > { > > p[i] = i; > > printf ("p[%d]: %d\n", i, p

Re: Abnormal behavior of malloc in gcc-3.2.2

2005-11-20 Thread Sandeep Kumar
On 11/20/05, Andrew Pinski <[EMAIL PROTECTED]> wrote: > > > Second you are invoking undefined behavior by accessing passed the array > > > bounds (or allocated > > > bounds by malloc). > > > > I didnt get your point. I am allocating space only for 400 inregers > > then as soon as in the loop if it

Abnormal behavior of malloc in gcc-3.2.2

2005-11-20 Thread Sandeep Kumar
Hi Everyone, int main () { int *p; int i; p = (int *) malloc (400 * sizeof (int)); for (i = 0; i < 512; i++) { p[i] = i; printf ("p[%d]: %d\n", i, p[i]); } return 0; } The following code should terminate with Segmentation fault, right ? But when