aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/testsuite/ld-pe/pe.exp15
-rw-r--r--ld/testsuite/ld-pe/secidx.d27
-rw-r--r--ld/testsuite/ld-pe/secidx1.s77
-rw-r--r--ld/testsuite/ld-pe/secidx2.s17
-rw-r--r--ld/testsuite/ld-pe/secidx_64.d27
6 files changed, 171 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 7fb9f5d..1538f42 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,11 @@
+2022-04-07 Mark Harmstone <mark@harmstone.com>
+
+ * testsuite/ld-pe/secidx1.s: New test source file.
+ * testsuite/ld-pe/secidx2.s: New test source file.
+ * testsuite/ld-pe/secidx.d: New test driver file.
+ * testsuite/ld-pe/secidx_64.d: New test driver file.
+ * testsuite/ld-pe/pe.exp: Add new tests.
+
2022-03-01 Nick Clifton <nickc@redhat.com>
PR 21964
diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp
index f47c7eb..413b316 100644
--- a/ld/testsuite/ld-pe/pe.exp
+++ b/ld/testsuite/ld-pe/pe.exp
@@ -35,6 +35,8 @@ if {[istarget i*86-*-cygwin*]
set pe_tests {
{".secrel32" "--disable-reloc-section" "" "" {secrel1.s secrel2.s}
{{objdump -s secrel_64.d}} "secrel.x"}
+ {".secidx" "--disable-reloc-section" "" "" {secidx1.s secidx2.s}
+ {{objdump -s secidx_64.d}} "secidx.x"}
{"Empty export table" "" "" "" "exports.s"
{{objdump -p exports64.d}} "exports.dll"}
{"TLS directory entry" "" "" "" "tlssec.s"
@@ -44,6 +46,17 @@ if {[istarget i*86-*-cygwin*]
set pe_tests {
{".secrel32" "--disable-auto-import --disable-reloc-section" "" "" {secrel1.s secrel2.s}
{{objdump -s secrel.d}} "secrel.x"}
+ {".secidx" "--disable-auto-import --disable-reloc-section" "" "" {secidx1.s secidx2.s}
+ {{objdump -s secidx.d}} "secidx.x"}
+ {"Empty export table" "" "" "" "exports.s"
+ {{objdump -p exports.d}} "exports.dll"}
+ {"TLS directory entry" "" "" "" "tlssec.s"
+ {{objdump -p tlssec32.d}} "tlssec.dll"}
+ }
+ } elseif {[istarget arm-wince-pe] } {
+ set pe_tests {
+ {".secrel32" "--disable-reloc-section" "" "" {secrel1.s secrel2.s}
+ {{objdump -s secrel.d}} "secrel.x"}
{"Empty export table" "" "" "" "exports.s"
{{objdump -p exports.d}} "exports.dll"}
{"TLS directory entry" "" "" "" "tlssec.s"
@@ -53,6 +66,8 @@ if {[istarget i*86-*-cygwin*]
set pe_tests {
{".secrel32" "--disable-reloc-section" "" "" {secrel1.s secrel2.s}
{{objdump -s secrel.d}} "secrel.x"}
+ {".secidx" "--disable-reloc-section" "" "" {secidx1.s secidx2.s}
+ {{objdump -s secidx.d}} "secidx.x"}
{"Empty export table" "" "" "" "exports.s"
{{objdump -p exports.d}} "exports.dll"}
{"TLS directory entry" "" "" "" "tlssec.s"
diff --git a/ld/testsuite/ld-pe/secidx.d b/ld/testsuite/ld-pe/secidx.d
new file mode 100644
index 0000000..20ace36
--- /dev/null
+++ b/ld/testsuite/ld-pe/secidx.d
@@ -0,0 +1,27 @@
+
+tmpdir/secidx\.x: +file format pei-.*
+
+Contents of section .text:
+ .*1000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*1020 3c3c3c3c 3e3e3e3e 3e909090 ffffffff <<<<>>>>>.......
+ .*1030 00000000 ffffffff 00000000 ............
+Contents of section .data:
+ .*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*2020 3e3e3e3e 01001101 00110100 11010011 >>>>............
+ .*2030 3c3c3c3c 3c3c3c3c 3e3e3e3e 02001102 <<<<<<<<>>>>....
+ .*2040 00110200 11020011 3c3c3c3c 3c3c3c3c ........<<<<<<<<
+ .*2050 3e3e3e3e 03001103 00110300 11030011 >>>>............
+ .*2060 3c3c3c3c 3c3c3c3c 3e3e3e3e 01001102 <<<<<<<<>>>>....
+ .*2070 00110300 113c3c3c 3c3c3c3c 3c000000 .....<<<<<<<<...
+ .*2080 3c3c3c3e 3e3e3e3e 3e000000 <<<>>>>>>...
+Contents of section .rdata:
+ .*3000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*3020 3e3e3e3e 00000000 00000000 00000000 >>>>............
+ .*3030 3c3c3c3e 3e3e3e3e 3e000000 <<<>>>>>>...
+Contents of section .idata:
+ .*4000 00000000 00000000 00000000 00000000 ................
+ .*4010 00000000 ....
+#...
diff --git a/ld/testsuite/ld-pe/secidx1.s b/ld/testsuite/ld-pe/secidx1.s
new file mode 100644
index 0000000..b562caf
--- /dev/null
+++ b/ld/testsuite/ld-pe/secidx1.s
@@ -0,0 +1,77 @@
+.text
+
+ .ascii ">>>>"
+pre04: .ascii "<<<<"
+ .ascii ">>>>>"
+pre0d: .ascii "<<<"
+ .ascii ">>>>>>"
+pre16: .ascii "<<"
+ .ascii ">>>>>>>"
+pre1f: .ascii "<"
+
+.data
+
+ .ascii ">>>>"
+sam04: .ascii "<<<<"
+ .ascii ">>>>>"
+sam0d: .ascii "<<<"
+ .ascii ">>>>>>"
+sam16: .ascii "<<"
+ .ascii ">>>>>>>"
+sam1f: .ascii "<"
+
+ .ascii ">>>>"
+ .secidx pre04
+ .byte 0x11
+ .secidx pre0d
+ .byte 0x11
+ .secidx pre16
+ .byte 0x11
+ .secidx pre1f
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+ .ascii ">>>>"
+ .secidx sam04
+ .byte 0x11
+ .secidx sam0d
+ .byte 0x11
+ .secidx sam16
+ .byte 0x11
+ .secidx sam1f
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+ .ascii ">>>>"
+ .secidx nex04
+ .byte 0x11
+ .secidx nex0d
+ .byte 0x11
+ .secidx nex16
+ .byte 0x11
+ .secidx nex1f
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+ .ascii ">>>>"
+ .secidx ext1
+ .byte 0x11
+ .secidx ext2
+ .byte 0x11
+ .secidx ext3
+ .byte 0x11
+ .ascii "<<<<<<<<"
+
+.section .rdata
+
+ .ascii ">>>>"
+nex04: .ascii "<<<<"
+ .ascii ">>>>>"
+nex0d: .ascii "<<<"
+ .ascii ">>>>>>"
+nex16: .ascii "<<"
+ .ascii ">>>>>>>"
+nex1f: .ascii "<"
+ .ascii ">>>>"
+
+ .p2align 4,0
diff --git a/ld/testsuite/ld-pe/secidx2.s b/ld/testsuite/ld-pe/secidx2.s
new file mode 100644
index 0000000..0895bd9
--- /dev/null
+++ b/ld/testsuite/ld-pe/secidx2.s
@@ -0,0 +1,17 @@
+.text
+
+.global ext1
+ext1: .ascii "<<<<"
+ .ascii ">>>>>"
+
+.data
+
+.global ext2
+ext2: .ascii "<<<"
+ .ascii ">>>>>>"
+
+.section .rdata
+
+.global ext3
+ext3: .ascii "<<<"
+ .ascii ">>>>>>"
diff --git a/ld/testsuite/ld-pe/secidx_64.d b/ld/testsuite/ld-pe/secidx_64.d
new file mode 100644
index 0000000..ddf4aec
--- /dev/null
+++ b/ld/testsuite/ld-pe/secidx_64.d
@@ -0,0 +1,27 @@
+
+tmpdir/secidx\.x: +file format pei-.*
+
+Contents of section \.text:
+ .*1000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*1010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*1020 3c3c3c3c 3e3e3e3e 3e909090 90909090 <<<<>>>>>.......
+ .*1030 ffffffff ffffffff 00000000 00000000 ................
+ .*1040 ffffffff ffffffff 00000000 00000000 ................
+Contents of section \.data:
+ .*2000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*2010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*2020 3e3e3e3e 01001101 00110100 11010011 >>>>............
+ .*2030 3c3c3c3c 3c3c3c3c 3e3e3e3e 02001102 <<<<<<<<>>>>....
+ .*2040 00110200 11020011 3c3c3c3c 3c3c3c3c ........<<<<<<<<
+ .*2050 3e3e3e3e 03001103 00110300 11030011 >>>>............
+ .*2060 3c3c3c3c 3c3c3c3c 3e3e3e3e 01001102 <<<<<<<<>>>>....
+ .*2070 00110300 113c3c3c 3c3c3c3c 3c000000 .....<<<<<<<<...
+ .*2080 3c3c3c3e 3e3e3e3e 3e000000 00000000 <<<>>>>>>.......
+Contents of section \.rdata:
+ .*3000 3e3e3e3e 3c3c3c3c 3e3e3e3e 3e3c3c3c >>>><<<<>>>>><<<
+ .*3010 3e3e3e3e 3e3e3c3c 3e3e3e3e 3e3e3e3c >>>>>><<>>>>>>><
+ .*3020 3e3e3e3e 00000000 00000000 00000000 >>>>............
+ .*3030 3c3c3c3e 3e3e3e3e 3e000000 00000000 <<<>>>>>>.......
+Contents of section \.idata:
+ .*4000 00000000 00000000 00000000 00000000 ................
+ .*4010 00000000 ....