ARM Technical Support Knowledge Articles


Applies to: General Topics


Information in this article applies to:


I generated a library file (.lib) using the library manager and expected that if I compiled an independent source file and linked it with the library, the linker would take care of only pulling in the functions that were referenced. However, the linker is including all functions in each module from the library and I'm getting linker warnings about these uncalled functions.


Libraries are composed of object modules (which are composed of variables and functions). The smallest unit the linker can manipulate is an object module. So, when you reference a function from a library, the linker includes the entire object module that contains that function. This is only a problem when one object module in your library contains more than one function.


The only way to solve this problem is to build your library with one function per source file. Then, when the linker includes a segment from the library, only one function is included. This is the way that most professional libraries are created.

Article last edited on: 2005-02-05 14:51:12

Rate this article

Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential