[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: glibc and egcs....



>>>>> "LP" == Loic Prylli <Loic.Prylli@ens-lyon.fr> writes:

    LP> 1) In the patches that makes crtbegin.o depends on
    LP> register_frame_info, there is a tentative try to declare this
    LP> undefined symbol as weak, which seems to me a dumb thing to do
    LP> when a symbol is undefined (because as far as I can tell the
    LP> weak declaration has no effect afterwards). I would be more
    LP> happy to understand why I am the stupid one in this regard,
    LP> and what I missed that makes a undefined weak symbol different
    LP> from a regular undefined one in some situations.

  If I remember rightly (although this was in the context of weak
aliases, which may or may not be the same thing), a weak symbol, in
the absence of a definition, resolves to zero. So, you can do things
like:

  extern void * (*weak_function)();
  if(weak_function) weak_function(foo);

  and, provided that weak_function is indeed a weak alias, it is
guaranteed to link and not try to call an unresolved symbol. Consider
s/weak_function/__register_frame_info/g?

  At least, I *think* that's how it works - feel free to correct me :)

m.


Reply to: