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]

Re: Why GNU LD puts ".?tor*" sections into ".text" section when linking a PE image?


Hi Igor,

> Can anybody explain, why ".ctor*" and ".dtor*" sections were added into a ".text" section? 
> Is it safe to move those statements to another place, like a ".rdata" section?

I can hazard a guess, but I cannot give you a definitive answer:

The reason I suspect is so that these sections contain function pointers
and so they should be considered to be part of the executable region of
the program.  This might be important on architectures which make a 
distinction between data and code fetches.

Cheers
  Nick


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