This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Difference between object file and archive
- From: Andrew Lunn <andrew at lunn dot ch>
- To: "Meulendijks, J." <Meulendijks at WT dot TNO dot NL>
- Cc: "'ecos-discuss at ecos dot sourceware dot org'" <ecos-discuss at ecos dot sourceware dot org>
- Date: Fri, 15 Oct 2004 09:14:57 +0200
- Subject: Re: [ECOS] Difference between object file and archive
- References: <6B80E71673E6D611AC1D0008C7F37BC203F8E5F4@wt15.wt.tno.nl>
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