From owner-freebsd-hackers Thu Apr 2 19:15:55 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA06356 for freebsd-hackers-outgoing; Thu, 2 Apr 1998 19:15:55 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from cimlogic.com.au ([203.36.2.25]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA06219 for ; Thu, 2 Apr 1998 19:15:36 -0800 (PST) (envelope-from jb@cimlogic.com.au) Received: (from jb@localhost) by cimlogic.com.au (8.8.5/8.8.7) id NAA15959; Fri, 3 Apr 1998 13:15:27 +1000 (EST) (envelope-from jb) From: John Birrell Message-Id: <199804030315.NAA15959@cimlogic.com.au> Subject: Re: pthread question In-Reply-To: from "Jason K. Fritcher" at "Apr 2, 98 05:26:31 pm" To: fritcher@calweb.com (Jason K. Fritcher) Date: Fri, 3 Apr 1998 13:15:27 +1000 (EST) Cc: jb@cimlogic.com.au, hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jason K. Fritcher wrote: > [jkf@outreach:~/src/thread]$ gcc -g -D_THREAD_SAFE -o blah.o -c blah.c > [jkf@outreach:~/src/thread]$ ld -Bstatic /usr/lib/crt0.o blah.o -lc_r > blah.c:11: Undefined symbol `___main' referenced from text segment > > Does it normally look for ___main? I always thought it was just _main, or > __main. Never seen it use three _'s for main before. That's because when you use gcc to run ld, it knows to add crt0.o (or scrt0.o) and libgcc (which is where __main lives). When I said that I issue the compile and link commands separately, I should have explained that I still use gcc so that it adds the startfile and standard libraries. -- John Birrell - jb@cimlogic.com.au; jb@freebsd.org CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message