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.
This commit is contained in:
Frediano Ziglio
2020-09-22 12:48:04 +01:00
committed by Nick Clifton
parent db47f2458f
commit 307f2595dd
3 changed files with 8 additions and 2 deletions

View 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> 2020-09-16 Mikael Pettersson <mikpelinux@gmail.com>
* testsuite/ld-elf/shared.exp: Add -Av9 to AFLAGS_PIE on sparc. * testsuite/ld-elf/shared.exp: Add -Av9 to AFLAGS_PIE on sparc.

View File

@ -571,7 +571,7 @@ set_entry_point (void)
/* Entry point name for arbitrary subsystem numbers. */ /* Entry point name for arbitrary subsystem numbers. */
static const char default_entry[] = "mainCRTStartup"; 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) #if defined (TARGET_IS_i386pe)
entry = "DllMainCRTStartup@12"; entry = "DllMainCRTStartup@12";

View File

@ -537,7 +537,7 @@ set_entry_point (void)
/* Entry point name for arbitrary subsystem numbers. */ /* Entry point name for arbitrary subsystem numbers. */
static const char default_entry[] = "mainCRTStartup"; static const char default_entry[] = "mainCRTStartup";
if (bfd_link_pic (&link_info) || dll) if (bfd_link_dll (&link_info) || dll)
{ {
entry = "DllMainCRTStartup"; entry = "DllMainCRTStartup";
} }