Library File Format


For library files, the first part of each chunk's name is "LIB_"; for object libraries, the names of the additional two chunks begin with "OFL_".

Each piece of a library file is stored in a separate, identifiable chunk, named as follows:

--------------------------------------------------------
Chunk        |Chunk Name                                
--------------------------------------------------------
Directory    |LIB_DIRY                                  
--------------------------------------------------------
Time stamp   |LIB_TIME                                  
--------------------------------------------------------
Version      |LIB_VSRN                                  
--------------------------------------------------------
Data         |LIB_DATA                                  
--------------------------------------------------------
Symbol table |OFL_SYMT (object code libraries only)     
--------------------------------------------------------
Time stamp   |OFL_TIME(object code libraries only)      
--------------------------------------------------------

There may be many LIB_DATA chunks in a library, one for each library member. In all chunks, word values are stored with the same byte order as the target system; strings are stored in ascending address order, which is independent of target byte order.

LIB_DIRY

The LIB_DIRY chunk contains a directory of the modules in the library, each of which is stored in a LIB_DATA chunk. The directory size is fixed when the library is created. The directory consists of a sequence of variable length entries, each an integral number of words long. The number of directory entries is determined by the size of the LIB_DIRY chunk. Pictorially:

-----------------------------------------------------
ChunkIndex           |                               
-----------------------------------------------------
EntryLength          |the size of this LIB_DIRY chunk
                     |(an integral number of words)  
-----------------------------------------------------
DataLength           |the size of the Data (an       
                     |integral number of words)      
-----------------------------------------------------
Data                 |                               
-----------------------------------------------------

ChunkIndex is a word containing the 0-origin index within the chunk file header of the corresponding LIB_DATA chunk. Conventionally, the first 3 chunks of an OFL file are LIB_DIRY, LIB_TIME and LIB_VSRN, so ChunkIndex is at least 3. A ChunkIndex of 0 means the directory entry is unused.

The corresponding LIB_DATA chunk entry gives the offset and size of the library module in the library file.

EntryLength is a word containing the number of bytes in this LIB_DIRY entry, always a multiple of 4.

DataLength is a word containing the number of bytes used in the data section of this LIB_DIRY entry, also a multiple of 4.

The Data section consists of, in order:

Strings should contain only ISO-8859 non-control characters (codes [0-31], 127 and 128+[0-31] are excluded).

The string field is the name used to identify this library module. Typically it is the name of the file from which the library member was created.

The format of the time stamp is described in Time stamps. Its value is an encoded version of the last-modified time of the file from which the library member was created.

To ensure maximum robustness with respect to earlier, now obsolete, versions of the ARM object library format:

Applications which write LIB_DIRY or OFL_SYMT entries should ensure that padding is done with NUL (0) bytes; applications which read LIB_DIRY or OFL_SYMT entries should make no assumptions about the values of padding bytes beyond the first, string-terminating NUL byte.

Time stamps

A library time stamp is a pair of words encoding the following:

Graphic cannot be displayed

The first word stores the most significant 4 bytes of the 6-byte count; the least significant 2 bytes of the count are in the most significant half of the second word.

The least significant half of the second word contains the microsecond count and is usually 0.

Time stamp words are stored in target system byte order: they must have the same endianness as the containing chunk file.

LIB_TIME

The LIB_TIME chunk contains a 2-word time stamp recording when the library was last modified. It is, hence, 8 bytes long.

LIB_VSRN

The version chunk contains a single word whose value is 1.

LIB_DATA

A LIB_DATA chunk contains one of the library members indexed by the LIB_DIRY chunk. The endian-ness or byte order of this data is, by assumption, the same as the byte order of the containing library/chunk file.

No other interpretation is placed on the contents of a member by the library management tools. A member could itself be a file in chunk file format or even another library.