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]

CYGBLD_ATTRIB_WEAK (SIGTRAP on a weaked call)


Hello

Hope, here is a man which is familiar with GCC extentions. I get a
strange effect. Please, comment this. Why GDB get a SIGTRAP signal on a
function is declared with weak attribute?  I use arm-elf-gcc 3.2 and
arm-elf-gdb (5.3/6.1).

My variant misc file (lpc2xxx_misc.c) contains hal_hardware_init() call
with a platform depended init:

#ifdef HAL_PLF_HARDWARE_INIT
     // Perform any platform specific initializations
     HAL_PLF_HARDWARE_INIT();
#endif


If HAL_PLF_HARDWARE_INIT is declared in plf_io.h iwith WEAK attribute as


#ifndef __ASSEMBLER__
extern void hal_plf_hardware_init(void) CYGBLD_ATTRIB_WEAK;
#define HAL_PLF_HARDWARE_INIT() \
 	    hal_plf_hardware_init()
#endif

I get that SIGTRAP on the hal_plf_hardware_init call. Even if
hal_plf_hardware_init() has an empty body.

But, if I declare the macro without WEAK attribute:

#ifndef __ASSEMBLER__
extern void hal_plf_hardware_init(void);
#define HAL_PLF_HARDWARE_INIT() \
             hal_plf_hardware_init()
#endif

GDB pass it okay. What is it? May be I don't know a wellknown thing.

Thanks in advance for your help/comments.

Sergei

--
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]