From: Rolf Eike Beer <eb@emlix.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH 2/2] rtld: turn "Already zero" assumptions into asserts
Date: Tue, 22 Sep 2020 14:38:08 +0200 [thread overview]
Message-ID: <5224875.DOkh6Dc2oj@devpool47> (raw)
In-Reply-To: <CAMe9rOrnzxZTUgehYCDeakU59bjpus7WvuzFktoDJ5m1-mTiDA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1197 bytes --]
H.J. Lu wrote:
> On Tue, Sep 22, 2020 at 5:13 AM Rolf Eike Beer <eb@emlix.com> wrote:
> > ---
> >
> > elf/rtld.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/elf/rtld.c b/elf/rtld.c
> > index 99d130cd1c..441d837095 100644
> > --- a/elf/rtld.c
> > +++ b/elf/rtld.c
> > @@ -1449,7 +1449,7 @@ of this helper program; chances are you did not
> > intend to run this program.\n\>
> > the shared object is already loaded. */
> >
> > _dl_rtld_libname.name = ((const char *) main_map->l_addr
> >
> > + ph->p_vaddr);
> >
> > - /* _dl_rtld_libname.next = NULL; Already zero. */
> > + assert(_dl_rtld_libname.next == NULL);
>
> Space after assert. Same applies to other changes.
> and there are
>
> rtld.c:static struct libname_list _dl_rtld_libname;
> rtld.c:static struct libname_list _dl_rtld_libname2;
>
> There is no need for assert of zero on static variables.
Except when by accident the .bss section is not behind the last PT_LOAD and
suddenly is not zeroed out anymore and it takes you a while to find out _what_
exactly is broken ;) But fine with me.
Eike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 313 bytes --]
next prev parent reply other threads:[~2020-09-22 12:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 12:12 [PATCH 1/2] rtld: fix typo in comment Rolf Eike Beer
2020-09-22 12:13 ` [PATCH 2/2] rtld: turn "Already zero" assumptions into asserts Rolf Eike Beer
2020-09-22 12:28 ` H.J. Lu via Libc-alpha
2020-09-22 12:38 ` Rolf Eike Beer [this message]
2020-09-22 12:23 ` [PATCH 1/2] rtld: fix typo in comment H.J. Lu via Libc-alpha
2020-10-12 7:08 ` Rolf Eike Beer
2020-10-13 12:52 ` H.J. Lu via Libc-alpha
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
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5224875.DOkh6Dc2oj@devpool47 \
--to=eb@emlix.com \
--cc=hjl.tools@gmail.com \
--cc=libc-alpha@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).