debug/getwd_chk.c: warning should be emitted for the __getwd_chk symbol.

Message ID ZW8IG4JcRl-eMNux@hydra
State Committed
Commit 9fd2ceb55de003c09c909103966db913319bcfdc
Headers
Series debug/getwd_chk.c: warning should be emitted for the __getwd_chk symbol. |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Testing passed

Commit Message

Frederic Cambus Dec. 5, 2023, 11:23 a.m. UTC
  Otherwise the warning message for the getwd symbol ends up being duplicated.

Signed-off-by: Frederic Cambus <fred@statdns.com>
---
 debug/getwd_chk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Frederic Cambus Jan. 8, 2024, 2:28 p.m. UTC | #1
On Tue, Dec 05, 2023 at 12:23:07PM +0100, Frederic Cambus wrote:
> Otherwise the warning message for the getwd symbol ends up being duplicated.
> 
> Signed-off-by: Frederic Cambus <fred@statdns.com>
> ---
>  debug/getwd_chk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/debug/getwd_chk.c b/debug/getwd_chk.c
> index 850aa1aa14..cf61d8d5a0 100644
> --- a/debug/getwd_chk.c
> +++ b/debug/getwd_chk.c
> @@ -29,5 +29,5 @@ __getwd_chk (char *buf, size_t buflen)
>    return res;
>  }
>  
> -link_warning (getwd,
> +link_warning (__getwd_chk,
>  	      "the `getwd' function is dangerous and should not be used.")
> -- 
> 2.43.0

Ping. Anyone willing to look at this?

In case it was not clear, here is the output of objdump before applying
the patch:

objdump -s -j .gnu.warning.getwd libc.so

./libc.so:     file format elf64-x86-64

Contents of section .gnu.warning.getwd:
 0000 74686520 60676574 77642720 66756e63  the `getwd' func
 0010 74696f6e 20697320 64616e67 65726f75  tion is dangerou
 0020 7320616e 64207368 6f756c64 206e6f74  s and should not
 0030 20626520 75736564 2e000000 00000000   be used........
 0040 74686520 60676574 77642720 66756e63  the `getwd' func
 0050 74696f6e 20697320 64616e67 65726f75  tion is dangerou
 0060 7320616e 64207368 6f756c64 206e6f74  s and should not
 0070 20626520 75736564 2e00                be used..

And after applying the patch:

objdump -s -j .gnu.warning.getwd libc.so

./libc.so:     file format elf64-x86-64

Contents of section .gnu.warning.getwd:
 0000 74686520 60676574 77642720 66756e63  the `getwd' func
 0010 74696f6e 20697320 64616e67 65726f75  tion is dangerou
 0020 7320616e 64207368 6f756c64 206e6f74  s and should not
 0030 20626520 75736564 2e00                be used..
  
Adhemerval Zanella Netto Jan. 8, 2024, 2:32 p.m. UTC | #2
On 05/12/23 08:23, Frederic Cambus wrote:
> Otherwise the warning message for the getwd symbol ends up being duplicated.
> 
> Signed-off-by: Frederic Cambus <fred@statdns.com>

LGTM, thanks.  Andreas will need to ack for 2.39.

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

> ---
>  debug/getwd_chk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/debug/getwd_chk.c b/debug/getwd_chk.c
> index 850aa1aa14..cf61d8d5a0 100644
> --- a/debug/getwd_chk.c
> +++ b/debug/getwd_chk.c
> @@ -29,5 +29,5 @@ __getwd_chk (char *buf, size_t buflen)
>    return res;
>  }
>  
> -link_warning (getwd,
> +link_warning (__getwd_chk,
>  	      "the `getwd' function is dangerous and should not be used.")
  
Andreas K. Huettel Jan. 11, 2024, 9:34 p.m. UTC | #3
Am Montag, 8. Januar 2024, 15:32:07 CET schrieb Adhemerval Zanella Netto:
> 
> On 05/12/23 08:23, Frederic Cambus wrote:
> > Otherwise the warning message for the getwd symbol ends up being duplicated.
> > 
> > Signed-off-by: Frederic Cambus <fred@statdns.com>
> 
> LGTM, thanks.  Andreas will need to ack for 2.39.

OK imho.

> 
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
> 
> > ---
> >  debug/getwd_chk.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/debug/getwd_chk.c b/debug/getwd_chk.c
> > index 850aa1aa14..cf61d8d5a0 100644
> > --- a/debug/getwd_chk.c
> > +++ b/debug/getwd_chk.c
> > @@ -29,5 +29,5 @@ __getwd_chk (char *buf, size_t buflen)
> >    return res;
> >  }
> >  
> > -link_warning (getwd,
> > +link_warning (__getwd_chk,
> >  	      "the `getwd' function is dangerous and should not be used.")
>
  

Patch

diff --git a/debug/getwd_chk.c b/debug/getwd_chk.c
index 850aa1aa14..cf61d8d5a0 100644
--- a/debug/getwd_chk.c
+++ b/debug/getwd_chk.c
@@ -29,5 +29,5 @@  __getwd_chk (char *buf, size_t buflen)
   return res;
 }
 
-link_warning (getwd,
+link_warning (__getwd_chk,
 	      "the `getwd' function is dangerous and should not be used.")