Date: Wed, 17 Feb 1999 14:01:49 +1030 From: Greg Lehey <grog@lemis.com> To: Chuck Robey <chuckr@mat.net> Cc: Eivind Eklund <eivind@FreeBSD.ORG>, hackers@FreeBSD.ORG Subject: Re: gdb sucks - and I need to get around it. help? Message-ID: <19990217140149.B515@lemis.com> In-Reply-To: <Pine.BSF.4.05.9902162214340.327-100000@picnic.mat.net>; from Chuck Robey on Tue, Feb 16, 1999 at 10:17:22PM -0500 References: <19990217132952.Z515@lemis.com> <Pine.BSF.4.05.9902162214340.327-100000@picnic.mat.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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.<mumble>, 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990217140149.B515>