[PATCH] [ld][x86_64] remove unnecessary check

Sam James sam@gentoo.org
Fri Nov 1 09:11:39 GMT 2024


ywgrit <yw987194828@gmail.com> writes:

> I executed "make check", and didn't find anything "unexpected" in the test results, so I guess it didn't cause any linker
> test regression. In addition to this,  this patch has a little thing needs to modify, so I will send the next version. 

The binutils testsuite should have 0 FAIL, it is not like e.g. GCC where
some FAILs are known but you should diff results.

>
> H.J. Lu <hjl.tools@gmail.com> 于2024年11月1日周五 16:06写道:
>
>  On Fri, Nov 1, 2024 at 3:39 PM Xin Wang <yw987194828@gmail.com> wrote:
>  >
>  > Signed-off-by: Xin Wang <yw987194828@gmail.com>
>  > ---
>  >  bfd/elf64-x86-64.c | 10 ++--------
>  >  1 file changed, 2 insertions(+), 8 deletions(-)
>  >
>  > diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
>  > index 4330bbd1648..209b14a46d9 100644
>  > --- a/bfd/elf64-x86-64.c
>  > +++ b/bfd/elf64-x86-64.c
>  > @@ -1613,7 +1613,6 @@ elf_x86_64_need_pic (struct bfd_link_info *info,
>  >             v = _("protected symbol ");
>  >           else
>  >             v = _("symbol ");
>  > -         pic = NULL;
>  >           break;
>  >         }
>  >
>  > @@ -1621,16 +1620,12 @@ elf_x86_64_need_pic (struct bfd_link_info *info,
>  >         und = _("undefined ");
>  >      }
>  >    else
>  > -    {
>  >        name = bfd_elf_sym_name (input_bfd, symtab_hdr, isym, NULL);
>  > -      pic = NULL;
>  > -    }
>  >
>  >    if (bfd_link_dll (info))
>  >      {
>  >        object = _("a shared object");
>  > -      if (!pic)
>  > -       pic = _("; recompile with -fPIC");
>  > +      pic = _("; ");
>  >      }
>  >    else
>  >      {
>  > @@ -1638,8 +1633,7 @@ elf_x86_64_need_pic (struct bfd_link_info *info,
>  >         object = _("a PIE object");
>  >        else
>  >         object = _("a PDE object");
>  > -      if (!pic)
>  > -       pic = _("; recompile with -fPIE");
>  > +      pic = _("; recompile with -fPIE");
>  >      }
>  >
>  >    /* xgettext:c-format */
>  > --
>  > 2.25.1
>  >
>
>  Does this patch cause any linker test regression?
>
>  -- 
>  H.J.


More information about the Binutils mailing list