public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fweimer@redhat.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 05:15:58 -0800	[thread overview]
Message-ID: <CAMe9rOqiEfViYzd6ysBOq5psJw-GZv-g6NBW+vjr=QB=P0Y_5g@mail.gmail.com> (raw)
In-Reply-To: <87ilvxc7sg.fsf@oldenburg.str.redhat.com>

On Thu, Dec 9, 2021 at 10:07 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> * 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.

True.  There is no easy way to identify a wrong entry point generated
by the old linkers.

> Thanks,
> Florian
>


-- 
H.J.

      reply	other threads:[~2021-12-10 13:16 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
2021-12-10 13:15       ` H.J. Lu [this message]

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='CAMe9rOqiEfViYzd6ysBOq5psJw-GZv-g6NBW+vjr=QB=P0Y_5g@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=fweimer@redhat.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).