unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] rtld: fix typo in comment
@ 2020-09-22 12:12 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:23 ` [PATCH 1/2] rtld: fix typo in comment H.J. Lu via Libc-alpha
  0 siblings, 2 replies; 7+ messages in thread
From: Rolf Eike Beer @ 2020-09-22 12:12 UTC (permalink / raw)
  To: libc-alpha

---
 elf/rtld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elf/rtld.c b/elf/rtld.c
index 5b882163fa..99d130cd1c 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -352,7 +352,7 @@ struct rtld_global _rtld_global =
   };
 /* If we would use strong_alias here the compiler would see a
    non-hidden definition.  This would undo the effect of the previous
-   declaration.  So spell out was strong_alias does plus add the
+   declaration.  So spell out what strong_alias does plus add the
    visibility attribute.  */
 extern struct rtld_global _rtld_local
     __attribute__ ((alias ("_rtld_global"), visibility ("hidden")));
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] rtld: turn "Already zero" assumptions into asserts
  2020-09-22 12:12 [PATCH 1/2] rtld: fix typo in comment Rolf Eike Beer
@ 2020-09-22 12:13 ` Rolf Eike Beer
  2020-09-22 12:28   ` H.J. Lu via Libc-alpha
  2020-09-22 12:23 ` [PATCH 1/2] rtld: fix typo in comment H.J. Lu via Libc-alpha
  1 sibling, 1 reply; 7+ messages in thread
From: Rolf Eike Beer @ 2020-09-22 12:13 UTC (permalink / raw)
  To: libc-alpha

---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] rtld: fix typo in comment
  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:23 ` H.J. Lu via Libc-alpha
  2020-10-12  7:08   ` Rolf Eike Beer
  1 sibling, 1 reply; 7+ messages in thread
From: H.J. Lu via Libc-alpha @ 2020-09-22 12:23 UTC (permalink / raw)
  To: Rolf Eike Beer; +Cc: GNU C Library

On Tue, Sep 22, 2020 at 5:13 AM Rolf Eike Beer <eb@emlix.com> wrote:
>
> ---
>  elf/rtld.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/elf/rtld.c b/elf/rtld.c
> index 5b882163fa..99d130cd1c 100644
> --- a/elf/rtld.c
> +++ b/elf/rtld.c
> @@ -352,7 +352,7 @@ struct rtld_global _rtld_global =
>    };
>  /* If we would use strong_alias here the compiler would see a
>     non-hidden definition.  This would undo the effect of the previous
> -   declaration.  So spell out was strong_alias does plus add the
> +   declaration.  So spell out what strong_alias does plus add the
>     visibility attribute.  */
>  extern struct rtld_global _rtld_local
>      __attribute__ ((alias ("_rtld_global"), visibility ("hidden")));
> --
> 2.28.0
>

LGTM.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] rtld: turn "Already zero" assumptions into asserts
  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
  0 siblings, 1 reply; 7+ messages in thread
From: H.J. Lu via Libc-alpha @ 2020-09-22 12:28 UTC (permalink / raw)
  To: Rolf Eike Beer; +Cc: GNU C Library

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.

>         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
>


-- 
H.J.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] rtld: turn "Already zero" assumptions into asserts
  2020-09-22 12:28   ` H.J. Lu via Libc-alpha
@ 2020-09-22 12:38     ` Rolf Eike Beer
  0 siblings, 0 replies; 7+ messages in thread
From: Rolf Eike Beer @ 2020-09-22 12:38 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GNU C Library

[-- 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 --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] rtld: fix typo in comment
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Rolf Eike Beer @ 2020-10-12  7:08 UTC (permalink / raw)
  To: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 1328 bytes --]

Am Dienstag, 22. September 2020, 14:23:40 CEST schrieb H.J. Lu:
> On Tue, Sep 22, 2020 at 5:13 AM Rolf Eike Beer <eb@emlix.com> wrote:
> > ---
> > 
> >  elf/rtld.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/elf/rtld.c b/elf/rtld.c
> > index 5b882163fa..99d130cd1c 100644
> > --- a/elf/rtld.c
> > +++ b/elf/rtld.c
> > @@ -352,7 +352,7 @@ struct rtld_global _rtld_global =
> > 
> >    };
> >  
> >  /* If we would use strong_alias here the compiler would see a
> >  
> >     non-hidden definition.  This would undo the effect of the previous
> > 
> > -   declaration.  So spell out was strong_alias does plus add the
> > +   declaration.  So spell out what strong_alias does plus add the
> > 
> >     visibility attribute.  */
> >  
> >  extern struct rtld_global _rtld_local
> >  
> >      __attribute__ ((alias ("_rtld_global"), visibility ("hidden")));
> > 
> > --
> > 2.28.0
> 
> LGTM.

Is anyone going to pick it up?

Eike
-- 
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 313 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] rtld: fix typo in comment
  2020-10-12  7:08   ` Rolf Eike Beer
@ 2020-10-13 12:52     ` H.J. Lu via Libc-alpha
  0 siblings, 0 replies; 7+ messages in thread
From: H.J. Lu via Libc-alpha @ 2020-10-13 12:52 UTC (permalink / raw)
  To: Rolf Eike Beer; +Cc: GNU C Library

On Mon, Oct 12, 2020 at 12:08 AM Rolf Eike Beer <eb@emlix.com> wrote:
>
> Am Dienstag, 22. September 2020, 14:23:40 CEST schrieb H.J. Lu:
> > On Tue, Sep 22, 2020 at 5:13 AM Rolf Eike Beer <eb@emlix.com> wrote:
> > > ---
> > >
> > >  elf/rtld.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/elf/rtld.c b/elf/rtld.c
> > > index 5b882163fa..99d130cd1c 100644
> > > --- a/elf/rtld.c
> > > +++ b/elf/rtld.c
> > > @@ -352,7 +352,7 @@ struct rtld_global _rtld_global =
> > >
> > >    };
> > >
> > >  /* If we would use strong_alias here the compiler would see a
> > >
> > >     non-hidden definition.  This would undo the effect of the previous
> > >
> > > -   declaration.  So spell out was strong_alias does plus add the
> > > +   declaration.  So spell out what strong_alias does plus add the
> > >
> > >     visibility attribute.  */
> > >
> > >  extern struct rtld_global _rtld_local
> > >
> > >      __attribute__ ((alias ("_rtld_global"), visibility ("hidden")));
> > >
> > > --
> > > 2.28.0
> >
> > LGTM.
>
> Is anyone going to pick it up?

I checked it in for you.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-10-13 12:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).