This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Weak Alias and Static Question


Hi

Is it possible to have a static default function for a weak alias?
The pattern we are looking at is this in the C source file:

  static void bsp_start_default( void ){...}
  /*
    *  By making this a weak alias for bsp_start_default, a brave soul
    *  can override the actual bsp_start routine used.
    */
  void bsp_start (void) __attribute__ ((weak, alias("bsp_start_default")));

The public name is bsp_start() and that is the symbol defined in a public
.h. We want to allow an application can override it.

Will this use of a static behind the non-static work? Any gotchas
we should be aware of?

Thanks.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985


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