From owner-freebsd-current Fri Dec 20 20:43:26 2002 Delivered-To: freebsd-current@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 3339737B401; Fri, 20 Dec 2002 20:43:25 -0800 (PST) Date: Fri, 20 Dec 2002 20:43:25 -0800 From: Juli Mallett To: Tim Robbins Cc: Joe Marcus Clarke , current@FreeBSD.ORG Subject: Re: WEIRD! div() broken on -CURRENT? Message-ID: <20021220204325.A76249@FreeBSD.org> References: <1040437478.29101.23.camel@shumai.marcuscom.com> <20021221145741.A14018@dilbert.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20021221145741.A14018@dilbert.robbins.dropbear.id.au>; from tjr@FreeBSD.ORG on Sat, Dec 21, 2002 at 02:57:41PM +1100 Organisation: The FreeBSD Project X-Alternate-Addresses: , , , , X-Towel: Yes X-LiveJournal: flata, jmallett X-Negacore: Yes Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * De: Tim Robbins [ Data: 2002-12-20 ] [ Subjecte: Re: WEIRD! div() broken on -CURRENT? ] > On Fri, Dec 20, 2002 at 09:24:39PM -0500, Joe Marcus Clarke wrote: > > I'm doing something wrong, right? I mean, this can't be right. I've > > verified this now on a P4 running: > [...] > > I can reproduce it here. It looks like gcc is using a strange calling > convention that the i386 div.S does not understand (MI div.c seems to, though). TenDRA and GCC3 use a different struct return format than we used to use (see http://gcc.gnu.org/ml/gcc-patches/2002-01/msg01783.html) and we never had a flag day for the old format, and there's no UPDATING or whatnot notes about this AFAIK. This means at least div has to change to use the new calling convention. Of course, this only applies to things in assembly, as everything else returning a struct (in C) already uses the format of the compiler that compiled it. Sure changing div will break dynamically linked programs using the old calling convention, but anything else returning a struct has already gone through this. This will only affect non-native compilers generating code on a running FreeBSD 5 system which use the old struct return format. Older FreeBSD programs will of course use the old format with an old libc using the old format, and so it will work if compatability libraries are used. What we need now is a belated UPDATING, HEADS UP, as surely this will affect some edge case, much like the __sF hiding did, though certainly not that exact same edge case. More likely someone calling div() in libc from assembly (though why they'd do that is beyond me). Thanx, juli. -- Juli Mallett OpenDarwin, Mono, FreeBSD Developer. ircd-hybrid Developer, EFnet addict. FreeBSD on MIPS-Anything on FreeBSD. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message