Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ar(1)

ld(1)

ar(4)

RANLIB(4)

Series 200/300 and 500 Only

NAME

ranlib − archive symbol table format for object libraries

SYNOPSIS

#include <ranlib.h>

DESCRIPTION

Any archive containing object files also includes an archive symbol table, thus allowing the linker ld to scan libraries in random (rather than sequential) order. 

The archive symbol table (if it exists) is always the first file in the archive, but it is never listed.  It is automatically created and/or updated by ar.

The archive symbol table lists each externally known name in the archive, together with the offset of the archive element that defines that name.  This offset is useful as an input argument to lseek(2) or fseek(3). 

HARDWARE DEPENDENCIES

Series 500:
The archive symbol table file contains the symbol table and a name pool of strings (the names of external symbols).  This allows for symbols with arbitrarily long names.  The rl_hdr structure defines the layout of the file, and the rl_ref structure defines the contents of an archive symbol table entry.  These structures have the following format:

struct rl_hdr {
long int rl_tcbas;/* offset of table */
long int rl_tclen;/* length of table */
long int rl_nmbas;/* offset of name pool */
long int rl_nmlen;/* length of name pool */
};
struct rl_ref {
long int name_pos;/* index into name pool */
long int lib_pos;/* offset of defining file */
};

Series 200/300:
The archive symbol table file contains a header, a name pool of strings (the names of external symbols), and the archive symbol table.  This allows for symbols with arbitrarily long names.  The header contains a short integer which specifies the number of entries, and a long integer which specifies the size of the string table.  Following this is the name pool. The last section of the file contains the archive symbol table entries. The structure of these entries is defined below:

typedef long off_t;
structranlib {
union {
off_t ran_strx;/∗ string table index ∗/
char ∗ran_name;
} ran_un;
off_tran_off;/∗ lib member offset ∗/
};

SEE ALSO

ar(1), ld(1), ar(4). 

Hewlett-Packard Company  —  April 12, 1993

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