This is the mail archive of the ecos-discuss@sourceware.org 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: What is CYGBLD_ATTRIB_WEAK ?


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


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