tech_log: gcc differences between .s and .S assembly file name suffix

Friday, December 12, 2008

gcc differences between .s and .S assembly file name suffix


Although the assembler can be invoked directly, assembly files are more typically passed through gcc. The case of the assembly
file’s suffix (.s versus .S) is important. If gcc is invoked with an uppercase assembly file suffix (.S) it is passed first to the
preprocessor whereas a lowercase file suffix (.s) passes goes directly to the assembler.

---



Please note that GCC treats files with the suffixes ".s" and ".S"
differently: the preprocessor is run on files with the ".S" (capital s)
suffix, not on the ones with the ".s" suffix.



---

file.s

Assembler code. Apple's version of GCC runs the preprocessor
on these files as well as those ending in `.S'.



file.S
Assembler code which must be preprocessed.






0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home