[ECOS] CYGBLD_ATTRIB_WEAK (SIGTRAP on a weaked call)

Sergei Gavrikov w3sg@SoftHome.net
Tue Jul 18 10:52:00 GMT 2006


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



More information about the Ecos-discuss mailing list