aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-pe
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2022-07-23 00:57:19 +0300
committerMartin Storsjö <martin@martin.st>2022-08-01 23:18:00 +0300
commit61f6b650f9bb7fd276b45427b9202f3263465376 (patch)
tree7c7c11f7225cc35827abcc3f9af8d3fafaff11bd /ld/testsuite/ld-pe
parent37513c1efbe5e8e1863f8ddf078cd395aa663388 (diff)
downloadgdb-61f6b650f9bb7fd276b45427b9202f3263465376.zip
gdb-61f6b650f9bb7fd276b45427b9202f3263465376.tar.gz
gdb-61f6b650f9bb7fd276b45427b9202f3263465376.tar.bz2
ld: Support the -exclude-symbols option via COFF def files, with the EXCLUDE_SYMBOLS keyword
This was requested in review.
Diffstat (limited to 'ld/testsuite/ld-pe')
-rw-r--r--ld/testsuite/ld-pe/exclude-symbols-def-i386.d10
-rw-r--r--ld/testsuite/ld-pe/exclude-symbols-def-i386.s11
-rw-r--r--ld/testsuite/ld-pe/exclude-symbols-def-x86_64.d10
-rw-r--r--ld/testsuite/ld-pe/exclude-symbols-def-x86_64.s11
-rw-r--r--ld/testsuite/ld-pe/exclude-symbols-def.def4
-rw-r--r--ld/testsuite/ld-pe/pe.exp2
6 files changed, 48 insertions, 0 deletions
diff --git a/ld/testsuite/ld-pe/exclude-symbols-def-i386.d b/ld/testsuite/ld-pe/exclude-symbols-def-i386.d
new file mode 100644
index 0000000..1f15c89
--- /dev/null
+++ b/ld/testsuite/ld-pe/exclude-symbols-def-i386.d
@@ -0,0 +1,10 @@
+#source: exclude-symbols-def-i386.s
+#target: i?86-*-cygwin* i?86-*-pe i?86-*-mingw*
+#ld: -shared ${srcdir}/${subdir}/exclude-symbols-def.def
+#objdump: -p
+
+#...
+.*\[[ ]*0\] sym1
+.*\[[ ]*1\] sym3
+.*\[[ ]*2\] sym5
+#pass
diff --git a/ld/testsuite/ld-pe/exclude-symbols-def-i386.s b/ld/testsuite/ld-pe/exclude-symbols-def-i386.s
new file mode 100644
index 0000000..fd533bb
--- /dev/null
+++ b/ld/testsuite/ld-pe/exclude-symbols-def-i386.s
@@ -0,0 +1,11 @@
+.global _sym1
+.global _sym2
+.global _sym3
+.global _sym4
+.global _sym5
+_sym1:
+_sym2:
+_sym3:
+_sym4:
+_sym5:
+ ret
diff --git a/ld/testsuite/ld-pe/exclude-symbols-def-x86_64.d b/ld/testsuite/ld-pe/exclude-symbols-def-x86_64.d
new file mode 100644
index 0000000..39de881
--- /dev/null
+++ b/ld/testsuite/ld-pe/exclude-symbols-def-x86_64.d
@@ -0,0 +1,10 @@
+#source: exclude-symbols-def-x86_64.s
+#target: x86_64-*-cygwin* x86_64-*-pe x86_64-*-mingw*
+#ld: -shared ${srcdir}/${subdir}/exclude-symbols-def.def
+#objdump: -p
+
+#...
+.*\[[ ]*0\] sym1
+.*\[[ ]*1\] sym3
+.*\[[ ]*2\] sym5
+#pass
diff --git a/ld/testsuite/ld-pe/exclude-symbols-def-x86_64.s b/ld/testsuite/ld-pe/exclude-symbols-def-x86_64.s
new file mode 100644
index 0000000..2889de1
--- /dev/null
+++ b/ld/testsuite/ld-pe/exclude-symbols-def-x86_64.s
@@ -0,0 +1,11 @@
+.global sym1
+.global sym2
+.global sym3
+.global sym4
+.global sym5
+sym1:
+sym2:
+sym3:
+sym4:
+sym5:
+ ret
diff --git a/ld/testsuite/ld-pe/exclude-symbols-def.def b/ld/testsuite/ld-pe/exclude-symbols-def.def
new file mode 100644
index 0000000..c0cee7b
--- /dev/null
+++ b/ld/testsuite/ld-pe/exclude-symbols-def.def
@@ -0,0 +1,4 @@
+LIBRARY exclude-symbols-def.dll
+EXCLUDE_SYMBOLS
+sym2
+sym4
diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp
index b640b08..22819e0 100644
--- a/ld/testsuite/ld-pe/pe.exp
+++ b/ld/testsuite/ld-pe/pe.exp
@@ -127,3 +127,5 @@ run_ld_link_tests $foreign_sym_test
run_dump_test "exclude-symbols-embedded-i386"
run_dump_test "exclude-symbols-embedded-x86_64"
+run_dump_test "exclude-symbols-def-i386"
+run_dump_test "exclude-symbols-def-x86_64"