title: Can GNU as process struct and function prototypes in assembly file(.s)?
body: <p>As we know, assembly files(.S) would get preprocessing before assembling, but I found that after preprocessing there may be struct/function prototypes in the resulting assembly files, How would the gnu as deal with these prototypes? Just ignored it?</p>
  
  <p>For example, the following command:</p>
  
  <blockquote>
    <p>gcc -E -o tmp.result arch/x86/boot/copy.S -Iinclude/ -Iarch/x86/include/</p>
  </blockquote>
  
  <p>and the resulting assembly file (tmp.result) is:</p>
  
  <pre><code># 1 "arch/x86/boot/copy.S"                                                                                                                                                                   
  # 1 "&lt;built-in&gt;"
  # 1 "&lt;command-line&gt;"
  # 1 "arch/x86/boot/copy.S"
  # 11 "arch/x86/boot/copy.S"
  # 1 "include/linux/linkage.h" 1
  # 1 "include/linux/compiler.h" 1
  # 5 "include/linux/linkage.h" 2
  # 1 "include/linux/stringify.h" 1
  # 6 "include/linux/linkage.h" 2
  # 1 "include/linux/export.h" 1
  # 26 "include/linux/export.h"
  struct kernel_symbol
  {
   unsigned long value;
   const char *name;
  };
  # 7 "include/linux/linkage.h" 2
  # 1 "arch/x86/include/asm/linkage.h" 1
  # 8 "include/linux/linkage.h" 2
  # 12 "arch/x86/boot/copy.S" 2
  .code16
  .text
  GLOBAL(memcpy)
   pushw %si 
   pushw %di 
   movw %ax, %di 
   movw %dx, %si 
   pushw %cx 
   shrw $2, %cx 
   rep; movsl
   popw %cx 
   andw $3, %cx 
   rep; movsb
   popw %di 
   popw %si 
   retl
  ENDPROC(memcpy)
  </code></pre>
  
  <p>but when trying to assemble this file:</p>
  
  <blockquote>
    <p>as -o tmp.o tmp.result</p>
  </blockquote>
  
  <p>produce following error:</p>
  
  <pre><code>include/linux/export.h: Assembler messages:
  include/linux/export.h:26: Error: no such instruction: `struct kernel_symbol'
  include/linux/export.h:27: Error: junk at end of line, first unrecognized character is `{'
  include/linux/export.h:28: Error: no such instruction: `unsigned long value'
  include/linux/export.h:29: Error: no such instruction: `const char *name'
  include/linux/export.h:30: Error: junk at end of line, first unrecognized character is `}'
  arch/x86/boot/copy.S:20: Error: invalid character '(' in mnemonic
  arch/x86/boot/copy.S:34: Error: invalid character '(' in mnemonic
  arch/x86/boot/copy.S:36: Error: invalid character '(' in mnemonic
  arch/x86/boot/copy.S:49: Error: invalid character '(' in mnemonic
  arch/x86/boot/copy.S:51: Error: invalid character '(' in mnemonic
  arch/x86/boot/copy.S:58: Error: invalid character '(' in mnemonic
  arch/x86/boot/copy.S:60: Error: invalid character '(' in mnemonic
  arch/x86/boot/copy.S:67: Error: invalid character '(' in mnemonic
  </code></pre>
  
  <p>It seems that the assembler can not deal with the struct in tmp.result. How can Linux source code(.S) get through the assembling?</p>