diff options
Diffstat (limited to 'ld/testsuite/ld-pe')
-rwxr-xr-x | ld/testsuite/ld-pe/longsecn-1.d | 24 | ||||
-rwxr-xr-x | ld/testsuite/ld-pe/longsecn-2.d | 23 | ||||
-rwxr-xr-x | ld/testsuite/ld-pe/longsecn-3.d | 41 | ||||
-rwxr-xr-x | ld/testsuite/ld-pe/longsecn-4.d | 41 | ||||
-rwxr-xr-x | ld/testsuite/ld-pe/longsecn-5.d | 41 | ||||
-rwxr-xr-x | ld/testsuite/ld-pe/longsecn.d | 24 | ||||
-rwxr-xr-x | ld/testsuite/ld-pe/longsecn.exp | 35 | ||||
-rwxr-xr-x | ld/testsuite/ld-pe/longsecn.s | 44 |
8 files changed, 273 insertions, 0 deletions
diff --git a/ld/testsuite/ld-pe/longsecn-1.d b/ld/testsuite/ld-pe/longsecn-1.d new file mode 100755 index 00000000000..f860f1e5996 --- /dev/null +++ b/ld/testsuite/ld-pe/longsecn-1.d @@ -0,0 +1,24 @@ +#name: PE-COFF Long section names (disabled) +#ld: --disable-long-section-names +#objdump: -h +#source: longsecn.s + +.*: file format .* + +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 + 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 + 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 \.rodata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 4 \.data\.ve [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 5 \.rodata\. [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, 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 new file mode 100755 index 00000000000..278dc75618c --- /dev/null +++ b/ld/testsuite/ld-pe/longsecn-2.d @@ -0,0 +1,23 @@ +#name: PE-COFF Long section names (enabled) +#ld: --enable-long-section-names +#objdump: -h +#source: longsecn.s + +.*: file format .* + +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 + 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 + 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 \.rodata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 4 \.data\.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 \.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 + 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 new file mode 100755 index 00000000000..0317be3084a --- /dev/null +++ b/ld/testsuite/ld-pe/longsecn-3.d @@ -0,0 +1,41 @@ +#name: PE-COFF Long section names in objects (default) +#ld: -r +#objdump: -h +#source: longsecn.s + +.*: file format .* + +Sections: +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 + 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] + CONTENTS, ALLOC, LOAD, DATA + 4 \.rodata\$1 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 5 \.data\$123 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 6 \.rodata\$123 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 7 \.data\$123456789 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 8 \.rodata\$123456789 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 9 \.data\.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 + 10 \.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 + 11 \.data\.very\.long\.section\$1 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 12 \.rodata\.very\.long\.section\$1 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 13 \.data\.very\.long\.section\$1234 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 14 \.rodata\.very\.long\.section\$1234 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 15 \.(bss |text) [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + (ALLOC|CONTENTS, ALLOC, LOAD, (READONLY, )?CODE) diff --git a/ld/testsuite/ld-pe/longsecn-4.d b/ld/testsuite/ld-pe/longsecn-4.d new file mode 100755 index 00000000000..565ef38100b --- /dev/null +++ b/ld/testsuite/ld-pe/longsecn-4.d @@ -0,0 +1,41 @@ +#name: PE-COFF Long section names in objects (disabled) +#ld: --disable-long-section-names -r +#objdump: -h +#source: longsecn.s + +.*: file format .* + +Sections: +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 + 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] + 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 \.data\$12 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 6 \.rodata\$ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 7 \.data\$12 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 8 \.rodata\$ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 9 \.data\.ve [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 10 \.rodata\. [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 11 \.data\.ve [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 12 \.rodata\. [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 13 \.data\.ve [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 14 \.rodata\. [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 15 \.(bss |text) [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + (ALLOC|CONTENTS, ALLOC, LOAD, (READONLY, )?CODE) diff --git a/ld/testsuite/ld-pe/longsecn-5.d b/ld/testsuite/ld-pe/longsecn-5.d new file mode 100755 index 00000000000..82d94b8ab27 --- /dev/null +++ b/ld/testsuite/ld-pe/longsecn-5.d @@ -0,0 +1,41 @@ +#name: PE-COFF Long section names in objects (enabled) +#ld: --enable-long-section-names -r +#objdump: -h +#source: longsecn.s + +.*: file format .* + +Sections: +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 + 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] + CONTENTS, ALLOC, LOAD, DATA + 4 \.rodata\$1 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 5 \.data\$123 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 6 \.rodata\$123 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 7 \.data\$123456789 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 8 \.rodata\$123456789 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 9 \.data\.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 + 10 \.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 + 11 \.data\.very\.long\.section\$1 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 12 \.rodata\.very\.long\.section\$1 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 13 \.data\.very\.long\.section\$1234 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 14 \.rodata\.very\.long\.section\$1234 [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 15 \.(bss |text) [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + (ALLOC|CONTENTS, ALLOC, LOAD, (READONLY, )?CODE) diff --git a/ld/testsuite/ld-pe/longsecn.d b/ld/testsuite/ld-pe/longsecn.d new file mode 100755 index 00000000000..92269faff89 --- /dev/null +++ b/ld/testsuite/ld-pe/longsecn.d @@ -0,0 +1,24 @@ +#name: PE-COFF Long section names (default) +#ld: +#objdump: -h +#source: longsecn.s + +.*: file format .* + +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 + 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 + 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 \.rodata [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 4 \.data\.ve [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, DATA + 5 \.rodata\. [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ [0-9a-fA-F]+ 2\*\*[0-9] + CONTENTS, ALLOC, LOAD, 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.exp b/ld/testsuite/ld-pe/longsecn.exp new file mode 100755 index 00000000000..77de531f625 --- /dev/null +++ b/ld/testsuite/ld-pe/longsecn.exp @@ -0,0 +1,35 @@ +# Expect script for COFF long section name tests +# Copyright 2009 +# Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +# This test can only be run on PE/COFF platforms. +if {![is_pecoff_format]} { + return +} + +run_dump_test "longsecn" + +run_dump_test "longsecn-1" +run_dump_test "longsecn-2" +run_dump_test "longsecn-3" +run_dump_test "longsecn-4" +run_dump_test "longsecn-5" + diff --git a/ld/testsuite/ld-pe/longsecn.s b/ld/testsuite/ld-pe/longsecn.s new file mode 100755 index 00000000000..1fc4da36847 --- /dev/null +++ b/ld/testsuite/ld-pe/longsecn.s @@ -0,0 +1,44 @@ + .text + .global _start + .global _mainCRTStartup +_start: +_mainCRTStartup: + .byte 1 + .global data + .data +data: + .byte 2 + + .section .text.very.long.section.name,"rx" +vls: + .byte 3 + + .section .data$1,"wd" + .byte 4 + .section .rodata$1,"rd" + .byte 5 + + .section .data$123,"wd" + .byte 4 + .section .rodata$123,"rd" + .byte 5 + .section .data$123456789,"wd" + .byte 4 + .section .rodata$123456789,"rd" + .byte 5 + + .section .data.very.long.section,"wd" + .byte 6 + .section .rodata.very.long.section,"rd" + .byte 7 + + .section .data.very.long.section$1,"wd" + .byte 6 + .section .rodata.very.long.section$1,"rd" + .byte 7 + .section .data.very.long.section$1234,"wd" + .byte 6 + .section .rodata.very.long.section$1234,"rd" + .byte 7 + + .end |