This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Difference between object file and archive


On Fri, Oct 15, 2004 at 08:45:54AM +0200, Meulendijks, J. wrote:

> I have a question about object files and archives. My problem is
> when I put data in an object file and link this object during link
> time everything goes fine, but if I but this object file in an
> archive the linker cannot find the data in the object file?! (in
> other words when I open the .map file I cannot find the correct
> data!!) Maybe I'm doing something wrong but I cannot figure out
> what!  I'm sure that the linker can find the archive because other
> data from the archive IS found!

> Maybe someone can explain (or point me a direction) how I should put
> the data in an archive and link it during link time!?

The linker will only use symbols from the library that the application
actually uses. If you don't reference your data, its not needed so the
linker throws it away. For object files it includes all symbols, even
if they are not used.

        Andrew



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]