avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] Selective Construction


From: Bruce Graham
Subject: [avr-libc-dev] Selective Construction
Date: Tue, 18 May 2004 18:05:15 -0400

Kreyl,

The question I think you are asking is..."At compile time, among the
modules(files)  I have written, can the compiler know which functions
from the different modules(files) will be required in the final build."
In general the answer is NO, because each module (file)  is treated by
the compiler as a separate entity.  The last stage in building an
application is called "linkage editing" or "linking".  The linkage
editor takes all the modules(files) which have been compiled, resolves
all the references to code and data that it can, THEN it assumes that
any remaining references must belong to LIBRARY functions.  It is this
process of selecting only the required LIBRARY functions from a library
file that you may be thinking of.

For your UART example.  If you compile the UART functions and place them
in a library file similar to the ones which contain functions from the
standard libraries then I think you can get the behavior that you want.

Someone else needs to weigh in because I've only been here a week.  Can
we make our own libraries and tell the linker to use them either BEFORE
or AFTER the standard libraries?

Bruce







reply via email to

[Prev in Thread] Current Thread [Next in Thread]