This is the mail archive of the 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]

[PATCH][ld] Put ".ctor*" and ".dtor*" to ".rdata".


The patch moves ".ctor*" and ".dtor*" input sections from ".text"
output section to ".rdata". As a result, the linker don't add
IMAGE_SCN_CNT_INITIALIZED_DATA flag to ".text" section and don't add
the size of the code section to field SizeOfInitializedData of
COFF Optional Header.

I've checked the generated executable images and dynamic libraries on
my environment and found no problems. I believe that there should not
be any issues because MS tools do the similar things.

Note: this patch requires
to work, otherwise, some tests will fail.

Best regards,
Igor Kudrin


	scripttempl/ Move .ctors* and .dtors* to .rdata section.
	scripttempl/ Likewise.
	testsuite/ld-pe/longsecn.s: Remove DATA flag from section.
	testsuite/ld-pe/longsecn-1.d: Adjust the testcase.
	testsuite/ld-pe/longsecn-2.d: Likewise.
	testsuite/ld-pe/longsecn-3.d: Likewise.
	testsuite/ld-pe/longsecn-4.d: Likewise.
	testsuite/ld-pe/longsecn-5.d: Likewise.
	testsuite/ld-pe/longsecn.d: Likewise.
	testsuite/ld-pe/orphan.d: Likewise.
	testsuite/ld-pe/orphan_nu.d: Likewise.
	testsuite/ld-pe/secrel.d: Likewise.
	testsuite/ld-pe/secrel_64.d: Likewise.
	testsuite/ld-pe/tlssec64.d: Likewise.

Attachment: ld-move-ctors-to-rdata.patch.txt
Description: ld-move-ctors-to-rdata.patch.txt

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