diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2020-09-22 12:48:04 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-09-22 12:48:04 +0100 |
commit | 307f2595ddeebff38f95045b25be937e6b72eff2 (patch) | |
tree | 2c297ff5d96a1a28674b0139b23b3f3f3952fe96 /ld | |
parent | db47f2458fe31df67026ed1c041812a968f96f7e (diff) | |
download | binutils-gdb-307f2595ddeebff38f95045b25be937e6b72eff2.tar.gz |
Linker: If the type is pie the results should be an executable which entry point should be an executable entry point, not a DLL one.
* emultempl/pe.em (set_entry_point): Only use the DLL entry point
for DLLs.
* emultempl/pep.em (set_entry_point): Likewise.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/emultempl/pe.em | 2 | ||||
-rw-r--r-- | ld/emultempl/pep.em | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index cffb271598d..dfa58a9ebaa 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -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. diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 055d08d1849..22993c53753 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -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"; diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index f161cce2b5f..b0a047143a0 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -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"; } |