Re: [Mingw-msys] Cross compiler Linux -> msys
- Date: Wed, 18 Jul 2007 18:05:11 +0800 (CST)
- From: haibin zhang <dragzhb@xxxxxxxxxxxx>
- Subject: Re: [Mingw-msys] Assemble problem in Mingw32 (binutils-2.17.50-20070129-1.tar.gz)
--- Michael DOUBEZ <michael.doubez@xxxxxxx>写道:
> haibin zhang a écrit :
> > Hi All :
> > I test cpu id using as in
> > binutils-2.17.50-20070129-1.tar.gz, but it can't
> > compile pass, I have tested this in linux, it's
> ok.
> >
> > I have two file :cpuidfunc.s stringtest.c
> > I use compile command :
> > gcc -o test.exe cpuidfunc.s stringtest.c
> >
> > It print error :
> > $ gcc -o test.exe cpuidfunc.s stringtest.c
> > cpuidfunc.s: Assembler messages:
> > cpuidfunc.s:5: Warning: .type pseudo-op used
> outside
> > of .def/.endef ignored.
> > cpuidfunc.s:5: Error: junk at end of line, first
> > unrecognized character is `c'
> [snip]
> >
>
------------------------------------------------------------------------
> >
> > # cpuidfunc.s - An example of returning a string
> value
> > .section .bss
> > .comm output, 13
> > .section .text
> > .type cpuidfunc, @function
> > .globl cpuidfunc
> > cpuidfunc:
> [snip]
>
> From Gnu Assembler:
> http://tigcc.ticalc.org/doc/gnuasm.html#SEC133
>
> .type
>
> Syntax: .type int
>
> This directive, permitted only within .def/.endef
> pairs, records the
> integer int as the type attribute of a symbol table
> entry.
>
> The line should be.
> .globl cpuidfunc
> .def .type cpuidfunc, @function; .endef
>
>
I changed as you said, but it occur this error:
$ gcc -o haha cpuidfunc.s stringtest.c
cpuidfunc.s: Assembler messages:
cpuidfunc.s:7: Error: junk at end of line, first
unrecognized character is `c'
cpuidfunc.s:7: Error: unknown pseudo-op: `.enddef'
$ cat cpuidfunc.s
# cpuidfunc.s - An example of returning a string value
.section .bss
.comm output, 13
.section .text
# .type cpuidfunc, @function
.globl cpuidfunc
.def .type cpuidfunc, @function; .enddef
cpuidfunc:
pushl %ebp
movl %esp, %ebp
pushl %ebx
movl $0, %eax
cpuid
movl $output, %edi
movl %ebx, (%edi)
movl %edx, 4(%edi)
movl %ecx, 8(%edi)
movl $output, %eax
popl %ebx
movl %ebp, %esp
popl %ebp
ret
___________________________________________________________
抢注雅虎免费邮箱3.5G容量,20M附件!
http://cn.mail.yahoo.com
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mingw-msys mailing list
Mingw-msys@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/mingw-msys