Linker: If the type is pie the results should be an executable which entry point...
authorFrediano Ziglio <fziglio@redhat.com>
Tue, 22 Sep 2020 11:48:04 +0000 (12:48 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 22 Sep 2020 11:48:04 +0000 (12:48 +0100)
* emultempl/pe.em (set_entry_point): Only use the DLL entry point
for DLLs.
* emultempl/pep.em (set_entry_point): Likewise.

ld/ChangeLog
ld/emultempl/pe.em
ld/emultempl/pep.em

index cffb271598d276ae5600cf010bdace014d7fa41f..dfa58a9ebaaba2b2a3b2801a959b3f4fe850e7ee 100644 (file)
@@ -1,3 +1,9 @@
+2020-09-22  Frediano Ziglio  <fziglio@redhat.com>
+
+       * emultempl/pe.em (set_entry_point): Only use the DLL entry point
+       for DLLs.
+       * emultempl/pep.em (set_entry_point): Likewise.
+
 2020-09-16  Mikael Pettersson  <mikpelinux@gmail.com>
 
        * testsuite/ld-elf/shared.exp: Add -Av9 to AFLAGS_PIE on sparc.
index 055d08d1849c5e8095aef2059ec115043636aeac..22993c5375395de51bb42e0e1468ffe21ca5876c 100644 (file)
@@ -571,7 +571,7 @@ set_entry_point (void)
   /* Entry point name for arbitrary subsystem numbers.  */
   static const char default_entry[] = "mainCRTStartup";
 
-  if (bfd_link_pic (&link_info) || dll)
+  if (bfd_link_dll (&link_info) || dll)
     {
 #if defined (TARGET_IS_i386pe)
       entry = "DllMainCRTStartup@12";
index f161cce2b5f16a5162c48544ff709cba94510d40..b0a047143a07e6138f35e9bb15307d864e427666 100644 (file)
@@ -537,7 +537,7 @@ set_entry_point (void)
   /* Entry point name for arbitrary subsystem numbers.  */
   static const char default_entry[] = "mainCRTStartup";
 
-  if (bfd_link_pic (&link_info) || dll)
+  if (bfd_link_dll (&link_info) || dll)
     {
       entry = "DllMainCRTStartup";
     }