From: Rolf Eike Beer <eb@emlix.com>
To: libc-alpha@sourceware.org
Subject: [PATCH 2/2] rtld: turn "Already zero" assumptions into asserts
Date: Tue, 22 Sep 2020 14:13:00 +0200 [thread overview]
Message-ID: <20200922121300.3503-2-eb@emlix.com> (raw)
In-Reply-To: <20200922121300.3503-1-eb@emlix.com>
---
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);
GL(dl_rtld_map).l_libname = &_dl_rtld_libname;
/* Ordinarilly, we would get additional names for the loader from
@@ -1470,7 +1470,7 @@ of this helper program; chances are you did not intend to run this program.\n\
if (p != NULL)
{
_dl_rtld_libname2.name = p;
- /* _dl_rtld_libname2.next = NULL; Already zero. */
+ assert(_dl_rtld_libname2.next == NULL);
_dl_rtld_libname.next = &_dl_rtld_libname2;
}
}
@@ -1555,7 +1555,7 @@ of this helper program; chances are you did not intend to run this program.\n\
/* We were invoked directly, so the program might not have a
PT_INTERP. */
_dl_rtld_libname.name = GL(dl_rtld_map).l_name;
- /* _dl_rtld_libname.next = NULL; Already zero. */
+ assert(_dl_rtld_libname.next == NULL);
GL(dl_rtld_map).l_libname = &_dl_rtld_libname;
}
else
--
2.28.0
next prev parent reply other threads:[~2020-09-22 12:13 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 ` Rolf Eike Beer [this message]
2020-09-22 12:28 ` [PATCH 2/2] rtld: turn "Already zero" assumptions into asserts H.J. Lu via Libc-alpha
2020-09-22 12:38 ` Rolf Eike Beer
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=20200922121300.3503-2-eb@emlix.com \
--to=eb@emlix.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).