This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: What is CYGBLD_ATTRIB_WEAK ?
- From: "St. Zarifakis" <stz at swistec dot de>
- To: Santanu Chatterjee <thisissantanu at gmail dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Tue, 23 Aug 2005 14:23:40 +0200
- Subject: Re: [ECOS] What is CYGBLD_ATTRIB_WEAK ?
- References: <42b9a27d05082303411102c205@mail.gmail.com>
Hi,
copied out from GCC documentation (Ch 5.25 Declaring Attributes of
Functions):
|weak|
The |weak| attribute causes the declaration to be emitted as a weak
symbol rather than a global. This is primarily useful in defining
library functions which can be overridden in user code, though it
can also be used with non-function declarations. Weak symbols are
supported for ELF targets, and also for a.out targets when using the
GNU assembler and linker.
Hope this helps
Stamatis
Santanu Chatterjee wrote:
Hello everybody,
I was trying to go through some of the source code of eCos, and stumbled across
the following in "ecos-2.0/packages/hal/common/v2_0/src/generic-stub.c":
------------------------------------------------------------------------------------------
#ifdef __ECOS__
char GDB_stubs_version[] CYGBLD_ATTRIB_WEAK =
"eCos GDB stubs - built " __DATE__ " / " __TIME__;
#endif
------------------------------------------------------------------------------------------
I could not understand the construct. What is CYGBLD_ATTRIB_WEAK?
etags search brings me to the same place. I grepped around and
found:
-----------------------------------------------------------------------------------
# define CYGBLD_ATTRIB_WEAK __attribute__ ((weak))
-----------------------------------------------------------------------------------
in "ecos-2.0/tools/src/infra/cyg_type.h". But I could not find out much
about this __attribute__ thing.
Could anyone here please help me out? I just want to find out how the
code within the #ifdef ... #endif expands to. I know about the -E option
in gcc but don't know how to apply it here.
Regards,
Santanu
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss