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.
Some compilers use the desc field to indicate the language of the source file. Sun’s compilers started this usage, and the first constants are derived from their documentation. Languages added by gcc/gdb start at 0x32 to avoid conflict with languages Sun may add in the future. A desc field with a value 0 indicates that no language has been specified via this mechanism.
K&R traditional C
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
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.
.stabs "/cygint/s1/users/jcm/play/",100,0,0,Ltext0 # 100 is N_SO .stabs "hello.c",100,0,0,Ltext0 .text Ltext0:
N_SO symbols, XCOFF uses a
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
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