public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Define write_profiling functions only in profile library [BZ #31756]
@ 2024-05-20  1:46 H.J. Lu
  2024-05-22 12:41 ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2024-05-20  1:46 UTC (permalink / raw)
  To: libc-alpha

libc.so doesn't use nor export write_profiling functions.  There is no
point to define them in libc.so nor in libc.a.  Fix BZ #31756 by defining
them only in profile library.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
---
 gmon/gmon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gmon/gmon.c b/gmon/gmon.c
index 6439ed1caa..996b6a62a4 100644
--- a/gmon/gmon.c
+++ b/gmon/gmon.c
@@ -439,6 +439,7 @@ write_gmon (void)
 }
 
 
+#ifdef PROF
 void
 __write_profiling (void)
 {
@@ -448,7 +449,7 @@ __write_profiling (void)
     write_gmon ();
   _gmonparam.state = save;
 }
-#ifndef SHARED
+
 /* This symbol isn't used anywhere in the DSO and it is not exported.
    This would normally mean it should be removed to get the same API
    in static libraries.  But since profiling is special in static libs
-- 
2.45.1


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

* Re: [PATCH] Define write_profiling functions only in profile library [BZ #31756]
  2024-05-20  1:46 [PATCH] Define write_profiling functions only in profile library [BZ #31756] H.J. Lu
@ 2024-05-22 12:41 ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella Netto @ 2024-05-22 12:41 UTC (permalink / raw)
  To: H.J. Lu, libc-alpha



On 19/05/24 22:46, H.J. Lu wrote:
> libc.so doesn't use nor export write_profiling functions.  There is no
> point to define them in libc.so nor in libc.a.  Fix BZ #31756 by defining
> them only in profile library.
> 
> Signed-off-by: H.J. Lu <hjl.tools@gmail.com>

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  gmon/gmon.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gmon/gmon.c b/gmon/gmon.c
> index 6439ed1caa..996b6a62a4 100644
> --- a/gmon/gmon.c
> +++ b/gmon/gmon.c
> @@ -439,6 +439,7 @@ write_gmon (void)
>  }
>  
>  
> +#ifdef PROF
>  void
>  __write_profiling (void)
>  {
> @@ -448,7 +449,7 @@ __write_profiling (void)
>      write_gmon ();
>    _gmonparam.state = save;
>  }
> -#ifndef SHARED
> +
>  /* This symbol isn't used anywhere in the DSO and it is not exported.
>     This would normally mean it should be removed to get the same API
>     in static libraries.  But since profiling is special in static libs

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

end of thread, other threads:[~2024-05-22 12:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-20  1:46 [PATCH] Define write_profiling functions only in profile library [BZ #31756] H.J. Lu
2024-05-22 12:41 ` Adhemerval Zanella Netto

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