In article <[EMAIL PROTECTED]>
[EMAIL PROTECTED] 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 <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include <stdlib.h>
#include <limits.h>

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");
}
-- 
<mailto:[EMAIL PROTECTED]>       NAKAMURA Kazushi@KOBE
<http://kobe1995.net/~kaz/index-e.html>

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to