diff --git a/ld/scripttempl/pe.sc b/ld/scripttempl/pe.sc index 59e4e89..0b5d1bf 100644 --- a/ld/scripttempl/pe.sc +++ b/ld/scripttempl/pe.sc @@ -92,10 +92,6 @@ SECTIONS ${RELOCATING+ *(.gnu.linkonce.t.*)} *(.glue_7t) *(.glue_7) - ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; - LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0); } - ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; - LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*)); LONG (0); } ${RELOCATING+ *(.fini)} /* ??? Why is .gcc_exc here? */ ${RELOCATING+ *(.gcc_exc)} @@ -124,6 +120,10 @@ SECTIONS .rdata ${RELOCATING+BLOCK(__section_alignment__)} : { ${R_RDATA} + ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; + LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0); } + ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; + LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*)); LONG (0); } ${RELOCATING+__rt_psrelocs_start = .;} KEEP(*(.rdata_runtime_pseudo_reloc)) ${RELOCATING+__rt_psrelocs_end = .;} diff --git a/ld/scripttempl/pep.sc b/ld/scripttempl/pep.sc index c682fe7..b2e3cd2 100644 --- a/ld/scripttempl/pep.sc +++ b/ld/scripttempl/pep.sc @@ -92,19 +92,6 @@ SECTIONS ${RELOCATING+ *(.gnu.linkonce.t.*)} *(.glue_7t) *(.glue_7) - ${CONSTRUCTING+. = ALIGN(8);} - ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; - LONG (-1); LONG (-1); - KEEP (*(.ctors)); - KEEP (*(.ctor)); - KEEP (*(SORT(.ctors.*))); - LONG (0); LONG (0); } - ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; - LONG (-1); LONG (-1); - KEEP (*(.dtors)); - KEEP (*(.dtor)); - KEEP (*(SORT(.dtors.*))); - LONG (0); LONG (0); } ${RELOCATING+ KEEP (*(.fini))} /* ??? Why is .gcc_exc here? */ ${RELOCATING+ *(.gcc_exc)} @@ -132,6 +119,19 @@ SECTIONS .rdata ${RELOCATING+BLOCK(__section_alignment__)} : { ${R_RDATA} + ${CONSTRUCTING+. = ALIGN(8);} + ${CONSTRUCTING+ ___CTOR_LIST__ = .; __CTOR_LIST__ = . ; + LONG (-1); LONG (-1); + KEEP (*(.ctors)); + KEEP (*(.ctor)); + KEEP (*(SORT(.ctors.*))); + LONG (0); LONG (0); } + ${CONSTRUCTING+ ___DTOR_LIST__ = .; __DTOR_LIST__ = . ; + LONG (-1); LONG (-1); + KEEP (*(.dtors)); + KEEP (*(.dtor)); + KEEP (*(SORT(.dtors.*))); + LONG (0); LONG (0); } ${RELOCATING+__rt_psrelocs_start = .;} KEEP(*(.rdata_runtime_pseudo_reloc)) ${RELOCATING+__rt_psrelocs_end = .;} diff --git a/ld/testsuite/ld-pe/longsecn-1.d b/ld/testsuite/ld-pe/longsecn-1.d index 81a44a7..20b4d94 100644 --- a/ld/testsuite/ld-pe/longsecn-1.d +++ b/ld/testsuite/ld-pe/longsecn-1.d @@ -8,7 +8,7 @@ Sections: Idx Name Size VMA +LMA +File off Algn 0 \.text [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] - CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA + CONTENTS, ALLOC, LOAD, READONLY, CODE 1 \.data [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA 2 \.rodata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] @@ -17,6 +17,8 @@ Idx Name Size VMA +LMA +File off Algn CONTENTS, ALLOC, LOAD, DATA 4 \.rodata\. [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA - 5 \.idata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + 5 \.rdata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, READONLY, DATA + 6 \.idata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA #... diff --git a/ld/testsuite/ld-pe/longsecn-2.d b/ld/testsuite/ld-pe/longsecn-2.d index 64d1627..2066780 100644 --- a/ld/testsuite/ld-pe/longsecn-2.d +++ b/ld/testsuite/ld-pe/longsecn-2.d @@ -8,7 +8,7 @@ Sections: Idx Name Size VMA +LMA +File off Algn 0 \.text [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] - CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA + CONTENTS, ALLOC, LOAD, READONLY, CODE 1 \.data [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA 2 \.rodata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] @@ -17,6 +17,8 @@ Idx Name Size VMA +LMA +File off Algn CONTENTS, ALLOC, LOAD, DATA 4 \.rodata\.very.long\.section [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA - 5 \.idata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + 5 \.rdata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, READONLY, DATA + 6 \.idata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA #... diff --git a/ld/testsuite/ld-pe/longsecn-3.d b/ld/testsuite/ld-pe/longsecn-3.d index c86a828..4de2135 100644 --- a/ld/testsuite/ld-pe/longsecn-3.d +++ b/ld/testsuite/ld-pe/longsecn-3.d @@ -10,7 +10,7 @@ Idx Name Size VMA +LMA +File off Algn 0 \.(text|bss ) [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] (CONTENTS, ALLOC, LOAD, (READONLY, )?CODE|ALLOC) 1 \.text\.very\.long\.section\.name [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] - CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA + CONTENTS, ALLOC, LOAD, READONLY, CODE 2 \.data [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA 3 \.data\$1 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] diff --git a/ld/testsuite/ld-pe/longsecn-4.d b/ld/testsuite/ld-pe/longsecn-4.d index e326d98..3b6e5c0 100644 --- a/ld/testsuite/ld-pe/longsecn-4.d +++ b/ld/testsuite/ld-pe/longsecn-4.d @@ -10,7 +10,7 @@ Idx Name Size VMA +LMA +File off Algn 0 \.(text|bss ) [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] (CONTENTS, ALLOC, LOAD, (READONLY, )?CODE|ALLOC) 1 \.text\.ve [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] - CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA + CONTENTS, ALLOC, LOAD, READONLY, CODE 2 \.data [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA 3 \.data\$1 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] diff --git a/ld/testsuite/ld-pe/longsecn-5.d b/ld/testsuite/ld-pe/longsecn-5.d index f3ef22b..e05a90f 100644 --- a/ld/testsuite/ld-pe/longsecn-5.d +++ b/ld/testsuite/ld-pe/longsecn-5.d @@ -10,7 +10,7 @@ Idx Name Size VMA +LMA +File off Algn 0 \.(text|bss ) [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] (CONTENTS, ALLOC, LOAD, (READONLY, )?CODE|ALLOC) 1 \.text\.very\.long\.section\.name [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] - CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA + CONTENTS, ALLOC, LOAD, READONLY, CODE 2 \.data [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA 3 \.data\$1 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] diff --git a/ld/testsuite/ld-pe/longsecn.d b/ld/testsuite/ld-pe/longsecn.d index e77f6ee..730079b 100644 --- a/ld/testsuite/ld-pe/longsecn.d +++ b/ld/testsuite/ld-pe/longsecn.d @@ -8,7 +8,7 @@ Sections: Idx Name Size VMA +LMA +File off Algn 0 \.text [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] - CONTENTS, ALLOC, LOAD, READONLY, CODE, DATA + CONTENTS, ALLOC, LOAD, READONLY, CODE 1 \.data [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA 2 \.rodata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] @@ -17,6 +17,8 @@ Idx Name Size VMA +LMA +File off Algn CONTENTS, ALLOC, LOAD, DATA 4 \.rodata\. [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA - 5 \.idata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + 5 \.rdata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, READONLY, DATA + 6 \.idata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] CONTENTS, ALLOC, LOAD, DATA #... diff --git a/ld/testsuite/ld-pe/longsecn.s b/ld/testsuite/ld-pe/longsecn.s index 1fc4da3..f47b848 100644 --- a/ld/testsuite/ld-pe/longsecn.s +++ b/ld/testsuite/ld-pe/longsecn.s @@ -9,7 +9,7 @@ _mainCRTStartup: data: .byte 2 - .section .text.very.long.section.name,"rx" + .section .text.very.long.section.name,"x" vls: .byte 3 diff --git a/ld/testsuite/ld-pe/orphan.d b/ld/testsuite/ld-pe/orphan.d index 4047a6a..7648e8a 100644 --- a/ld/testsuite/ld-pe/orphan.d +++ b/ld/testsuite/ld-pe/orphan.d @@ -6,8 +6,8 @@ #objdump: -h --wide #... - +0 +\.text .* + +0 +\.foo +0+20 .* +1 +\.foo +0+20 .* - +2 +\.foo +0+20 .* + +2 +\.rdata .* +3 +\.idata .* #pass diff --git a/ld/testsuite/ld-pe/orphan_nu.d b/ld/testsuite/ld-pe/orphan_nu.d index 5e88da7..c7d846a 100644 --- a/ld/testsuite/ld-pe/orphan_nu.d +++ b/ld/testsuite/ld-pe/orphan_nu.d @@ -6,8 +6,8 @@ #objdump: -h --wide #... - +0 +\.text .* + +0 +\.foo +0+20 .* +1 +\.foo +0+20 .* - +2 +\.foo +0+20 .* + +2 +\.rdata .* +3 +\.idata .* #pass diff --git a/ld/testsuite/ld-pe/secrel.d b/ld/testsuite/ld-pe/secrel.d index 3f1bb4a..6e31cd5 100644 --- a/ld/testsuite/ld-pe/secrel.d +++ b/ld/testsuite/ld-pe/secrel.d @@ -6,7 +6,6 @@ Contents of section \.text: .*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>>< .*1020 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<< .*1030 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>>< - .*1040 ........ ........ ........ ........ ................ Contents of section \.data: .*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<< .*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>>< @@ -22,6 +21,7 @@ Contents of section \.rdata: .*3000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<< .*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>>< .*3020 3e3e3e3e 00000000 00000000 00000000 >>>>............ + .*3030 ........ ........ ........ ........ ................ Contents of section \.idata: .*4000 00000000 00000000 00000000 00000000 ................ .*4010 00000000 .... diff --git a/ld/testsuite/ld-pe/secrel_64.d b/ld/testsuite/ld-pe/secrel_64.d index aba1bf1..9f26849 100644 --- a/ld/testsuite/ld-pe/secrel_64.d +++ b/ld/testsuite/ld-pe/secrel_64.d @@ -6,8 +6,6 @@ Contents of section \.text: .*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>>< .*1020 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<< .*1030 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>>< - .*1040 ffffffff ffffffff 00000000 00000000 ................ - .*1050 ffffffff ffffffff 00000000 00000000 ................ Contents of section \.data: .*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<< .*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>>< @@ -23,6 +21,8 @@ Contents of section \.rdata: .*3000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<< .*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>>< .*3020 3e3e3e3e 00000000 00000000 00000000 >>>>............ + .*3030 ffffffff ffffffff 00000000 00000000 ................ + .*3040 ffffffff ffffffff 00000000 00000000 ................ Contents of section \.idata: .*4000 00000000 00000000 00000000 00000000 ................ .*4010 00000000 .... diff --git a/ld/testsuite/ld-pe/tlssec64.d b/ld/testsuite/ld-pe/tlssec64.d index 692d9e4..98f8148 100644 --- a/ld/testsuite/ld-pe/tlssec64.d +++ b/ld/testsuite/ld-pe/tlssec64.d @@ -1,3 +1,3 @@ #... -Entry 9 0000000000003000 00000028 Thread Storage Directory \[\.tls\] +Entry 9 000000000000.000 00000028 Thread Storage Directory \[\.tls\] #...