From owner-freebsd-current Tue Jun 26 10:17: 5 2001 Delivered-To: freebsd-current@freebsd.org Received: from ns.kobe1995.net (211.12.126.15.user.dt.il24.net [211.12.126.15]) by hub.freebsd.org (Postfix) with ESMTP id B9DDA37B405; Tue, 26 Jun 2001 10:16:51 -0700 (PDT) (envelope-from kaz@kobe1995.net) Received: (from kaz@localhost) by ns.kobe1995.net (8.8.8/3.7W-primary) id CAA02226; Wed, 27 Jun 2001 02:16:48 +0900 (JST) Date: Wed, 27 Jun 2001 02:16:48 +0900 (JST) Message-Id: <200106261716.CAA02226@ns.kobe1995.net> To: obrien@FreeBSD.ORG Cc: Alexander@Leidinger.net, sobomax@FreeBSD.ORG, current@FreeBSD.ORG, djhill@novagate.net Subject: Re: GNU ld(1) dumps core In-Reply-To: Your message of "Tue, 26 Jun 2001 07:23:57 -0700". <20010626072357.B11396@dragon.nuxi.com> From: kaz@kobe1995.net (NAKAMURA Kazushi) X-Mailer: mnews [version 1.22] 1999-12/19(Sun) 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 In article <20010626072357.B11396@dragon.nuxi.com> obrien@FreeBSD.ORG writes: >> Oops. I wanted to say: Every software which has a problem with ld >> dumping core uses nasm (so far). The core dump is a bug in ld, but I >> didn't know if the condition which triggers the core dump is a problem >> with nasm, the input of nasm, or a bug in ld. > >If someone could provide me with the minal input to nasm which then fed >to `ld' dumps core, it would really speed up a fix. :-) Not only nasm, but also gas has same problem. In case of ports/audio/gogo and ports/audio/lame, nasm outputs object which make ld dumps core. While gcc+gas outputs object which can't link by ld. I think the problem occures when "SSE instructions" and "align" are used. (Unfortunatry, most SSE instructions need 16Byte(=128bit) alined operands.) For example: ==> bug.C <== /* test program for SSE by kaz @ kobe1995.net % c++ -g bug.C && ./a.out But it fails. So, % c++ -g -S bug.C And change loop.s to avoid bug of gcc (may be): #APP - movaps ($A.15),%xmm0 - movaps ($B.16),%xmm1 + movaps A.15,%xmm0 + movaps B.16,%xmm1 #NO_APP % c++ loop.s && ./a.out */ #include #include #include #include #include main(){ static float __attribute__((aligned(16))) A[4]={1.,1.,1.,1.}, B[4]={0.,1.,2.,3.}, C[4]; int i; printf("float A=("); for(i=0;i<4;i++) printf("%f,",A[i]); printf("\b)\n"); printf("float B=("); for(i=0;i<4;i++) printf("%f,",B[i]); printf("\b)\n"); asm("movaps (%0),%%xmm0" //SSE : :"g"(A)); asm("movaps (%0),%%xmm1" //SSE : :"g"(B)); asm("addps %xmm1,%xmm0"); //SSE // asm("mulps %xmm1,%xmm0"); //SSE asm("movaps %%xmm0,%0":"=g"(C)); //SSE printf("float C=("); for(i=0;i<4;i++) printf("%f,",C[i]); printf("\b)\n"); } -- NAKAMURA Kazushi@KOBE To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message