On Sun, May 18, 2008 at 7:11 PM, Mulyadi Santosa <[EMAIL PROTECTED]>
wrote:

> Hi man...
>
>
> On Sun, May 18, 2008 at 5:42 PM, Shyamal Shukla <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> >
> >      Came across an article from you on ELF files.
> >
> > <
> http://www.linuxforums.org/misc/understanding_elf_using_readelf_and_objdump_3.html
> >
> >
> > Can you please help me clarify a doubt on GOT entries.
> >
> > The third entry in GOT <<GOT+8>> is expected to transfer control to the
> > dynamic linker. The first entry of the PLT makes a
> > jmp *<<GOT+8>>.
> >
> > In my process, i have kept a long sleep before i exit, so that i can cat
> > /proc/xx/maps.
> >
> > The third entry of GOT seems to be 00 00 00 00. In that case, how does
> the
> > control move to the dynamic linker?
>
> Hm....I am now a bit rusty (again) on ELF stuff...but that's possible
> due to  your program doesn't actually call any libc function or
> function defined on external libraries, thus nothing is really need to
> be dynamically linked.
>
> Maybe you can share your source code and the way you compile it, so we
> can analyze it?
>
> regards,
>
> Mulyadi
>

The program is an extremely simple one, to get an idea as to where the stack
and heap lie, by making calls to malloc, printf and sleep.

#include <stdio.h>

void some_func()
{
  printf("\n I am here\n");
}

int main(void)
{
  int var = 5;
  int * iptr = malloc(sizeof(int));

  printf("\n Addr of var = %p, Dynamically allocated memory at
%p\n",&var,iptr);

  sleep(500);

  return 0;
}

Sleep(500) has been provided so that i can cat /proc/pid/maps

Compiled simply using gcc prog_name.c

I don't have LD_BIND_NOW defined on my system.

Regards,
Shyamal

-- 
Linux - because life is too short for reboots...

Reply via email to