From owner-freebsd-hackers Sun Mar 12 03:59:22 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id DAA14230 for hackers-outgoing; Sun, 12 Mar 1995 03:59:22 -0800 Received: from netcom14.netcom.com (hasty@netcom14.netcom.com [192.100.81.126]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id DAA14224 for ; Sun, 12 Mar 1995 03:59:22 -0800 Received: by netcom14.netcom.com (8.6.10/Netcom) id DAA18737; Sun, 12 Mar 1995 03:57:53 -0800 Date: Sun, 12 Mar 1995 03:57:53 -0800 From: hasty@netcom.com (Amancio Hasty Jr) Message-Id: <199503121157.DAA18737@netcom14.netcom.com> To: bde@zeta.org.au, hackers@FreeBSD.org, hasty@netcom.com Subject: Re: text's start address? Sender: hackers-owner@FreeBSD.org Precedence: bulk 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
: 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