public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Siddhesh Poyarekar <siddhesh@sourceware.org>,
	 "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
Subject: Re: [PATCH v3] elf: Stop with zero entry point value [BZ #28453]
Date: Fri, 10 Dec 2021 07:07:11 +0100	[thread overview]
Message-ID: <87ilvxc7sg.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CAMe9rOrbKGRAQU2s1Y6PpO3eo1SxZsapfVoZigDG4F1nRRBe=w@mail.gmail.com> (H. J. Lu's message of "Thu, 9 Dec 2021 21:02:51 -0800")

* H. J. Lu:

> diff --git a/elf/rtld.c b/elf/rtld.c
> index 6ce1e07dc0..7d1801c51c 100644
> --- a/elf/rtld.c
> +++ b/elf/rtld.c
> @@ -2491,6 +2491,12 @@ dl_main (const ElfW(Phdr) *phdr,
>        rtld_timer_accum (&relocate_time, start);
>      }
>  
> +  /* Stop if there is no associated entry point.  */
> +  if (rtld_is_main && main_map->l_entry == main_map->l_addr)
> +    _dl_fatal_printf("%s: cannot execute shared object '%s' directly "
> +		     "without entry point\n",
> +		     ld_so_name, rtld_progname);
> +
>    /* Relocation is complete.  Perform early libc initialization.  This
>       is the initial libc, even if audit modules have been loaded with
>       other libcs.  */

I think this is still too early for full backwards compatibility.

However, the bug you are actually trying to fix occurs during
relocation, so it looks to me as if using entry point addresses as an
indicator will not actually work.  And entry point zero is generated by
recent binutils only anyway.

Thanks,
Florian


  reply	other threads:[~2021-12-10  6:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10  2:31 [PATCH] " H.J. Lu
2021-12-10  4:23 ` Florian Weimer
2021-12-10  4:26   ` Florian Weimer
2021-12-10  5:02   ` [PATCH v3] " H.J. Lu
2021-12-10  6:07     ` Florian Weimer [this message]
2021-12-10 13:15       ` H.J. Lu

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=87ilvxc7sg.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=hjl.tools@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=siddhesh@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).