Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ syms(4) — A/UX 0.7

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sdb(1)

a.out(4)

linenum(4)



     syms(4)                                                   syms(4)



     NAME
          syms - common object file symbol table format

     SYNOPSIS
          #include  <syms.h>

     DESCRIPTION
          Common object files contain information to support symbolic
          software testing (see sdb(1).  Line number entries,
          linenum(4), and extensive symbolic information permit
          testing at the C source level.  Every object file's symbol
          table is organized as shown below.

                    Filename 1.
                         Function 1.
                              Local symbols for function 1.
                         Function 2
                              Local symbols for function 2.
                         ...
                         Static externs for file 1.

                    Filename 2.
                         Function 1.
                              Local symbols for function 1.
                         Function 2.
                              Local symbols for function 2.
                         ...
                         Static externs for file 2.
                    ...

                    Defined global symbols.
                    Undefined global symbols.

          The entry for a symbol is a fixed-length structure.  The
          members of the structure hold the name (null padded), its
          value, and other information.  The C structure is given
          below.

          #define  SYMNMLEN  8
          #define  FILNMLEN  14

          struct    syment
          {
           union                        /* ways to get a
                                           symbol name*/
           {
             char   _n_name[SYMNMLEN] ; /* names less than
                                           8 chars*/
             struct                     /* names 8 char
                                           or more*/
             {
                long        _n_zeroes;   /* == 0L when in



     Page 1                                        (last mod. 1/14/87)





     syms(4)                                                   syms(4)



                                            string table*/
                long        _n_offset;   /* location of name in
                                            table*/
             } n_n;
             char           *_n_nptr[2]; /*allows overlaying*/
          } _n;
             long           n_value ;    /*value of symbol*/
             short          n_scnum ;    /*section number*/
             unsigned short n_type ;     /*type and derived type*/
             char           n_sclass ;   /*storage class*/
             char           n_numaux ;   /*number of aux entries*/
          } ;
          #define    n_name      _n._n_name
          #define    n_zeroes    _n._n_n._n_zeroes
          #define    n_offset    _n._n_n._n_offset
          #define    n_nptr      _n._n_nptr[1]

          Meaningful values and explanations for them are given in
          both syms.h and Common Object File Format.  Anyone who needs
          to interpret the entries should seek more information in
          these sources.  Some symbols require more information than a
          single entry; they are followed by auxiliary entries that
          are the same size as a symbol entry.  The format follows.

          union auxent
          {
                 struct
                 {
                        long            x_tagndx;
                        union
                        {
                               struct
                               {
                                        unsigned short  x_lnno;
                                        unsigned short  x_size;
                               } x_lnsz;
                               long     x_fsize;
                        } x_misc;
                        union
                        {
                               struct
                               {
                                        long   x_lnnoptr;
                                        long   x_endndx;
                               }        x_fcn;
                               struct
                               {
                                        unsigned short  x_dimen[DIMNUM];
                               }        x_ary;
                        }               x_fcnary;
                        unsigned short  x_tvndx;
                 }      x_sym;



     Page 2                                        (last mod. 1/14/87)





     syms(4)                                                   syms(4)



                 struct
                 {
                        char   x_fname[FILNMLEN];
                 }      x_file;
                  struct
                  {
                          long    x_scnlen;
                          unsigned short  x_nreloc;
                          unsigned short  x_nlinno;
                  }       x_scn;

                 struct
                 {
                        unsigned short  x_tvlen;
                        unsigned short  x_tvran[2];
                 }      x_tv;
          };

          Indexes of symbol table entries begin at zero.

     SEE ALSO
          sdb(1), a.out(4), linenum(4).
          ``COFF Reference'' in Oreo Programming Languages and Tools,
          Volume 2.

     WARNING
          In machines in which longs are equivalent to ints (M68000
          and VAX), the longs are converted to ints in the compiler to
          minimize the complexity of the compiler code generator.
          Thus, the information about which symbols are declared as
          longs and which as ints cannot be determined from the symbol
          table.























     Page 3                                        (last mod. 1/14/87)



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026