ld/ChangeLog
authorDave Korn <dave.korn@artimi.com>
Thu, 2 Apr 2009 14:42:41 +0000 (14:42 +0000)
committerDave Korn <dave.korn@artimi.com>
Thu, 2 Apr 2009 14:42:41 +0000 (14:42 +0000)
PR ld/6744
* ld.texinfo (--export-dynamic):  Mention --export-all-symbols.
* emultempl/pe.em (gld_${EMULATION_NAME}_after_parse):  Issue
warning if --export-dynamic was passed on command-line.
* emultempl/pep.em (gld_${EMULATION_NAME}_after_parse):  Likewise.

ld/testsuite/ChangeLog

PR ld/6744
* ld-pe/export_dynamic_warning.d:  New test control file.
* ld-pe/export_dynamic_warning.s:  New test source file.
* ld-pe/pe.exp:  Also run export_dynamic_warning dump test.

ld/ChangeLog
ld/emultempl/pe.em
ld/emultempl/pep.em
ld/ld.texinfo
ld/testsuite/ChangeLog
ld/testsuite/ld-pe/export_dynamic_warning.d [new file with mode: 0644]
ld/testsuite/ld-pe/export_dynamic_warning.s [new file with mode: 0755]
ld/testsuite/ld-pe/pe.exp

index 378e85557c7105ffaa98b6f1ad6d72b97757de67..0d4e0159b5c91ae5fc603ff962d467a967717118 100644 (file)
@@ -1,3 +1,11 @@
+2009-04-02  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       PR ld/6744
+       * ld.texinfo (--export-dynamic):  Mention --export-all-symbols.
+       * emultempl/pe.em (gld_${EMULATION_NAME}_after_parse):  Issue
+       warning if --export-dynamic was passed on command-line.
+       * emultempl/pep.em (gld_${EMULATION_NAME}_after_parse):  Likewise.
+
 2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
 
        * emultempl/aix.em (gld${EMULATION_NAME}_open_dynamic_archive): New
index 04d722952491b8da951501fa6e55fee593020e05..2bfd5faf733e5c4aa0f37ddc059210a08db67655 100644 (file)
@@ -887,6 +887,12 @@ gld_${EMULATION_NAME}_after_parse (void)
 
   if (! link_info.relocatable && entry_symbol.name != NULL)
     ldlang_add_undef (entry_symbol.name);
+
+  /* PR ld/6744:  Warn the user if they have used an ELF-only
+     option hoping it will work on PE.  */
+  if (link_info.export_dynamic)
+    einfo (_("%P: warning: --export-dynamic is not supported for PE "
+      "targets, did you mean --export-all-symbols?\n"));
 }
 
 /* pe-dll.c directly accesses pe_data_import_dll,
index ee4eeeb744462f87ae10834e95816f4d53fbd542..9c79e5acfdb33998370a3fd498876067d829b61b 100644 (file)
@@ -824,6 +824,12 @@ gld_${EMULATION_NAME}_after_parse (void)
 
   if (! link_info.relocatable && entry_symbol.name != NULL)
     ldlang_add_undef (entry_symbol.name);
+
+  /* PR ld/6744:  Warn the user if they have used an ELF-only
+     option hoping it will work on PE+.  */
+  if (link_info.export_dynamic)
+    einfo (_("%P: warning: --export-dynamic is not supported for PE+ "
+      "targets, did you mean --export-all-symbols?\n"));
 }
 
 /* pep-dll.c directly accesses pep_data_import_dll,
index 32e8783be81401f42dff7f490cb3a02f42fbb809..b6f0a0b00adcbd995c8c20442be17323152b125c 100644 (file)
@@ -510,6 +510,10 @@ You can also use the dynamic list to control what symbols should
 be added to the dynamic symbol table if the output format supports it.
 See the description of @samp{--dynamic-list}.
 
+Note that this option is specific to ELF targeted ports.  PE targets
+support a similar function to export all symbols from a DLL or EXE; see
+the description of @samp{--export-all-symbols} below.
+
 @ifclear SingleFormat
 @cindex big-endian objects
 @cindex endianness
index 60ed315a24f0d0706e5c394fd01008b704adb000..7290e1b2b6636298dad564f0f082d6449c32c382 100644 (file)
@@ -1,3 +1,10 @@
+2009-04-02  Dave Korn  <dave.korn.cygwin@gmail.com>
+
+       PR ld/6744
+       * ld-pe/export_dynamic_warning.d:  New test control file.
+       * ld-pe/export_dynamic_warning.s:  New test source file.
+       * ld-pe/pe.exp:  Also run export_dynamic_warning dump test.
+
 2009-04-02  Christophe Lyon  <christophe.lyon@st.com>
 
        * ld-arm/farcall-thumb-thumb-pic-veneer.d: Update expected
diff --git a/ld/testsuite/ld-pe/export_dynamic_warning.d b/ld/testsuite/ld-pe/export_dynamic_warning.d
new file mode 100644 (file)
index 0000000..57cecb6
--- /dev/null
@@ -0,0 +1,5 @@
+#name: PE-COFF --export-dynamic warning
+#target: *-*-mingw32 *-*-cygwin *-*-pe
+#ld: --export-dynamic
+#warning: warning: --export-dynamic is not supported for PE targets, did you mean --export-all-symbols?
+
diff --git a/ld/testsuite/ld-pe/export_dynamic_warning.s b/ld/testsuite/ld-pe/export_dynamic_warning.s
new file mode 100755 (executable)
index 0000000..e221c36
--- /dev/null
@@ -0,0 +1,5 @@
+
+_start:
+       xor     %eax,%eax
+       ret
+
index f489e89d9338a3129d17ef47ec8939b9cdabf78c..2aa4d20f2460ff4b27fc119cca062fb7b3434364 100644 (file)
@@ -49,3 +49,4 @@ if {[istarget x86_64-*-mingw*] } {
 run_ld_link_tests $pe_tests\r
 \r
 run_dump_test "image_size"\r
+run_dump_test "export_dynamic_warning"\r