Node:Source Files, Next:Include Files, Previous:Main Program, Up:Program Structure

### Paths and Names of the Source Files

Before any other stabs occur, there must be a stab specifying the source file. This information is contained in a symbol of stab type `N_SO`; the string field contains the name of the file. The value of the symbol is the start address of the portion of the text section corresponding to that file.

With the Sun Solaris2 compiler, the desc field contains a source-language code.

Some compilers (for example, GCC2 and SunOS4 `/bin/cc`) also include the directory in which the source was compiled, in a second `N_SO` symbol preceding the one containing the file name. This symbol can be distinguished by the fact that it ends in a slash. Code from the `cfront` C++ compiler can have additional `N_SO` symbols for nonexistent source files after the `N_SO` for the real source file; these are believed to contain no useful information.

For example:

         .stabs "/cygint/s1/users/jcm/play/",100,0,0,Ltext0     # 100 is N_SO
         .stabs "hello.c",100,0,0,Ltext0
                 .text
         Ltext0:

Instead of `N_SO` symbols, XCOFF uses a `.file` assembler directive which assembles to a `C_FILE` symbol; explaining this in detail is outside the scope of this document.

If it is useful to indicate the end of a source file, this is done with an `N_SO` symbol with an empty string for the name. The value is the address of the end of the text section for the file. For some systems, there is no indication of the end of a source file, and you just need to figure it ended when you see an `N_SO` for a different source file, or a symbol ending in `.o` (which at least some linkers insert to mark the start of a new `.o` file).