This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: new memory debug feature
- From: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- To: Andrew Lunn <andrew at lunn dot ch>
- Cc: ecos-patches at sources dot redhat dot com
- Date: Thu, 01 Jul 2004 14:22:26 +0200
- Subject: Re: new memory debug feature
- References: <1088076300.19249.8.camel@famine> <20040625142035.GB5877@lunn.ch> <1088668854.6052.57.camel@famine> <20040701105550.GC11101@lunn.ch>
> > > Now the problem. I added the missing weak attribute. However, this
> > > causes problems for me. When the option is enabled and a failure
> > > happens, it crashes. All the tests in memalloc package fail
> > > horribly. If i remove the weak attribute they work.
> >
> > Can't we just leave out the weak attribute?
>
> Have you tried having your own implementation of
> cyg_memalloc_alloc_fail(). You should get a linker error since there
> are then two implementations of the same function and the linker does
> not know which to use. The solution to this is to make the one in the
> eCos library weak. The linker will then only use the weak symbol when
> there is no strong symbol.
It works fine without linker warnings/errors. I believe this is as
expected since it is in a .obj file all by itself.
--
Øyvind Harboe
http://www.zylin.com