|
|||||||||||
|
Technical Support Support Resources
Product Information |
GENERAL: How to Structure Modules in a LibraryInformation in this article applies to:
SYMPTOMSI am trying to create a library of functions, but each time I include it in my applications all the functions in the same file are included even if I do not use them. How should I structure the modules in a library file? CAUSEA module (object file) is the smallest translation unit that contains variables, functions, and so on. When the linker extracts variables or functions from a library, the whole module is included (not just the function or variable you use). It is not possible for the linker to extract anything smaller than a module from a library file. RESOLUTIONWhile is is not possible for the linker to break a module into smaller blocks, it is possible to do this when creating the source files. Basically, when creating a library, you should place only one function in a source file. Since each module will contain only one function (or one function and its support variables and routines) additional unused functions will not be included by the linker. SEE ALSOLast Reviewed: Thursday, February 25, 2021 | ||||||||||
|
|||||||||||
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.