This is the mail archive of the ecos-discuss@sources.redhat.com 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]

Re: __CTORS__


  I can see it brighter now. I have also found the documentation that
talks about __CTOR_LIST__ at the documentation of the GNUPro Utilities.
now I see that only the global constructors are referenced here. (The
documentation differs a litte from what arm.ld does, it ommits the first
word with the number of entries and the last "0")

  Why do you say that they are sorted according to their priority?
  I have read that you can configure with CDL the priority that
determines when the different actions are taken. How do I tell gcc which
constructor is more prioritary?

  Thank you for your explanation, I'm not used to merging c, c++ and
assembler and the explanation of how the symbols are managed was what I
was lacking.

> The two symbols are the limits of an array of pointers to
> constructors. The pointers in this array get sorted (see linker
> script) according to their priority. We add the brackets in the C code
> to make the compiler treat the symbols as array references -- type
> information only exists in the compiler; in the linker a symbols is
> just named entity associated with an address.
>
> The code above iterates through the array from the top to the bottom
> (end-1 to start), calling each constructor in turn.
>
> Hope that helps.
>
> Jesper

  Of course it helps.


  Let me ask another question...
  While I was looking for where in hell was defined __CTOR_LIST__ I have
searched through lots of source files almost manually (grep __CTOR_LIST__
*). I'm sure that there's a simpler way to find where a symbol comes
from, Can anyone of you tell me if there's such a utility?

--
Rafael Rodríguez Velilla        rrv@tid.es
Telefónica I+D          http://www.tid.es
Telf: 34 - 1 - 91 337 4270




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