public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: fziglio@redhat.com
To: binutils@sourceware.org
Cc: Frediano Ziglio <fziglio@redhat.com>
Subject: [PATCH] Do not use DLL entry point for executables
Date: Fri, 28 Aug 2020 10:44:42 +0100	[thread overview]
Message-ID: <20200828094442.73277-1-fziglio@redhat.com> (raw)

From: Frediano Ziglio <fziglio@redhat.com>

bfd_link_pic check for dll or pie type.
If the type is pie the results should be an executable which
entry point should be an executable entry point, not a DLL
one.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 ld/emultempl/pe.em  | 2 +-
 ld/emultempl/pep.em | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index 9d2097f486..8b44d65c1d 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 7d9395168d..4cf38428d8 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";
     }
-- 
2.25.4


             reply	other threads:[~2020-08-28  9:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-28  9:44 fziglio [this message]
2020-09-22 11:49 ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200828094442.73277-1-fziglio@redhat.com \
    --to=fziglio@redhat.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).