summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Korn <dave.korn@artimi.com>2009-05-17 05:10:21 +0000
committerDave Korn <dave.korn@artimi.com>2009-05-17 05:10:21 +0000
commit1eda3b4ab168cd1ba592aab9f433412f72305449 (patch)
tree73729e4fa5fda286965ec74fe268597277d6fe47
parentd9797696fc689c8b2e5d2c3d1cad0a1b1ab0c107 (diff)
downloadbinutils-redhat-1eda3b4ab168cd1ba592aab9f433412f72305449.tar.gz
Committed on behalf of
2008-08-07 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com> ld/ChangeLog: * pe-dll.c (process_def_file): Do not create empty export table. ld/testsuite/ChangeLog: * ld-pe/exports.d: New file. * ld-pe/exports.s: New file. * ld-pe/pe.exp: New test for empty export table.
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/pe-dll.c4
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-pe/exports.d4
-rw-r--r--ld/testsuite/ld-pe/exports.s2
-rwxr-xr-xld/testsuite/ld-pe/exports64.d4
-rw-r--r--ld/testsuite/ld-pe/pe.exp8
7 files changed, 35 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 01323e0bae..52364ef83b 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-17 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ 2008-08-07 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
+
+ * pe-dll.c (process_def_file): Do not create empty export table.
+
2009-05-15 Alan Modra <amodra@bigpond.net.au>
* ldlang.c (lang_output_section_statement_lookup): Add function
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index b5470c5c75..3f2815e37a 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -720,6 +720,10 @@ process_def_file (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
#undef NE
#define NE pe_def_file->num_exports
+ /* Don't create an empty export table. */
+ if (NE == 0)
+ return;
+
/* Canonicalize the export list. */
if (pe_dll_kill_ats)
{
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 839a40393f..4aef6b764d 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2009-05-17 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ 2008-08-07 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
+
+ * ld-pe/exports.d: New file.
+ * ld-pe/exports.s: New file.
+ * ld-pe/pe.exp: New test for empty export table.
+
2009-05-16 Alan Modra <amodra@bigpond.net.au>
* ld-elf/orphan3.d, * ld-elf/orphan3a.s, * ld-elf/orphan3b.s,
diff --git a/ld/testsuite/ld-pe/exports.d b/ld/testsuite/ld-pe/exports.d
new file mode 100644
index 0000000000..bbeda11d89
--- /dev/null
+++ b/ld/testsuite/ld-pe/exports.d
@@ -0,0 +1,4 @@
+#...
+The Data Directory
+Entry 0 00000000 00000000 Export Directory \[\.edata \(or where ever we found it\)\]
+#...
diff --git a/ld/testsuite/ld-pe/exports.s b/ld/testsuite/ld-pe/exports.s
new file mode 100644
index 0000000000..aac7075e7b
--- /dev/null
+++ b/ld/testsuite/ld-pe/exports.s
@@ -0,0 +1,2 @@
+# Deliberately left empty.
+
diff --git a/ld/testsuite/ld-pe/exports64.d b/ld/testsuite/ld-pe/exports64.d
new file mode 100755
index 0000000000..5fc5aeb15d
--- /dev/null
+++ b/ld/testsuite/ld-pe/exports64.d
@@ -0,0 +1,4 @@
+#...
+The Data Directory
+Entry 0 0000000000000000 00000000 Export Directory \[\.edata \(or where ever we found it\)\]
+#...
diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp
index 3cff6b4ebc..ad91f06c44 100644
--- a/ld/testsuite/ld-pe/pe.exp
+++ b/ld/testsuite/ld-pe/pe.exp
@@ -35,17 +35,23 @@ if {[istarget i*86-*-cygwin*]
if {[istarget x86_64-*-mingw*] } {
set pe_tests {
{".secrel32" "" "" {secrel1.s secrel2.s}
- {{objdump -s secrel_64.d}} "secrel.x"}
+ {{objdump -s secrel_64.d}} "secrel.x"}
+ {"Empty export table" "" "" "exports.s"
+ {{objdump -p exports64.d}} "exports.dll"}
}
} elseif {[istarget i*86-*-cygwin*] } {
set pe_tests {
{".secrel32" "--disable-auto-import" "" {secrel1.s secrel2.s}
{{objdump -s secrel.d}} "secrel.x"}
+ {"Empty export table" "" "" "exports.s"
+ {{objdump -p exports.d}} "exports.dll"}
}
} else {
set pe_tests {
{".secrel32" "" "" {secrel1.s secrel2.s}
{{objdump -s secrel.d}} "secrel.x"}
+ {"Empty export table" "" "" "exports.s"
+ {{objdump -p exports.d}} "exports.dll"}
}
}