Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
MPLAB
®
 XC8 C COMPILER
USER’S GUIDE
 2012 Microchip Technology Inc.
DS52053B-page 291
Chapter 8.  Utilities
8.1
INTRODUCTION
This chapters discusses some of the utility applications that are bundled with the 
compiler.
Some of these applications may not be normally invoked when building, but can be 
manually executed to perform certain tasks.
The following applications are described in this chapter of the MPLAB XC8 C Compiler 
User’s Guide:
• CREF
• HEXMATE
8.2
LIBRARIAN
The librarian program, LIBR, has the function of combining several files into a single 
file known as a library. The reasons you might want to use a library in a project are:
• there will be fewer files to link
• the file content will be accessed faster
• libraries uses less disk space
The librarian can build p-code libraries (.lpp extension) from p-code files (.p1 exten-
sion), or object code libraries (.lib extension) from object files (.obj extension). 
P-code libraries should be only created if all the library source code is written in C. 
Object code libraries should be used for assembly code that is to be built into a library.
With both library types, only those modules required by a program will be extracted and 
included in the program output.
8.2.1
The Library Format
The modules in a library are simply concatenated, but a directory of the modules and 
symbols in the library is maintained at the beginning of a library file. Since this directory 
is smaller than the sum of the modules, on the first pass the linker can perform faster 
searches just reading the directory, and not all the modules. On the second pass it need 
read only those modules which are required, seeking over the others. This all 
minimizes disk I/O when linking.
It should be noted that the library format is not a general purpose archiving mechanism 
as is used by some other compiler systems. This has the advantage that the format 
may be optimized toward speeding up the linkage process.