From owner-freebsd-hackers Tue Feb 16 19:32: 4 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (Postfix) with ESMTP id 552891119B; Tue, 16 Feb 1999 19:31:53 -0800 (PST) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id OAA12854; Wed, 17 Feb 1999 14:01:52 +1030 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id OAA10420; Wed, 17 Feb 1999 14:01:50 +1030 (CST) Message-ID: <19990217140149.B515@lemis.com> Date: Wed, 17 Feb 1999 14:01:49 +1030 From: Greg Lehey To: Chuck Robey Cc: Eivind Eklund , hackers@FreeBSD.ORG Subject: Re: gdb sucks - and I need to get around it. help? References: <19990217132952.Z515@lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: ; from Chuck Robey on Tue, Feb 16, 1999 at 10:17:22PM -0500 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tuesday, 16 February 1999 at 22:17:22 -0500, Chuck Robey wrote: > On Wed, 17 Feb 1999, Greg Lehey wrote: >> There's stuff before main in C programs as well. The entry point >> of all C and C++ programs is start, which is in crt0.o or crt1.o. >> In a.out files, it used to be directly after the header at 0x1020. >> I'm not sure where the start address is in an ELF file. The clue >> should be here somewhere, but I can't see it: > > I thought the stuff before main() in C programs was strictly dealing > with shared loading (crt0.o stuff only), and only C++ programs had > actual code (global constructors) to execute. I don't regard the > loading stuff as part of a user's program, unless you're kernel hacking, > because it is not in any way modified by any user source. > > Is this really incorrect? Yes. Take a look at /usr/src/lib/csu/i386/crt0.c and marvel. I certainly did. The last time I looked at this file, in BSD/386 1., it was about 20 instructions. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message