Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Mar 1995 22:07:49 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, hackers@FreeBSD.org, hasty@netcom.com
Subject:   Re: text's start address?
Message-ID:  <199503121207.WAA11049@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>(mdos reads header of mdos.mon)
>gdb mdos
>...
>Breakpoint 1, main (argc=1, argv=0xefbfd978) at mdos.c:176
>176                     asm volatile("movl %1, %%esp; jmp %2" :
>(gdb) print ex
>$3 = {a_magic = 267, a_text = 36864, a_data = 8192, a_bss = 9540, 
>  a_syms = 4140, a_entry = 24, a_trsize = 0, a_drsize = 0}


>a_entry appears to have a low value

0x18.

>...
>(gdb) x/i main
>0x578 <main>:   pushl  %ebp

>So it appears that for me to get to main the actual address is
>0x1578. Now the question is how can I arrive at this number
>from the data structure ex?

Execution starts at 0x18, not at _main.  0x18 is in the data
structure.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503121207.WAA11049>