public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: binutils@sourceware.org
Subject: Default entry point for ELF shared objects
Date: Mon, 13 Sep 2021 09:55:39 +0200	[thread overview]
Message-ID: <87r1dsewp0.fsf@oldenburg.str.redhat.com> (raw)

BFD ld currently sets a non-zero entry point address for ELF shared
objects even if the object does not have a _start symbol.

Is there a reason for this behavior (particularly for ELF ET_DYN
output)?

On Linux, the kernel will happily load and execute shared objects using
this entry point address, typically leading to crashes.

If the entry point address in the ELF header were zero, it might be
possible to detect the missing entry point, and refuse to execute the
shared object as if it were a program.

Thanks,
Florian


             reply	other threads:[~2021-09-13  7:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  7:55 Florian Weimer [this message]
2021-09-15 16:49 ` Fangrui Song
2021-09-16  5:01   ` Florian Weimer
2021-09-16  7:41     ` Andreas Schwab
2021-09-16 15:14     ` Hans-Peter Nilsson
2021-09-16 16:39       ` Paul Koning
2021-09-16 16:54         ` Hans-Peter Nilsson
2021-09-16 17:01           ` Florian Weimer
2021-09-16 17:02           ` Paul Koning
2021-09-17  5:40 dvalin

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=87r1dsewp0.fsf@oldenburg.str.redhat.com \
    --to=fweimer@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).