Date: Sun, 12 Mar 1995 03:57:53 -0800 From: hasty@netcom.com (Amancio Hasty Jr) To: bde@zeta.org.au, hackers@FreeBSD.org, hasty@netcom.com Subject: Re: text's start address? Message-ID: <199503121157.DAA18737@netcom14.netcom.com>
next in thread | raw e-mail | index | archive | help
This is what I am doing: gcc -Xlinker "-Z" static -o mdos.mon test.c here is a hexdump of mdos.mon: 0000000 010b 0000 9000 0000 2000 0000 2544 0000 0000010 102c 0000 0018 0000 0000 0000 0000 0000 0000020 0000 0000 0000 0000 0000 0000 0000 0000 * ------ (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 /bg/local/src/mdos/src/monitor > gdb mdos.mon GDB is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. GDB 4.13 (i386-unknown-freebsd), Copyright 1994 Free Software Foundation, Inc... (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? Tnks Amancio
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503121157.DAA18737>