diff mbox series

Define write_profiling functions only in profile library [BZ #31756]

Message ID 20240520014653.3219528-1-hjl.tools@gmail.com
State New
Headers show
Series Define write_profiling functions only in profile library [BZ #31756] | expand

Commit Message

H.J. Lu May 20, 2024, 1:46 a.m. UTC
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(-)

Comments

Adhemerval Zanella May 22, 2024, 12:41 p.m. UTC | #1
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
diff mbox series

Patch

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