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: "Meulendijks, J." <Meulendijks at WT dot TNO dot NL>
- To: "'Andrew Lunn'" <andrew at lunn dot ch>
- Cc: "'ecos-discuss at ecos dot sourceware dot org'" <ecos-discuss at ecos dot sourceware dot org>
- Date: Fri, 15 Oct 2004 09:23:43 +0200
- Subject: RE: [ECOS] Difference between object file and archive
OK. That's clear but for example I have a section reset and I use this section
in the linkerscript like:
.reset : { *(.reset) }
So then I using it (I thought) but when I look in the .map file it's not there!
Why??
-----Original Message-----
From: Andrew Lunn [mailto:andrew@lunn.ch]
Sent: vrijdag 15 oktober 2004 09:15
To: Meulendijks, J.
Cc: 'ecos-discuss@ecos.sourceware.org'
Subject: Re: [ECOS] 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