[PATCH] bfd/elf64-ppc.c: fix clang -Wbitwise-instead-of-logical warning in ppc64_elf_check_init_fini

Alan Modra amodra@gmail.com
Mon Jan 17 11:14:30 GMT 2022


On Mon, Jan 17, 2022 at 05:50:46AM -0500, Simon Marchi wrote:
> 
> 
> On 2022-01-16 18:10, Alan Modra wrote:
> > On Sat, Jan 15, 2022 at 10:13:07PM -0500, Simon Marchi via Binutils wrote:
> >> --- a/bfd/elf64-ppc.c
> >> +++ b/bfd/elf64-ppc.c
> >> @@ -13129,7 +13129,7 @@ bool
> >>  ppc64_elf_check_init_fini (struct bfd_link_info *info)
> >>  {
> >>    return (check_pasted_section (info, ".init")
> >> -	  & check_pasted_section (info, ".fini"));
> >> +	  && check_pasted_section (info, ".fini"));
> >>  }
> >>  
> >>  /* See whether we can group stub sections together.  Grouping stub
> > 
> > I think I'd rather see this fixed by
> > 
> >   bool ret1 = check_pasted_section (info, ".init");
> >   bool ret2 = check_pasted_section (info, ".fini");
> >   return ret1 && ret1;
> > 
> > check_pasted_section has a side effect, and failure normally only
> > produces a warning.
> > 
> 
> No problem, here's the updated patch.

Thanks, please commit.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list