This simple program((AT&T Assembly Syntax) ) works fine on Linux, but compiles on windows with an error。
.section .text.type add,@function.global add add: pushq %rbp movq %rsp, %rbp movl %ecx, 16(%rbp) movl 16(%rbp), %eax imull %eax, %eax popq %rbp ret
The error is in the second line:
.type add,@function
this pseudo-command will report an error under windows with the following error message,use MinGw gcc:
add.S:2: Warning: .type pseudo-op used outside of .def/.endef: ignored.add.S:2: Error: junk at end of line, first unrecognized character is `a'
This is so strange and I want to know why?