Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ld(1)

fseek(3S)

a.out(5)

SCNHDR(5)                            BSD                             SCNHDR(5)



NAME
     scnhdr - section header for a common object file

SYNOPSIS
     #include  <scnhdr.h>

DESCRIPTION
     Every common object file has a table of section headers to specify the
     layout of the data within the file.  Each section within an object file
     has its own header.  The C structure appears below.

     struct scnhdr {
            union section_name {
                    char _n_name[8];         /* Name lives here if 1-8 chars, */
                    struct {
                            long _n_zeroes;  /* zero if > 8 chars */
                            long _n_offset;  /* offset into string table. */
                            } _n_n;
                    char *_n_nptr[2];        /* allows overlaying */
                    } _n;
            long            s_paddr;         /* physical address */
            long            s_vaddr;         /* virtual address */
            long            s_size;          /* section size */
            long            s_scnptr;        /* file ptr to raw data for section */
            long            s_relptr;        /* file ptr to relocation */
            long            s_lnnoptr;       /* file ptr to line numbers */
            unsigned short  s_nreloc;        /* number of relocation entries */
            unsigned short  s_nlnno;         /* number of line number entries */
            long            s_flags;         /* flags */
            };

     File pointers are byte offsets into the file; they can be used as the
     offset in a call to FSEEK (see ldfcn(4)).  If a section is initialized,
     the file contains the actual bytes.  An uninitialized section is somewhat
     different.  It has a size, symbols defined in it, and symbols that refer
     to it.  But it can have no relocation entries, line numbers, or data.
     Consequently, an uninitialized section has no raw data in the object
     file, and the values for s_scnptr, s_relptr, s_lnnoptr, s_nreloc, and
     s_nlnno are 0.

SEE ALSO
     ld(1), fseek(3S), a.out(5).
     Domain/OS Programming Environment Reference.

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