This is the mail archive of the
mailing list for the binutils project.
Re: Why GNU LD puts ".?tor*" sections into ".text" section when linking a PE image?
- From: Nick Clifton <nickc at redhat dot com>
- To: Igor Kudrin <ikudrin at accesssoftek dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Thu, 1 Dec 2016 15:42:03 +0000
- Subject: Re: Why GNU LD puts ".?tor*" sections into ".text" section when linking a PE image?
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com>
> 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.